Exemplo n.º 1
0
        private static void Starter(string[] args)
        {
            ConfigLoader.Load();
            string log4netConfigPath = new PathCutHelper()
                .CutExecutableFileFromPath(System.Reflection.Assembly
                                           .GetExecutingAssembly().Location);
            log4netConfigPath += @"\Minder.log4net.xml";
            FileInfo config = new FileInfo(log4netConfigPath);
            log4net.Config.XmlConfigurator.Configure(config);
            log4net.ILog logger = log4net.LogManager.GetLogger(typeof(BootStrap));

            bool openForm = false;
            if(args != null)
            {
                foreach(string arg in args)
                {
                    if(arg.ToLower().Equals("--openform"))
                        openForm = true;
                }
            }

            SettingsLoader loader = new SettingsLoader();
            loader.LoadSettings();
            Minder.Static.StaticData.Settings.LogFilePath = @"Log\Minder.log";

            UpdateDBVersion();
            Info syncInfo = InfoFinder.FindByUniqueCode(Minder.Static.StaticData.InfoUniqueCodes.InfoLastSyncDate);
            if(syncInfo != null)
                Minder.Static.StaticData.Settings.Sync.LastSyncDate = Convert.ToDateTime(syncInfo.Value1);

            new StartWithWinController().StartWithWindows();
            //if(Minder.Static.StaticData.Settings.CheckUpdates)
            //	new UpdateProject(StaticData.VersionCache.Version, true, "Minder");

            MainFormPreparer preparer = new MainFormPreparer();
            if(openForm)
                preparer.PrepareForm(openForm);
            else
                preparer.PrepareForm();

            MousePositionHelper mouseMoveChecker = new MousePositionHelper();
            mouseMoveChecker.SartMouseMoveChecker();

            TimeController timeController = new TimeController(preparer);
            timeController.Start();

            logger.Info("Minder started");
        }
Exemplo n.º 2
0
 public TimeController(MainFormPreparer m_formPreparer)
 {
     this.m_formPreparer = m_formPreparer;
     this.m_timerLogic = new TimerLogic();
 }