Exemple #1
0
        static void Main()
        {
            if (AppIsRunning())
            {
                return;
            }
            Logger LOG = Logger.Instance;

            LOG.LogDebug("Starting OpenDesktop");

            FirstTimeUser firstTimeUser = new FirstTimeUser();
            bool          alreadydone   = firstTimeUser.IsFirstTimeUser();

            //firstTimeUser = null;

            LOG.LogDebug("Bringing up Webserver");
            WebServer.Instance.Start();
            LOG.LogDebug("Displaying NotifyIcon");
            TrayIcon trayIcon = new TrayIcon();

            MessageBox.Show(WebServer.Instance.LocalAddress);

            FileExplorer         fileExplorer             = null;
            IndexProgressHandler dlgtIndexProgressHandler = null;

            if (!alreadydone)
            {
                fileExplorer                = new FileExplorer(PluginManager.Instance.RegisteredFileExtensions);
                dlgtIndexProgressHandler    = new IndexProgressHandler(fileExplorer_IndexProgress);
                fileExplorer.IndexProgress += dlgtIndexProgressHandler;
                fileExplorer.Run(false);     // Dont be aggressive
            }

            Application.Run();

            if (!alreadydone)
            {
                fileExplorer.IndexProgress -= dlgtIndexProgressHandler;
                fileExplorer.Stop();
            }
            WebServer.Instance.Stop();
            LOG.LogDebug("Exiting OpenDesktop");
            Logger.Instance.Dispose();
        }
        static void Main()
        {
            if (AppIsRunning())
            {
                return;
            }
            Logger LOG = Logger.Instance;
            LOG.LogDebug("Starting OpenDesktop");

            FirstTimeUser firstTimeUser = new FirstTimeUser();
            bool alreadydone = firstTimeUser.IsFirstTimeUser();
            //firstTimeUser = null;

            LOG.LogDebug("Bringing up Webserver");
            WebServer.Instance.Start();
            LOG.LogDebug("Displaying NotifyIcon");
            TrayIcon trayIcon = new TrayIcon();
            MessageBox.Show(WebServer.Instance.LocalAddress);

            FileExplorer fileExplorer = null;
            IndexProgressHandler dlgtIndexProgressHandler = null;
            if(!alreadydone)
            {
                fileExplorer = new FileExplorer(PluginManager.Instance.RegisteredFileExtensions);
                dlgtIndexProgressHandler = new IndexProgressHandler(fileExplorer_IndexProgress);
                fileExplorer.IndexProgress += dlgtIndexProgressHandler;
                fileExplorer.Run(false); // Dont be aggressive
            }

            Application.Run();

            if(!alreadydone)
            {
                fileExplorer.IndexProgress -= dlgtIndexProgressHandler;
                fileExplorer.Stop();
            }
            WebServer.Instance.Stop();
            LOG.LogDebug("Exiting OpenDesktop");
            Logger.Instance.Dispose();
        }