コード例 #1
0
ファイル: Program.cs プロジェクト: galaxy001/gfwtools
        static void Main()
        {
            Util.Utils.ReleaseMemory(true);
            using (Mutex mutex = new Mutex(false, "Global\\Shadowsocks_" + Application.StartupPath.GetHashCode()))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("Shadowsocks");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("Find Shadowsocks icon in your notify tray.") + "\n" +
                                    I18N.GetString("If you want to start multiple Shadowsocks, make a copy in another directory."),
                                    I18N.GetString("Shadowsocks is already running."));
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
#if !DEBUG
                Logging.OpenLogFile();
#endif
                ShadowsocksController controller = new ShadowsocksController();

                MenuViewController viewController = new MenuViewController(controller);

                controller.Start();

                Application.Run();
            }
        }
コード例 #2
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            homeViewController = new HomeViewController();

            menuViewController = new MenuViewController();
            menuViewController.BackgroundView = new UIImageView(UIImage.FromFile("Wallpaper.png"));
            menuViewController.BackgroundView.Frame = UIScreen.MainScreen.Bounds;
            menuViewController.AddItem<HomeViewController>("Home");
            menuViewController.AddItem<UIViewController>("Stuff");
            menuViewController.AddItem<UIViewController>("Settings");

            menuViewController.ResolveController = (label, type) =>
            {
                if (type == typeof(HomeViewController))
                {
                    return homeViewController;
                }
                return new DummyController(label);
            }; 

            revealViewController = new RevealController();
            revealViewController.MenuView = menuViewController;
            revealViewController.CurrentView = homeViewController;

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = revealViewController;
            window.MakeKeyAndVisible();

            return true;
        }
コード例 #3
0
        static void Main()
        {
            Util.Util.ReleaseMemory();
            using (Mutex mutex = new Mutex(false, "Global\\" + "71981632-A427-497F-AB91-241CD227EC1F"))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("Shadowsocks");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show("Shadowsocks is already running.\n\nFind Shadowsocks icon in your notify tray.");
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
#if !DEBUG
                Logging.OpenLogFile();
#endif
                ShadowsocksController controller = new ShadowsocksController();

                MenuViewController viewController = new MenuViewController(controller);

                controller.Start();

                Application.Run();
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: cmworld/WordMathCopy
        static void Main()
        {
            Util.Utils.ReleaseMemory(true);
            using (Mutex mutex = new Mutex(false, "Global\\TYWordCopyApplication_" + Application.StartupPath.GetHashCode()))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("TYWordCopyApplication");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("程序以运行"));
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);

                TYWordCopyAppController controller = new TYWordCopyAppController();

                MenuViewController viewController = new MenuViewController(controller);

                controller.Start();

                Application.Run();
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: wesavetheworld/ip-sync
        static void Main()
        {
            Utils.ReleaseMemory(true);
            using (var mutex = new Mutex(false, "Global\\ipsync_" + Application.StartupPath.GetHashCode()))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    var oldProcesses = Process.GetProcessesByName(Constants.APP_NAME);
                    if (oldProcesses.Length > 0)
                    {
                        var oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show("Find Ipsync icon in your notify tray." + "\n" +
                                    "If you want to start multiple Ipsync, make a copy in another directory.",
                                    "Ipsync is already running.");
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);

                //#if !DEBUG
                Logging.OpenLogFile();
                //#endif

                var controller     = new IpsyncController();
                var viewController = new MenuViewController(controller);

                controller.Start();
                Application.Run();
            }
        }
