Пример #1
0
 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();
 }
Пример #2
0
 public void CopyFrom(GVL other)
 {
     this.NovelFilePath = other.NovelFilePath;
     this.CurNovel      = other.CurNovel;
     UpdateTreeView();
     foreach (OutlineNode node in other.OutlineTree)
     {
         this.OutlineTree.Add(node);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 public static void Init()
 {
     _instance = new GVL();
 }