• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controller.ShadowsocksController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Shadowsocks.Controller.ShadowsocksController的典型用法代码示例。如果您正苦于以下问题:C# ShadowsocksController类的具体用法?C# ShadowsocksController怎么用?C# ShadowsocksController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ShadowsocksController类属于Shadowsocks.Controller命名空间,在下文中一共展示了ShadowsocksController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ServerLogForm

        public ServerLogForm(ShadowsocksController controller)
        {
            this.controller = controller;
            this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());
            InitializeComponent();
            this.Width = 760;

            Configuration config = controller.GetCurrentConfiguration();
            if (config.configs.Count < 8)
            {
                this.Height = 300;
            }
            else if (config.configs.Count < 20)
            {
                this.Height = 300 + (config.configs.Count - 8) * 16;
            }
            else
            {
                this.Height = 500;
            }
            UpdateTexts();
            UpdateLog();

            this.contextMenu1 = new ContextMenu(new MenuItem[] {
                this.clearItem = CreateMenuItem("&Clear", new EventHandler(this.ClearItem_Click)),
            });
            ServerDataGrid.ContextMenu = contextMenu1;
            controller.ConfigChanged += controller_ConfigChanged;
        }
开发者ID:norkts,项目名称:shadowsocks-csharp,代码行数:29,代码来源:ServerLogForm.cs


示例2: PingForm

        public PingForm(ShadowsocksController sc)
        {
            InitializeComponent();

            var qqwryPath = Environment.CurrentDirectory + "\\qqwry.dat";
            if (Util.Utils.qqwry == null && File.Exists(qqwryPath)) Util.Utils.qqwry = new QQWry(qqwryPath);

            controller = sc;

            Font = Util.Utils.GetFont();

            PerformLayout();

            UpdateTexts();

            Icon = Icon.FromHandle(Resources.ssw128.GetHicon());

            LoadConfiguration(controller.GetConfiguration());

            if (dgvMain.Rows.Count <= 5)
            {
                foreach (var row in dgvMain.Rows)
                {
                    var t = new Thread(Ping) { IsBackground = true };
                    t.Start(row);
                }
            }
            else
            {
                ChangeStatus(I18N.GetString("DoSomething"));
                var t = new Thread(Go) { IsBackground = true };
                t.Start(dgvMain.Rows);
            }
        }
开发者ID:jackton,项目名称:shadowsocks-csharp-withping,代码行数:34,代码来源:PingForm.cs


示例3: TCPRelay

 public TCPRelay(ShadowsocksController controller, Configuration conf)
 {
     _controller = controller;
     _config = conf;
     Handlers = new HashSet<TCPHandler>();
     _lastSweepTime = DateTime.Now;
 }
开发者ID:DZLZHCODE,项目名称:shadowsocks-windows,代码行数:7,代码来源:TCPRelay.cs


示例4: StrategyManager

 public StrategyManager(ShadowsocksController controller)
 {
     _strategies = new List<IStrategy>();
     _strategies.Add(new BalancingStrategy(controller));
     _strategies.Add(new HighAvailabilityStrategy(controller));
     // TODO: load DLL plugins
 }
开发者ID:jiazhichao,项目名称:shadowsocks-windows,代码行数:7,代码来源:StrategyManager.cs


示例5: Main

        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("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();
            }
        }
开发者ID:xie3507,项目名称:shadowsocks-csharp,代码行数:31,代码来源:Program.cs


示例6: MenuViewController

        public MenuViewController(ShadowsocksController controller)
        {
            this.controller = controller;

            LoadMenu();

            controller.ConfigChanged += controller_ConfigChanged;
            controller.ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged;
            controller.Errored += controller_Errored;

            _notifyIcon = new NotifyIcon();
            UpdateTrayIcon();
            _notifyIcon.Visible = true;
            _notifyIcon.ContextMenu = contextMenu1;
            _notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick;

            //this.updateChecker = new UpdateChecker();
            //updateChecker.NewVersionFound += updateChecker_NewVersionFound;

            LoadCurrentConfiguration();

            //updateChecker.CheckUpdate(controller.GetConfigurationCopy());

            if (controller.GetConfigurationCopy().isDefault)
            {
                _isFirstRun = true;
                ShowConfigForm();
            }
        }
开发者ID:chiypg,项目名称:shadowsocks-windows,代码行数:29,代码来源:MenuViewController.cs