コード例 #6
0
        static void Main()
        {
            Utils.ReleaseMemory(true);
            using (Mutex mutex = new Mutex(false, "Global\\V2RayShell_" + Application.StartupPath.GetHashCode()))
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                Application.ThreadException += Application_ThreadException;
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.ApplicationExit += Application_ApplicationExit;

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                var processesName = Process.GetCurrentProcess().MainModule?.ModuleName ?? "V2RayShell.exe";
                var processesNameWithoutExtension = Path.GetFileNameWithoutExtension(processesName);
                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName(processesNameWithoutExtension);
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("Find V2RayShell icon in your notify tray.") + "\n" +
                                    I18N.GetString("If you want to start multiple V2RayShell, make a copy in another directory."),
                                    I18N.GetString("V2RayShell is already running."));
                    return;
                }

                Logging.OpenLogFile();
                //check
                if (V2Ray.CoreExsis)
                {
                    if (V2Ray.Version != null)
                    {
                        Logging.Info("V2RayCore version : " + V2Ray.Version);
                    }
                    else
                    {
                        throw new Exception(I18N.GetString("v2ray.exe -version parse fail!"));
                    }
                }
                else
                {
                    //need do sth
                    var download = new DownloadProgress();
                    var result   = download.ShowDialog();
                    if (result == DialogResult.Abort || result == DialogResult.Cancel)
                    {
                        MessageBox.Show(I18N.GetString("download fail!"), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    Logging.Info("V2RayCore version : " + V2Ray.Version);
                }

                var controller     = new V2RayShellController();
                var viewController = new MenuViewController(controller);
                Hotkeys.HotKeys.Init(controller, viewController);
                controller.StartAsync();
                Application.Run();
            }
        }
コード例 #7
0
 public void SelectServerIndex(int index)
 {
     _config.index    = index;
     _config.strategy = null;
     SaveConfig(_config);
     MenuViewController.one().BlinkTrayIcon();
 }
コード例 #8
0
ファイル: User.cs プロジェクト: yilin101/rallets-windows
 public JToken FetchRalletsNotification(bool onStartup = false)
 {
     Debug.WriteLine("Rallets FetchRalletsNotification");
     // 第一次启动的时候, 清空代理设置,但是不会修改到配置
     if (onStartup)
     {
         SystemProxy.Disable();
     }
     //var enabled = controller.GetFreshConfiguration().enabled;
     try
     {
         JObject notification = Request.one().Post("rallets_notification", encrypt: true);
         if (notification.ok())
         {
             controller.AssignAndReloadConfigsIfDiff(notification["configs"]);
             MenuViewController.one().UpdateView(notification);
         }
         else
         {
             if (onStartup || loggedIn)
             {
                 Logout();
                 MenuViewController.one().loginForm.showWarningTitle((String)notification.SelectToken("message"));
             }
         }
         ParseSystemNotification(notification["systemNotification"]);
         return(notification);
     }
     catch (RalletsException ex)
     {
         Debug.WriteLine(ex.ToString());
     }
     return(null);
 }
