Ejemplo n.º 1
0
 private void buttonClearCache_Click(object sender, RoutedEventArgs e)
 {
     bool flag = true;
     string str = "";
     TrainsCacheStorage storage = new TrainsCacheStorage();
     if (!storage.Clear())
     {
         flag = false;
         str = str + string.Format("\n\r {0}", storage.LastError);
     }
     TrainGraphCacheStorage storage2 = new TrainGraphCacheStorage();
     if (!storage2.Clear())
     {
         flag = false;
         str = str + string.Format("\n\r {0}", storage2.LastError);
     }
     LayoutCacheStorage storage3 = new LayoutCacheStorage();
     if (!storage3.Clear())
     {
         flag = false;
         str = str + string.Format("\n\r {0}", storage3.LastError);
     }
     if (flag)
     {
         MessageBox.Show("Cache removed successfully");
     }
     else
     {
         MessageBox.Show("Cache removing failed..." + str);
     }
 }
Ejemplo n.º 2
0
        private void buttonClearCache_Click(object sender, RoutedEventArgs e)
        {
            bool               flag    = true;
            string             str     = "";
            TrainsCacheStorage storage = new TrainsCacheStorage();

            if (!storage.Clear())
            {
                flag = false;
                str  = str + string.Format("\n\r {0}", storage.LastError);
            }
            TrainGraphCacheStorage storage2 = new TrainGraphCacheStorage();

            if (!storage2.Clear())
            {
                flag = false;
                str  = str + string.Format("\n\r {0}", storage2.LastError);
            }
            LayoutCacheStorage storage3 = new LayoutCacheStorage();

            if (!storage3.Clear())
            {
                flag = false;
                str  = str + string.Format("\n\r {0}", storage3.LastError);
            }
            if (flag)
            {
                MessageBox.Show("Cache removed successfully");
            }
            else
            {
                MessageBox.Show("Cache removing failed..." + str);
            }
        }
Ejemplo n.º 3
0
 public override bool Save()
 {
     TrainsCacheStorage storage = new TrainsCacheStorage();
     string data = DCSerializer.SerializeWithDCS(this);
     storage.Clear();
     bool flag = storage.Save(data, out this.LastError);
     base.LastError = base.LastError + string.Format(" Len={0}", data.Length);
     return flag;
 }
Ejemplo n.º 4
0
        public override bool Save()
        {
            TrainsCacheStorage storage = new TrainsCacheStorage();
            string             data    = DCSerializer.SerializeWithDCS(this);

            storage.Clear();
            bool flag = storage.Save(data, out this.LastError);

            base.LastError = base.LastError + string.Format(" Len={0}", data.Length);
            return(flag);
        }