Example #1
0
        static public void Initialize()
        {
            _textManager = new MTTextMgrModel();

            _wAutoTestWorker = new BackgroundWorker();
            _wAutoTestWorker.WorkerSupportsCancellation = true;
            _lstTest = new ObservableCollection <MTTestModel>();
            string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location;

            _LibraryPath = System.IO.Path.GetDirectoryName(appPath) + "\\Library\\";
            _UserPath    = System.IO.Path.GetDirectoryName(appPath) + "\\Users\\";

            if (!Directory.Exists(_UserPath))
            {
                Directory.CreateDirectory(_UserPath);
            }

            InitializeLibrary();
            string sSettingsPath = _UserPath + "Settings.xml";

            MTParser.Read(sSettingsPath);
            MTParser.ReadAllInFolder(PatchPath);

            MTClassificator.UpdateAllPatches();

            _dlgPositTest = new DialogPositioner();

            //Show Main Dialog
            _dlgMainView = new MTMainView();
            _dlgMainView.Show();
            InitializeNotificationIcon();
            _dlgTest = new MTTestView();
        }
Example #2
0
 public static double LastPoints(MTPatchModel objPatch)
 {
     if (objPatch.lstTest.Count == 0)
     {
         return(0);
     }
     else if (objPatch.lstTest.Count == 1)
     {
         return(MTClassificator.GetPoints(objPatch.Created, objPatch.LastDateTest, true));
     }
     else //if (_lstTest.Count > 1)
     {
         return(MTClassificator.GetPoints(objPatch.lstTest[objPatch.lstTest.Count - 2].Date, objPatch.LastDateTest, true));
     }
 }
Example #3
0
        public static MTTestModel GetNextTest(ObservableCollection <MTTestModel> lstTest)
        {
            if (_dlgMainView.lvTexts.Items.Count == 0)
            {
                return(null);
            }

            MTClassificator.UpdateAllPositions();
            foreach (MTPatchModel objPatch in _dlgMainView.lvTexts.Items)
            {
                var obj = lstTest.Where(x => x.Patch == objPatch);

                if (obj.Count() == 0)
                {
                    MTTestModel dlgTest = objPatch.NextTest;
                    return(dlgTest);
                }
            }
            return(null);
        }