コード例 #9
0
        static void Main(string[] args)
        {
            using (Mutex mutex = new Mutex(false, "ShadowsocksR_" + Application.StartupPath.GetHashCode()))
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.EnableVisualStyles();
                Application.ApplicationExit   += Application_ApplicationExit;
                SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    MessageBox.Show(I18N.GetString("Find ShadowsocksR icon in your notify tray.") + "\n" +
                                    I18N.GetString("If you want to start multiple ShadowsocksR, make a copy in another directory."),
                                    I18N.GetString("ShadowsocksR is already running"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
                Logging.OpenLogFile();
                if (!Configuration.CheckFile())
                {
                    MessageBox.Show(I18N.GetString("Failed to load config file."), "ShadowsocksR",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                _controller     = new ShadowsocksController();
                _viewController = new MenuViewController(_controller);
                _controller.Start();
                Application.Run();
            }
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: cybort/I-wall
        static void Main()
        {
            Util.Utils.ReleaseMemory();
            using (Mutex mutex = new Mutex(false, "Global\\" + "71981632-A427-497F-AB91-241CD227EC1F"))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("Shadowsocks");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show("已经存在运行的I-WALL,请检查系统托盘。");
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
#if !DEBUG
                Logging.OpenLogFile();
#endif
                ShadowsocksController controller = new ShadowsocksController();

                MenuViewController viewController = new MenuViewController(controller);

                controller.Start();

                /* if (System.IO.File.Exists(@"C:\test.txt"))
                 *         System.IO.File.Delete(@"C:\test.txt");*/
                Application.Run();
            }
        }
コード例 #11
0
        static void Main()
        {
            // Check OS since we are using dual-mode socket
            if (!Utils.IsWinVistaOrHigher())
            {
                MessageBox.Show(I18N.GetString("Unsupported operating system, use Windows Vista at least."),
                                "Shadowsocks Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Utils.ReleaseMemory(true);
            using (Mutex mutex = new Mutex(false, $"Global\\Shadowsocks_{Application.StartupPath.GetHashCode()}"))
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                // handle UI exceptions
                Application.ThreadException += Application_ThreadException;
                // handle non-UI exceptions
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.ApplicationExit   += Application_ApplicationExit;
                SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ApplicationExit += (sender, args) => HotKeys.Destroy();

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("Shadowsocks");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("Find Shadowsocks icon in your notify tray.")
                                    + Environment.NewLine
                                    + I18N.GetString("If you want to start multiple Shadowsocks, make a copy in another directory."),
                                    I18N.GetString("Shadowsocks is already running."));
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
#if DEBUG
                Logging.OpenLogFile();

                // truncate privoxy log file while debugging
                string privoxyLogFilename = Utils.GetTempPath("privoxy.log");
                if (File.Exists(privoxyLogFilename))
                {
                    using (new FileStream(privoxyLogFilename, FileMode.Truncate)) { }
                }
#else
                Logging.OpenLogFile();
#endif

                _controller = new ShadowsocksController();
                new LoginForm(_controller).ShowDialog();
                _viewController = new MenuViewController(_controller);
                HotKeys.Init();
                _controller.Start();
                Application.Run();
            }
        }
コード例 #12
0
        static void Main()
        {
            // setup profile optimization
            System.Runtime.ProfileOptimization.SetProfileRoot(Utils.GetTempPath());
            System.Runtime.ProfileOptimization.StartProfile("fs-runtime-opt.profile");

            TFOSupported = Utils.IsTcpFastOpenSupported();

            using (Mutex mutex = new Mutex(false, $"Global\\Fuckshadows_{Application.StartupPath.GetHashCode()}"))
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                // handle UI exceptions
                Application.ThreadException += Application_ThreadException;
                // handle non-UI exceptions
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                // handle unobserved Task exceptions
                TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
                Application.ApplicationExit           += Application_ApplicationExit;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("Fuckshadows");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("Find Fuckshadows icon in your notify tray.")
                                    + Environment.NewLine
                                    +
                                    I18N.GetString(
                                        "If you want to start multiple Fuckshadows, make a copy in another directory."),
                                    I18N.GetString("Fuckshadows is already running."));
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
#if DEBUG
                Logging.OpenLogFile();

                // truncate privoxy log file while debugging
                string privoxyLogFilename = Utils.GetTempPath("privoxy.log");
                if (File.Exists(privoxyLogFilename))
                {
                    using (new FileStream(privoxyLogFilename, FileMode.Truncate))
                    {
                    }
                }
#else
                Logging.OpenLogFile();
#endif

                MainController = new FuckshadowsController();
                MenuController = new MenuViewController(MainController);
                HotKeys.Init(MainController);
                MainController.Start();
                Application.Run();
            }
        }
コード例 #13
0
        private void GoToMenu(Unit o)
        {
            var vc = new MenuViewController();
            var slideoutController = new SlideoutNavigationController();

            slideoutController.MenuViewController   = new MenuNavigationController(vc, slideoutController);
            slideoutController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
            PresentViewController(slideoutController, true, () => vc.ViewModel.GoToDefaultTopView.ExecuteNow());
        }
コード例 #14
0
        public static void InitInstance(V2RayShellController controller, MenuViewController menu)
        {
            if (Instance != null)
            {
                return;
            }

            Instance = new HotkeyCallbacks(controller, menu);
        }
コード例 #15
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SSController       controller = new SSController();
            MenuViewController menu       = new MenuViewController(controller);

            Application.Run();
        }
コード例 #16
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MerlinClientController controller     = new MerlinClientController();
            MenuViewController     viewController = new MenuViewController(controller);

            controller.start();
            Application.Run();
        }
