當前位置: 首頁>>代碼示例>>C#>>正文


C# ShadowsocksController.GetCurrentConfiguration方法代碼示例

本文整理匯總了C#中Shadowsocks.Controller.ShadowsocksController.GetCurrentConfiguration方法的典型用法代碼示例。如果您正苦於以下問題:C# ShadowsocksController.GetCurrentConfiguration方法的具體用法?C# ShadowsocksController.GetCurrentConfiguration怎麽用?C# ShadowsocksController.GetCurrentConfiguration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Shadowsocks.Controller.ShadowsocksController的用法示例。


在下文中一共展示了ShadowsocksController.GetCurrentConfiguration方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: frmMain

        public frmMain(ShadowsocksController sc)
        {
            InitializeComponent();

            //初始化QQWry
            var qqwryPath = Environment.CurrentDirectory + "\\qqwry.dat";
            if (qqwry == null && File.Exists(qqwryPath)) qqwry = new QQWry(qqwryPath);
            controller = sc;

            #region i18N
            if (System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag.ToLowerInvariant().StartsWith("zh"))
            {
                Text = "Ping測試";
                dgvMain.Columns[0].HeaderText = "地址";
                dgvMain.Columns[1].HeaderText = "IP地址";
                dgvMain.Columns[2].HeaderText = "備注";
                dgvMain.Columns[3].HeaderText = "物理地址";
                dgvMain.Columns[4].HeaderText = "最大Ping值";
                dgvMain.Columns[5].HeaderText = "最小Ping值";
                dgvMain.Columns[6].HeaderText = "平均Ping值";
                dgvMain.Columns[7].HeaderText = "失敗次數";
                dgvMain.Columns[8].HeaderText = "下行速度";
                dgvMain.Columns[9].HeaderText = "測速";
                tssStatusLabel.Text = "當前狀態:";
                tssStatus.Text = "準備就緒";
            }
            #endregion

            LoadConfiguration(controller.GetCurrentConfiguration());

            if (dgvMain.Rows.Count <= 5)
            {
                foreach (var row in dgvMain.Rows)
                {
                    var t = new Thread(Ping) { IsBackground = true };
                    t.Start(row);
                }
            }
            else
            {
                ChangeStatus("Busy...");
                var t = new Thread(Go) { IsBackground = true };
                t.Start(dgvMain.Rows);
            }
        }
開發者ID:4n0ON,項目名稱:shadowsocks-csharp-withping,代碼行數:45,代碼來源:frmMain.cs


注:本文中的Shadowsocks.Controller.ShadowsocksController.GetCurrentConfiguration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。