private void Window_Loaded(object sender, RoutedEventArgs e) { GVL.Init(); this.DataContext = GVL.Instance; m_SaveTimer = new DispatcherTimer(); m_SaveTimer.Tick += new EventHandler(SaveTimerCB); m_SaveTimer.Interval = TimeSpan.FromSeconds(10); m_SaveTimer.Start(); }
public void CopyFrom(GVL other) { this.NovelFilePath = other.NovelFilePath; this.CurNovel = other.CurNovel; UpdateTreeView(); foreach (OutlineNode node in other.OutlineTree) { this.OutlineTree.Add(node); } }
GVL ReadFromFile(string filepath) { try { string alltext = File.ReadAllText(filepath); GVL tempInstance = JsonConvert.DeserializeObject <GVL>(alltext); tempInstance.NovelFilePath = filepath; return(tempInstance); } catch (Exception ex) { MessageBox.Show(ex.ToString()); return(null); } }
public static void Init() { _instance = new GVL(); }