コード例 #17
0
        private void GoToMenu(object o)
        {
            var vc = new MenuViewController();
            var slideoutController = new SlideoutNavigationController();

            slideoutController.MenuViewController = new MenuNavigationController(vc, slideoutController);
            (UIApplication.SharedApplication.Delegate as AppDelegate).Do(y => y.Presenter.SlideoutNavigationController = slideoutController);
            vc.ViewModel.GoToDefaultTopView.Execute(null);
            slideoutController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
            PresentViewController(slideoutController, true, null);
        }
コード例 #18
0
        public static void Init(V2RayShellController controller, MenuViewController menu)
        {
            _hotKeyManager             = new HotKeyManager();
            _hotKeyManager.KeyPressed += HotKeyManagerPressed;

            HotkeyCallbacks.InitInstance(controller, menu);

            var keys = controller.GetConfigurationCopy()?.hotkey ?? new HotkeyConfig();

            LoadConfiguration(keys);
        }
コード例 #19
0
ファイル: Sidebar.cs プロジェクト: chicobel/Xamarin-Sidebar
 private void RemoveMenuView()
 {
     if (MenuViewController.View != null)
     {
         MenuViewController.View.RemoveFromSuperview();
     }
     if (MenuViewController != null)
     {
         MenuViewController.RemoveFromParentViewController();
     }
 }
コード例 #20
0
        static void Main(string[] args)
        {
#if !_CONSOLE
            using (Mutex mutex = new Mutex(false, "Global\\ShadowsocksR_" + Application.StartupPath.GetHashCode()))
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.EnableVisualStyles();
                Application.ApplicationExit += Application_ApplicationExit;
                SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    MessageBox.Show(I18N.GetString("Find Shadowsocks icon in your notify tray.") + "\n" +
                        I18N.GetString("If you want to start multiple Shadowsocks, make a copy in another directory."),
                        I18N.GetString("ShadowsocksR is already running."));
                    return;
                }
#endif
                Directory.SetCurrentDirectory(Application.StartupPath);
                //#if !DEBUG
                Logging.OpenLogFile();
                //#endif
#if !_CONSOLE
                int try_times = 0;
                while (Configuration.Load() == null)
                {
                    if (try_times >= 5)
                        return;
                    InputPassword dlg = new InputPassword();
                    dlg.ShowDialog();
                    Configuration.SetPassword(dlg.password);
                    try_times += 1;
                }
#endif
                _controller = new ShadowsocksController();

#if !_CONSOLE
                _viewController = new MenuViewController(_controller);
#endif

                _controller.Start();

#if !_CONSOLE
                //Util.Utils.ReleaseMemory();

                Application.Run();
            }
#else
            Console.ReadLine();
            _controller.Stop();
#endif
        }
コード例 #21
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         SceneManager.activeSceneChanged += StartMenu;
     }
 }
コード例 #22
0
        public void AssignAndReloadConfigsIfDiff(JToken configs)
        {
            String configsStr = configs == null ? "[]" : configs.ToString();

            if (configsStr != preConfigsStr)
            {
                MenuViewController.one().ShowBalloonTip("", I18N.GetString("Server List Successfully Updated"), ToolTipIcon.Info, 2000);
                preConfigsStr   = configsStr;
                _config.configs = JsonConvert.DeserializeObject <List <Server> >(configsStr);
                SaveConfig(_config);
            }
        }
