public class Session : WebThingPlugin {
WebThing wt;
+ string CurrentSession = "Default";
public override void Init(WebThing wt) {
this.wt = wt;
public override void Deinit(WebThing wt) {
if (Options.ContainsKey("AutoSave") && Config.ParseBool(Options["AutoSave"])) {
- SaveSession("Default");
+ SaveSession(CurrentSession);
}
}
}
string[] pages = Regex.Split(Options[SessionName], @"\s+");
foreach (string page in pages) {
- wt.OpenUriTab(page);
+ wt.OpenTab(page);
}
+ CurrentSession = SessionName;
} else {
Console.WriteLine("Could not restore session {0} because it does not exist.", SessionName);
}
Options[SessionName] = String.Join(" ", Uris.ToArray());
SaveConfig();
}
+
+ public void DeleteSession(string SessionName) {
+ Options.Remove(SessionName);
+ SaveConfig();
+ }
}