示例7: LogForm

        public LogForm(ShadowsocksController controller, string filename)
        {
            this.controller = controller;
            this.filename = filename;
            InitializeComponent();
            Icon = Icon.FromHandle(Resources.ssw128.GetHicon());

            LogViewerConfig config = controller.GetConfigurationCopy().logViewer;
            if (config == null)
            {
                config = new LogViewerConfig();
            }
            else
            {
                topMostTrigger = config.topMost;
                wrapTextTrigger = config.wrapText;
                toolbarTrigger = config.toolbarShown;
                LogMessageTextBox.BackColor = config.GetBackgroundColor();
                LogMessageTextBox.ForeColor = config.GetTextColor();
                LogMessageTextBox.Font = config.GetFont();
            }

            controller.TrafficChanged += controller_TrafficChanged;

            UpdateTexts();
        }
开发者ID:txrtanzi,项目名称:shadowsocks-windows,代码行数:26,代码来源:LogForm.cs


示例8: MenuViewController

        public MenuViewController(ShadowsocksController controller)
        {
            LoadMenu();
            LoadTrayIcon();

            this.controller = controller;
            controller.EnableStatusChanged += controller_EnableStatusChanged;
            controller.ConfigChanged += controller_ConfigChanged;
            controller.PACFileReadyToOpen += controller_PACFileReadyToOpen;
            controller.ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged;
            controller.EnableGlobalChanged += controller_EnableGlobalChanged;
            controller.Errored += controller_Errored;

            this.updateChecker = new UpdateChecker();
            updateChecker.NewVersionFound += updateChecker_NewVersionFound;

            LoadCurrentConfiguration();

            updateChecker.CheckUpdate();

            if (controller.GetConfiguration().isDefault)
            {
                _isFirstRun = true;
                ShowConfigForm();
            }
        }
开发者ID:wushukai,项目名称:shadowsocks-csharp,代码行数:26,代码来源:MenuViewController.cs


示例9: MenuViewController

        public MenuViewController(ShadowsocksController controller)
        {
            this.controller = controller;

            LoadMenu();

            controller.EnableStatusChanged += controller_EnableStatusChanged;
            controller.ConfigChanged += controller_ConfigChanged;
            controller.PACFileReadyToOpen += controller_FileReadyToOpen;
            controller.UserRuleFileReadyToOpen += controller_FileReadyToOpen;
            controller.ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged;
            controller.EnableGlobalChanged += controller_EnableGlobalChanged;
            controller.Errored += controller_Errored;
            controller.UpdatePACFromGFWListCompleted += controller_UpdatePACFromGFWListCompleted;
            controller.UpdatePACFromGFWListError += controller_UpdatePACFromGFWListError;

            _notifyIcon = new NotifyIcon();
            UpdateTrayIcon();
            _notifyIcon.Visible = true;
            _notifyIcon.ContextMenu = contextMenu1;
            _notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick;

            this.updateChecker = new UpdateChecker();
            updateChecker.NewVersionFound += updateChecker_NewVersionFound;

            LoadCurrentConfiguration();

            updateChecker.CheckUpdate(controller.GetConfigurationCopy());

            if (controller.GetConfigurationCopy().isDefault)
            {
                _isFirstRun = true;
                ShowConfigForm();
            }
        }
开发者ID:nenew,项目名称:shadowsocks-windows,代码行数:35,代码来源:MenuViewController.cs


示例10: Main

        static void Main()
        {
            Util.Utils.ReleaseMemory();
            using (Mutex mutex = new Mutex(false, "Global\\ShadowsocksR_" + Application.StartupPath.GetHashCode()))
            {
                Application.EnableVisualStyles();
                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;
                }
                Directory.SetCurrentDirectory(Application.StartupPath);
            //#if !DEBUG
                Logging.OpenLogFile();
            //#endif
                ShadowsocksController controller = new ShadowsocksController();

                MenuViewController viewController = new MenuViewController(controller);

                controller.Start();

                Application.Run();
            }
        }
开发者ID:norkts,项目名称:shadowsocks-csharp,代码行数:28,代码来源:Program.cs


示例11: TCPHandler

        public TCPHandler(ShadowsocksController controller, Configuration config, TCPRelay tcprelay, Socket socket)
        {
            this._controller = controller;
            this._config = config;
            this._tcprelay = tcprelay;
            this._connection = socket;

            lastActivity = DateTime.Now;
        }
开发者ID:Frenda,项目名称:shadowsocks-windows,代码行数:9,代码来源:TCPRelay.cs


示例12: StatisticsStrategyConfigurationForm

 public StatisticsStrategyConfigurationForm(ShadowsocksController controller)
 {
     if (controller == null) return;
     InitializeComponent();
     _controller = controller;
     _controller.ConfigChanged += (sender, args) => LoadConfiguration();
     LoadConfiguration();
     Load += (sender, args) => InitData();
 }
