예제 #1
0
        public MainForm()
        {
            InitializeComponent();
            _clipboardViewerNext = SetClipboardViewer(this.Handle);      // Adds our form to the chain

            //Set the data directory of our .db file
            AppDomain.CurrentDomain.SetData("DataDirectory", IOVariables.databaseFile);

            Directory.CreateDirectory(IOVariables.clipboardWatcherLocalFolder);
            BLIO.CreateDatabaseIfNotExist();

            //Create folders if they dont exist
            Directory.CreateDirectory(BLSettings.Settings.SaveImagePath);
            Directory.CreateDirectory(BLSettings.Settings.SaveTextPath);

            //------Content usercontrols------\\
            ucText     = new UCText();
            ucImages   = new UCImages();
            ucHistory  = new UCHistory();
            ucSettings = new UCSettings();


            //Delete empty folders in /images and /text
            BLIO.DeleteEmptyDirectories(BLSettings.Settings.SaveImagePath);
            BLIO.DeleteEmptyDirectories(BLSettings.Settings.SaveTextPath);

            TrayContextMenuStrip.Renderer = new ToolStripMenuRenderer();
            this.Opacity = 0;
        }
예제 #2
0
        public Form1()
        {
            BLIO.Log("Construct Form");
            InitializeComponent();
            instance = this;

            AppDomain.CurrentDomain.SetData("DataDirectory", IOVariables.databaseFile);
            BLIO.CreateSettings();
            BLIO.CreateDatabaseIfNotExist();


            //User controls that will be loaded into the "main" panel
            ucReminders    = new UCReminders();
            ucImportExport = new UCImportExport();
            ucSound        = new UCSound();
            ucOverlay      = new UCSettings();
            ucResizePopup  = new UCResizePopup();
            ucSupport      = new UCSupport();
            ucDebug        = new UCDebugMode();
            ucTimer        = new UCTimer();

            //Turn them invisible
            ucImportExport.Visible = false;
            ucSound.Visible        = false;
            ucOverlay.Visible      = false;
            ucResizePopup.Visible  = false;
            ucSupport.Visible      = false;
            ucDebug.Visible        = false;
            ucTimer.Visible        = false;

            //Add all of them(invisible) to the panel
            pnlMain.Controls.Add(ucImportExport);
            pnlMain.Controls.Add(ucSound);
            pnlMain.Controls.Add(ucOverlay);
            pnlMain.Controls.Add(ucResizePopup);
            pnlMain.Controls.Add(ucSupport);
            pnlMain.Controls.Add(ucDebug);
            pnlMain.Controls.Add(ucTimer);

            pnlMain.Controls.Add(ucReminders);
            ucReminders.Visible = true;
            ucReminders.Initialize();

            m_GlobalHook        = Hook.GlobalEvents();
            m_GlobalHook.KeyUp += GlobalKeyPress;

            //Set the Renderer of the menustrip to our custom renderer, which sets the highlight and border collor to DimGray, which is the same
            //As the menu's themselves, which means you will not see any highlighting color or border. This renderer also makes the text of the selected
            //toolstrip items white.
            RemindMeTrayIconMenuStrip.Renderer = new MyToolStripMenuRenderer();


            UpdateInformation.Initialize();

            formLoadAsync();
            Thread.Sleep(2000);
            RemindMeIcon.Visible = true;
            BLIO.Log("Form constructed");
        }
예제 #3
0
 public Form1()
 {
     InitializeComponent();
     tmrFadeIn.Start();
     AppDomain.CurrentDomain.SetData("DataDirectory", DB_FILE);
     Directory.CreateDirectory(BLIO.rootFolder);
     Directory.CreateDirectory(BLIO.rootFolder + "\\Video");
     BLIO.CreateDatabaseIfNotExist();
     this.Opacity = 0;
     ucDownloads  = new UCDownloads();
     pnlContents.Controls.Add(ucDownloads);
 }
예제 #4
0
        public MaterialForm1()
        {
            BLIO.Log("===  Initializing RemindMe Version " + IOVariables.RemindMeVersion + "  ===");
            BLIO.CreateSettings();
            AppDomain.CurrentDomain.SetData("DataDirectory", IOVariables.databaseFile);

            int  tries = 0;
            bool done  = false;

            while (!done || !BLLocalDatabase.HasAllTables())
            {
                try
                {
                    tries++;
                    if (tries >= 4 || BLLocalDatabase.HasAllTables())
                    {
                        done = true;
                        if (tries >= 4)
                        {
                            BLIO.Log("something went terribly wrong... 4 tries and it still doesnt work..");
                        }
                    }

                    BLIO.Log("DB does not have all tables. Entered while loop to create.");
                    BLIO.CreateDatabaseIfNotExist();
                    Thread.Sleep(500);
                }
                catch (Exception ex)
                {
                }
            }

            LogWindowsInfo(); //Windows version info etc
            LogCultureInfo(); //Datetime info in their country
            Cleanup();



            this.Opacity = 0;
            InitializeComponent();

            // Initialize MaterialSkinManager
            materialSkinManager = MaterialSkinManager.Instance;
            materialSkinManager.ThemeChanged += UpdateTheme;
            materialSkinManager.AddFormToManage(this);

            instance = this;

            m_GlobalHook          = Hook.GlobalEvents();
            m_GlobalHook.KeyDown += GlobalKeyPressDown;
            m_GlobalHook.KeyUp   += GlobalKeyPressUp;

            //Set the Renderer of the menustrip to our custom renderer, which sets the highlight and border collor to DimGray, which is the same
            //As the menu's themselves, which means you will not see any highlighting color or border. This renderer also makes the text of the selected
            //toolstrip items white.
            RemindMeTrayIconMenuStrip.Renderer = new MyToolStripMenuRenderer();


            UpdateInformation.Initialize();

            //dont show debug



            formLoad();

            SystemEvents.PowerModeChanged += OnPowerChange;

            RemindMeIcon.Visible = true;

            //Update LastOnline every 5 minutes
            tmrPingActivity.Start();

            tmrDumpLogTxtContents.Start();

            tmrEnableDatabaseAccess.Start();


            //workaround
            tmrRemoveDebug.Start();
            tmrResetExceptionInserts.Start();

            this.MaximumSize = this.Size;
            this.MinimumSize = this.Size;

            BLIO.Log("===  Initializing RemindMe Complete  ===");
        }
