Пример #1
0
        public MainForm()
        {
            InitializeComponent();

            _doc = new XmlDocument();
            _doc.Load(APPCONFIGFILENAME);
            _syncInfo = new SynchronisationInfo();
        }
Пример #2
0
 public Engine(string runName, DateTime runStamp, SynchronisationDirection direction, SynchronisationInfo syncInfo)
     : this()
 {
     this.SyncInfo = syncInfo;
     this.Direction = direction;
     this.RunName = runName;
     this.RunStamp = runStamp;
 }
Пример #3
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (_syncInfo.Changed || _changed)
                {
                    if (MessageBox.Show("Discard changes?", "", MessageBoxButtons.YesNo) == DialogResult.No)
                        return;
                }

                openFileDialog1.FileName = "";
                openFileDialog1.Multiselect = false;
                openFileDialog1.Filter = "Sdata Synchronizer Settings (*.sync)|*.sync";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {

                    Stream st = openFileDialog1.OpenFile();
                    XmlSerializer serializer = new XmlSerializer(typeof(SynchronisationInfo));
                    TextReader tr = new StreamReader(st);// ("test.sync");
                    _syncInfo = (SynchronisationInfo)serializer.Deserialize(tr);
                    _syncInfo.Changed = false;
                    _changed = false;
                    _fileName = openFileDialog1.FileName;
                    tr.Close();
                    DisplayModel();
                }
            }
            catch (Exception exp)
            {
                ShowException(exp);
            }
        }