开发者ID:YAIBA2,项目名称:shadowsocks-csharp,代码行数:9,代码来源:StatisticsStrategyConfigurationForm.cs


示例13: ConfigForm

        public ConfigForm(ShadowsocksController controller)
        {
            InitializeComponent();
            UpdateTexts();
            this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());

            this.controller = controller;
            controller.ConfigChanged += controller_ConfigChanged;

            LoadCurrentConfiguration();
        }
开发者ID:wushukai,项目名称:shadowsocks-csharp,代码行数:11,代码来源:ConfigForm.cs


示例14: TCPHandler

        public TCPHandler(ShadowsocksController controller, Configuration config, TCPRelay tcprelay, Socket socket)
        {
            _controller = controller;
            _config = config;
            _tcprelay = tcprelay;
            _connection = socket;
            _proxyTimeout = config.proxy.proxyTimeout * 1000;
            _serverTimeout = config.GetCurrentServer().timeout * 1000;

            lastActivity = DateTime.Now;
        }
开发者ID:passanstoi,项目名称:shadowsocks-windows,代码行数:11,代码来源:TCPRelay.cs


示例15: ConfigForm

        public ConfigForm(ShadowsocksController controller)
        {
            InitializeComponent();

            this.Font = System.Drawing.SystemFonts.MessageBoxFont;
            this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());
            this._lastSelectedSsServerInfo = null;
            this._ssController = controller;
            controller.ConfigChanged += ssController_ConfigChanged;

            UpdateTexts();
            LoadCurrentConfiguration();
        }
开发者ID:fanyangxi,项目名称:shadowsocks-windows,代码行数:13,代码来源:ConfigForm.cs


示例16: StatisticsStrategyConfigurationForm

        public StatisticsStrategyConfigurationForm(ShadowsocksController controller)
        {
            if (controller == null) return;
            InitializeComponent();
            _speedSeries = StatisticsChart.Series["Speed"];
            _packageLossSeries = StatisticsChart.Series["Package Loss"];
            _pingSeries = StatisticsChart.Series["Ping"];
            _controller = controller;
            _controller.ConfigChanged += (sender, args) => LoadConfiguration();
            LoadConfiguration();
            Load += (sender, args) => InitData();

        }
开发者ID:CharlieQ1,项目名称:shadowsocks-windows,代码行数:13,代码来源:StatisticsStrategyConfigurationForm.cs


示例17: SettingsForm

        public SettingsForm(ShadowsocksController controller)
        {
            this.Font = System.Drawing.SystemFonts.MessageBoxFont;
            InitializeComponent();

            this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());
            this.controller = controller;

            UpdateTexts();
            controller.ConfigChanged += controller_ConfigChanged;

            LoadCurrentConfiguration();
        }
开发者ID:jw8013,项目名称:shadowsocks-csharp,代码行数:13,代码来源:SettingsForm.cs


示例18: ServerCrawler

        public ServerCrawler(ShadowsocksController controller)
        {
            this.controller = controller;
            configuration = controller.GetConfigurationCopy();

            this.serverList = new List<Server>();
            foreach (var server in configuration.configs)
            {
                if (server.remarks == CRAWLER_REMARKS)
                {
                    this.serverList.Add(server);
                }
            }
        }
开发者ID:nladuo,项目名称:AutoShadowsocks,代码行数:14,代码来源:ServerCrawler.cs


示例19: HotkeySettingsForm

        public HotkeySettingsForm(ShadowsocksController controller)
        {
            InitializeComponent();
            UpdateTexts();
            this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());

            _controller = controller;
            _controller.ConfigChanged += controller_ConfigChanged;

            LoadCurrentConfiguration();

            // get all textboxes belong to this form
            _allTextBoxes = HotKeys.GetChildControls<TextBox>(this.tableLayoutPanel1);
            if (!_allTextBoxes.Any()) throw new Exception("Cannot get all textboxes");
        }
开发者ID:warmchang,项目名称:shadowsocks-windows,代码行数:15,代码来源:HotkeySettingsForm.cs


示例20: Main

        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();
            }
        }
开发者ID:DZLZHCODE,项目名称:shadowsocks-windows,代码行数:46,代码来源:Program.cs



注:本文中的Shadowsocks.Controller.ShadowsocksController类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Model.Configuration类代码示例发布时间:2022-05-26
下一篇:
C# Sgml.SgmlReader类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap