public void SetupAfterDeSerialize(DownloadManager argDLManager, WatchThreadManager argWatchThreadManager, RefreshWatchListDelegate argRefreshListViewCallback) { try { this.threadStatus = 2; this.thread404d = false; this.updatingHtml = false; this.checkLocalFiles = true; this.isRunning = false; this.RefreshListViewCallback = argRefreshListViewCallback; this.downloadManager = argDLManager; this.watchThreadManager = argWatchThreadManager; this.threadURI = new Uri(this.threadURL); this.RegisterDebugLog(argWatchThreadManager.debugLogText); this.SetupViewItem(); this.StartRunning(); } catch (Exception exception) { MessageBox.Show("Error in SetupAfterDeSerialize.\r\n" + exception.Message); } }
public WatchThreadManager Deserialize() { if (!File.Exists(this.serializeFilePath)) { throw new Exception("File Not Found on deserialize"); } this.watchThreadManager = new WatchThreadManager(); try { XmlSerializer serializer = new XmlSerializer(typeof(WatchThreadManager)); TextReader textReader = new StreamReader(this.serializeFilePath); this.watchThreadManager = (WatchThreadManager)serializer.Deserialize(textReader); textReader.Close(); this.watchThreadManager.DeleteAllHiddenThreads(); this.watchThreadManager.RefreshListViewCallback = this.RefreshListViewCallback; this.watchThreadManager.RegisterWatchThreadViewCollection(this.watchThreadViewCollection); this.watchThreadManager.RegisterDownloadManager(this.downloadManager); this.watchThreadManager.RegisterDebugLog(this.debugLogText); this.watchThreadManager.SetupAfterDeSerialize(); } catch (Exception exception) { throw new Exception("Error in WatchThreadSerializer Deserialize.\r\n" + exception.Message); } return this.watchThreadManager; }
public WatchThreadManager Deserialize() { if (!File.Exists(this.serializeFilePath)) { throw new Exception("File Not Found on deserialize"); } this.watchThreadManager = new WatchThreadManager(); try { XmlSerializer serializer = new XmlSerializer(typeof(WatchThreadManager)); TextReader textReader = new StreamReader(this.serializeFilePath); this.watchThreadManager = (WatchThreadManager)serializer.Deserialize(textReader); textReader.Close(); this.watchThreadManager.DeleteAllHiddenThreads(); this.watchThreadManager.RefreshListViewCallback = this.RefreshListViewCallback; this.watchThreadManager.RegisterWatchThreadViewCollection(this.watchThreadViewCollection); this.watchThreadManager.RegisterDownloadManager(this.downloadManager); this.watchThreadManager.RegisterDebugLog(this.debugLogText); this.watchThreadManager.SetupAfterDeSerialize(); } catch (Exception exception) { throw new Exception("Error in WatchThreadSerializer Deserialize.\r\n" + exception.Message); } return(this.watchThreadManager); }
public void SetupAfterDeSerialize(DownloadManager argDLManager, WatchThreadManager argWatchThreadManager, RefreshWatchListDelegate argRefreshListViewCallback) { try { this.threadStatus = 2; this.thread404d = false; this.updatingHtml = false; this.checkLocalFiles = true; this.isRunning = false; this.RefreshListViewCallback = argRefreshListViewCallback; this.downloadManager = argDLManager; this.watchThreadManager = argWatchThreadManager; this.threadURI = new Uri(this.threadURL); this.RegisterDebugLog(argWatchThreadManager.debugLogText); this.SetupViewItem(); this.StartRunning(); } catch (Exception exception) { MessageBox.Show("Error in SetupAfterDeSerialize.\r\n" + exception.Message); } }