예제 #5
0
        public Form1()
        {
            BLIO.Log("===  Initializing RemindMe Version " + IOVariables.RemindMeVersion + "  ===");
            LogWindowsInfo(); //Windows version info etc
            LogCultureInfo(); //Datetime info in their country
            Cleanup();
            AppDomain.CurrentDomain.SetData("DataDirectory", IOVariables.databaseFile);
            BLIO.CreateSettings();
            BLIO.CreateDatabaseIfNotExist();
            InitializeComponent();
            //--

            instance = this;

            //User controls that will be loaded into the "main" panel
            ucReminders    = new UCReminders();
            ucImportExport = new UCImportExport();
            ucSound        = new UCSound();
            ucSettings     = new UCSettings();
            ucResizePopup  = new UCResizePopup();
            ucSupport      = new UCSupport();
            ucDebug        = new UCDebugMode();
            ucTimer        = new UCTimer();
            ucTheme        = new UCTheme();

            //Turn them invisible
            ucImportExport.Visible = false;
            ucSound.Visible        = false;
            ucSettings.Visible     = false;
            ucResizePopup.Visible  = false;
            ucSupport.Visible      = false;
            ucDebug.Visible        = false;
            ucTimer.Visible        = false;
            ucTheme.Visible        = false;

            //Add all of them(invisible) to the panel
            pnlMain.Controls.Add(ucImportExport);
            pnlMain.Controls.Add(ucSound);
            pnlMain.Controls.Add(ucSettings);
            pnlMain.Controls.Add(ucResizePopup);
            pnlMain.Controls.Add(ucSupport);
            pnlMain.Controls.Add(ucDebug);
            pnlMain.Controls.Add(ucTimer);
            pnlMain.Controls.Add(ucTheme);

            pnlMain.Controls.Add(ucReminders);
            ucReminders.Visible = true;
            ucReminders.Initialize();

            m_GlobalHook          = Hook.GlobalEvents();
            m_GlobalHook.KeyDown += GlobalKeyPressDown;
            m_GlobalHook.KeyUp   += GlobalKeyPressUp;

            //Set the Renderer of the menustrip to our custom renderer, which sets the highlight and border collor to DimGray, which is the same
            //As the menu's themselves, which means you will not see any highlighting color or border. This renderer also makes the text of the selected
            //toolstrip items white.
            RemindMeTrayIconMenuStrip.Renderer = new MyToolStripMenuRenderer();


            UpdateInformation.Initialize();

            FormLoad();

            SystemEvents.PowerModeChanged += OnPowerChange;

            RemindMeIcon.Visible = true;

            //Update LastOnline every 5 minutes
            tmrPingActivity.Start();

            tmrDumpLogTxtContents.Start();

            tmrEnableDatabaseAccess.Start();

            SetButtonSpacing();

            BLIO.Log("===  Initializing RemindMe Complete  ===");
        }
예제 #6
0
        static void Main(string[] args)
        {
            string resource1 = "RemindMe.External_DLL.Bunifu_UI_v1.5.3.dll";

            EmbeddedAssembly.Load(resource1, "Bunifu_UI_v1.5.3.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            try
            {
                AppDomain.CurrentDomain.SetData("DataDirectory", IOVariables.databaseFile);
                BLIO.CreateDatabaseIfNotExist();

                if (!BLLocalDatabase.HasAllTables())
                {
                    isMaterial = true;
                }
                else
                {
                    //See if the user wants Material Design or old RemindMe-Design (Default = Material)
                    Settings set = BLLocalDatabase.Setting.Settings;
                    if (set != null && set.MaterialDesign != null && set.MaterialDesign.HasValue) //not null
                    {
                        isMaterial = Convert.ToBoolean(BLLocalDatabase.Setting.Settings.MaterialDesign.Value);
                    }
                }



                if (args.Length > 0)
                {//The user double-clicked an .remindme file!
                    BLIO.Log("Detected the double clicking of a .remindme file!");
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);

                    if (isMaterial)
                    {
                        Application.Run(new MaterialRemindMeImporter(args[0]));
                    }
                    else
                    {
                        Application.Run(new RemindMeImporter(args[0]));
                    }
                }
            }
            catch (Exception ex)
            {
                BLIO.Log("!!!! EXCEPTION IN PROGRAM.CS !!!! (" + ex.GetType() + ")");
                BLOnlineDatabase.AddException(ex, DateTime.Now, IOVariables.systemLog);
            }
            //This code should always execute!!!! Remember the 3.0.6 disaster? yeahhhhh...
            using (Mutex mutex = new Mutex(false, "Global\\" + "RemindMe"))
            {
                if (!mutex.WaitOne(0, false)) //one instance of remindme already running
                {
                    return;
                }

                // Set the unhandled exception mode to force all Windows Forms errors to go through our handler.
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(true);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

                // Add the event handler for handling non-UI thread exceptions to the event.
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                if (isMaterial)
                {
                    Application.Run(new MaterialForm1());
                }
                else
                {
                    Application.Run(new Form1());
                }
            }
        }