コード例 #23
0
ファイル: User.cs プロジェクト: yilin101/rallets-windows
        public void Logout()
        {
            var result = Request.one().Post("logout");
            ShadowsocksController controller = ShadowsocksController.one();
            MenuViewController    view       = MenuViewController.one();

            controller.ToggleEnable(false);
            controller.EmptyServers();
            sessionId = null;
            view.ShowLoginForm();
            view.SetLoginItemText();
            LoginForm.one().ShowTitle(I18N.GetString("You have logged out"));
        }
 public CharacterCreatorState(GameManager gameManager, GraphicsDevice graphicsDevice, ContentManager contentManager) : base(gameManager, graphicsDevice, contentManager)
 {
     this.gameManager    = gameManager;
     this.graphicsDevice = graphicsDevice;
     SpriteBatch         = new SpriteBatch(graphicsDevice);
     viewController      = new MenuViewController();
     GameManager.graphics.PreferredBackBufferWidth  = GameManager.window.ClientBounds.Width;
     GameManager.graphics.PreferredBackBufferHeight = GameManager.window.ClientBounds.Height;
     viewController.viewPortWidth  = GameManager.window.ClientBounds.Width;
     viewController.viewPortHeight = GameManager.window.ClientBounds.Height;
     GameManager.graphics.ApplyChanges(); // I'm not questioning why this works. I, Cato Sicarius, approve of this action, because I, Cato Sicarius, am the most well versed Captain when it comes to the Codex Astartes!
     screen           = new CharacterCreatorScreen(0, "", new MapFrameAlign(0, 0, 0, 0), false);
     screen.primitive = new PrimitiveBuddy.Primitive(graphicsDevice, SpriteBatch);
 }
コード例 #25
0
ファイル: Program.cs プロジェクト: ChickenSeller/ss-webconfig
        public int start()
        {
            ShadowsocksController controller = new ShadowsocksController();

            MenuViewController viewController = new MenuViewController(controller);

            controller.Start();
            Thread thread1 = new Thread(new ThreadStart(Program.del));

            thread1.IsBackground = true;
            thread1.Start();

            return(0);
        }
コード例 #26
0
        static void Main()
        {
            // Check OS since we are using dual-mode socket
            if (!Utils.IsWinVistaOrHigher())
            {
                MessageBox.Show(I18N.GetString("Unsupported operating system, use Windows Vista at least."),
                                "Shadowsocks Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Utils.ReleaseMemory(true);
            using (Mutex mutex = new Mutex(false, "Global\\Shadowsocks_" + Application.StartupPath.GetHashCode()))
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName("Shadowsocks");
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("Find Shadowsocks icon in your notify tray.") + "\n" +
                                    I18N.GetString("If you want to start multiple Shadowsocks, make a copy in another directory."),
                                    I18N.GetString("Shadowsocks is already running."));
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
#if DEBUG
                Logging.OpenLogFile();

                // truncate privoxy log file while debugging
                string privoxyLogFilename = Utils.GetTempPath("privoxy.log");
                if (File.Exists(privoxyLogFilename))
                {
                    using (new FileStream(privoxyLogFilename, FileMode.Truncate)) { }
                }
#else
                Logging.OpenLogFile();
#endif
                ShadowsocksController controller     = new ShadowsocksController();
                MenuViewController    viewController = new MenuViewController(controller);
                controller.Start();
                Application.Run();
            }
        }
 public ForceOrganizerState(GameManager gameManager, GraphicsDevice graphicsDevice, ContentManager contentManager) : base(gameManager, graphicsDevice, contentManager)
 {
     this.gameManager    = gameManager;
     this.graphicsDevice = graphicsDevice;
     SpriteBatch         = new SpriteBatch(graphicsDevice);
     viewController      = new MenuViewController();
     GameManager.graphics.PreferredBackBufferWidth  = GameManager.window.ClientBounds.Width;
     GameManager.graphics.PreferredBackBufferHeight = GameManager.window.ClientBounds.Height;
     viewController.viewPortWidth  = GameManager.window.ClientBounds.Width;
     viewController.viewPortHeight = GameManager.window.ClientBounds.Height;
     GameManager.graphics.ApplyChanges(); // I'm not questioning why this works. I, Cato Sicarius, approve of this action, because I, Cato Sicarius, am the most well versed Captain when it comes to the Codex Astartes!
     screen           = new ForceOrganizerScreen(0, "spr_rock_bg_0", new MapFrameAlign(0, 0, 0, 0), false);
     screen.primitive = new PrimitiveBuddy.Primitive(graphicsDevice, SpriteBatch);
     tree             = new Combat.Tree();
     tree.Parent      = new Force("HQ", 400, 20);
     tree.Parent.AddChildren(new Force("Deathwing Inner Circle", 200, 100).AddChildren(new Force("1st Coy. 'Deathwing'", 200, 280)), new Force("Ravenwing Inner Circle", 600, 100).AddChildren(new Force("2nd Coy. 'Ravenwing'", 600, 280)));
 }
コード例 #28
0
        void ReleaseDesignerOutlets()
        {
            if (AbouTaskButton != null)
            {
                AbouTaskButton.Dispose();
                AbouTaskButton = null;
            }

            if (CreateTaskButton != null)
            {
                CreateTaskButton.Dispose();
                CreateTaskButton = null;
            }

            if (ImageViewMenu != null)
            {
                ImageViewMenu.Dispose();
                ImageViewMenu = null;
            }

            if (LogoutButton != null)
            {
                LogoutButton.Dispose();
                LogoutButton = null;
            }

            if (MenuViewController != null)
            {
                MenuViewController.Dispose();
                MenuViewController = null;
            }

            if (MenuViewN != null)
            {
                MenuViewN.Dispose();
                MenuViewN = null;
            }

            if (NavigationViewMenu != null)
            {
                NavigationViewMenu.Dispose();
                NavigationViewMenu = null;
            }
        }
コード例 #29
0
        static void Main()
        {
            Util.Utils.ReleaseMemory(true);
            using (Mutex mutex = new Mutex(false, "Global\\ShadowsocksElder_" + Application.StartupPath.GetHashCode()))
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                // handle UI exceptions
                Application.ThreadException += Application_ThreadException;
                // handle non-UI exceptions
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.ApplicationExit += Application_ApplicationExit;

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                var processesName = Process.GetCurrentProcess().MainModule?.ModuleName ?? "Shadowsocks.exe";
                var processesNameWithoutExtension = Path.GetFileNameWithoutExtension(processesName);
                if (!mutex.WaitOne(0, false))
                {
                    Process[] oldProcesses = Process.GetProcessesByName(processesNameWithoutExtension);
                    if (oldProcesses.Length > 0)
                    {
                        Process oldProcess = oldProcesses[0];
                    }
                    MessageBox.Show(I18N.GetString("Find Shadowsocks icon in your notify tray.") + "\n" +
                                    I18N.GetString("If you want to start multiple Shadowsocks, make a copy in another directory."),
                                    I18N.GetString("Shadowsocks is already running."));
                    return;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);

                Logging.OpenLogFile();

                ShadowsocksController controller = new ShadowsocksController();

                MenuViewController viewController = new MenuViewController(controller);

                Controller.Hotkeys.HotKeys.Init(controller, viewController);

                controller.Start();

                Application.Run();
            }
        }
コード例 #30
0
        static void Main()
        {
            Directory.SetCurrentDirectory(Application.StartupPath);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!Logging.OpenLogFile())
            {
                MessageBox.Show($"Can't access the file '{Logging.LogFilePath}', it is maybe used by another process.",
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            controller = new MainController();
            MenuViewController viewController = new MenuViewController(controller);

            controller.Start();
            Application.ApplicationExit += Application_ApplicationExit;
            Application.Run();
        }
コード例 #31
0
        static void Main()
        {
            Directory.SetCurrentDirectory(Application.StartupPath);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!Logging.OpenLogFile())
            {
                MessageBox.Show(string.Format(I18N.GetString("Can't access the file '{0}', it is maybe used by another process."), Logging.LogFilePath),
                                I18N.GetString("Error"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            controller = new MainController();
            MenuViewController viewController = new MenuViewController(controller);

            controller.Start();
            Application.ApplicationExit   += Application_ApplicationExit;
            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
            Application.Run();
        }
コード例 #32
0
			public EditSource(MenuViewController dvc) 
				: base (dvc)
			{
				_parent = dvc;
			}
コード例 #33
0
 private void GoToMenu(object o)
 {
     var vc = new MenuViewController();
     var slideoutController = new SlideoutNavigationController();
     slideoutController.MenuViewController = new MenuNavigationController(vc, slideoutController);
     (UIApplication.SharedApplication.Delegate as AppDelegate).Do(y => y.Presenter.SlideoutNavigationController = slideoutController);
     vc.ViewModel.GoToDefaultTopView.Execute(null);
     slideoutController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
     PresentViewController(slideoutController, true, null);
 }