public CoreStates( Service.Servers servers, VgcApis.Models.Datas.CoreInfo coreInfo) { this.servers = servers; this.coreInfo = coreInfo; }
public MenuItemsServer( ToolStripMenuItem stopSelected, ToolStripMenuItem restartSelected, ToolStripMenuItem clearSysProxy, ToolStripMenuItem refreshSummary, ToolStripMenuItem selectAllAutorun, ToolStripMenuItem selectAll, ToolStripMenuItem selectNone, ToolStripMenuItem selectInvert, ToolStripMenuItem speedTestOnSelected, ToolStripMenuItem deleteSelected, ToolStripMenuItem copyAsV2rayLinks, ToolStripMenuItem copyAsVmessLinks, ToolStripMenuItem copyAsSubscriptions, ToolStripMenuItem deleteAllItems, ToolStripMenuItem modifySelected, ToolStripMenuItem packSelected, ToolStripMenuItem moveToTop, ToolStripMenuItem moveToBottom, ToolStripMenuItem collapsePanel, ToolStripMenuItem expansePanel) { cache = Service.Cache.Instance; servers = Service.Servers.Instance; InitBatchOperation( stopSelected, restartSelected, speedTestOnSelected, deleteSelected, copyAsV2rayLinks, copyAsVmessLinks, copyAsSubscriptions, deleteAllItems, modifySelected, packSelected, moveToTop, moveToBottom, collapsePanel, expansePanel); InitSelection(selectAllAutorun, selectAll, selectNone, selectInvert); InitMisc(clearSysProxy, refreshSummary); }
public MenuItemsServer( ToolStripMenuItem stopSelected, ToolStripMenuItem restartSelected, ToolStripMenuItem clearSysProxy, ToolStripMenuItem refreshSummary, ToolStripMenuItem speedTestOnSelected, ToolStripMenuItem deleteSelected, ToolStripMenuItem copyAsV2rayLinks, ToolStripMenuItem copyAsVmessLinks, ToolStripMenuItem copyAsSubscriptions, ToolStripMenuItem deleteAllItems, ToolStripMenuItem modifySelected, ToolStripMenuItem packSelected, ToolStripMenuItem moveToTop, ToolStripMenuItem moveToBottom, ToolStripMenuItem collapsePanel, ToolStripMenuItem expansePanel, ToolStripMenuItem sortBySpeed, ToolStripMenuItem sortBySummary) { cache = Service.Cache.Instance; servers = Service.Servers.Instance; InitCtrlSorting(sortBySpeed, sortBySummary); InitCtrlView(moveToTop, moveToBottom, collapsePanel, expansePanel); InitCtrlCopyToClipboard(copyAsV2rayLinks, copyAsVmessLinks, copyAsSubscriptions); InitCtrlDelete(deleteSelected, deleteAllItems); InitCtrlBatchOperation(stopSelected, restartSelected, speedTestOnSelected, modifySelected, packSelected); InitCtrlSysProxy(clearSysProxy, refreshSummary); }
public MenuUpdater( Views.WinForms.FormConfiger formConfiger, ToolStripMenuItem miReplaceServer, ToolStripMenuItem miLoadServer) { servers = Service.Servers.Instance; this.formConfiger = formConfiger; this.miReplaceServer = miReplaceServer; this.miLoadServer = miLoadServer; menuUpdater = new VgcApis.Libs.Tasks.LazyGuy( () => { try { VgcApis.Libs.Utils.RunInBackground( UpdateServerMenus); } catch { // Do not hurt me. } }, VgcApis.Models.Consts.Intervals.FormConfigerMenuUpdateDelay); }
public MenuItemsSelect( ToolStripMenuItem selectAllCurPage, ToolStripMenuItem invertSelectionCurPage, ToolStripMenuItem selectNoneCurPage, ToolStripMenuItem selectAllAllPages, ToolStripMenuItem invertSelectionAllPages, ToolStripMenuItem selectNoneAllPages, ToolStripMenuItem selectAutorunAllPages, ToolStripMenuItem selectNoMarkAllPages, ToolStripMenuItem selectNoSpeedTestAllPages, ToolStripMenuItem selectRunningAllPages, ToolStripMenuItem selectTimeoutAllPages, ToolStripMenuItem selectUntrackAllPages, ToolStripMenuItem selectAllAllServers, ToolStripMenuItem invertSelectionAllServers, ToolStripMenuItem selectNoneAllServers, ToolStripMenuItem selectAutorunAllServers, ToolStripMenuItem selectNoMarkAllServers, ToolStripMenuItem selectNoSpeedTestAllServers, ToolStripMenuItem selectRunningAllServers, ToolStripMenuItem selectTimeoutAllServers, ToolStripMenuItem selectUntrackAllServers) { servers = Service.Servers.Instance; InitAllPagesSelectors(selectNoneAllPages, invertSelectionAllPages, selectAllAllPages, selectAutorunAllPages, selectRunningAllPages, selectTimeoutAllPages, selectNoSpeedTestAllPages, selectNoMarkAllPages, selectUntrackAllPages); InitAllServersSelector(selectNoneAllServers, invertSelectionAllServers, selectAllAllServers, selectAutorunAllServers, selectRunningAllServers, selectTimeoutAllServers, selectNoSpeedTestAllServers, selectNoMarkAllServers, selectUntrackAllServers); InitCurPageSelectors(selectAllCurPage, selectNoneCurPage, invertSelectionCurPage); }
public TabSetting( ComboBox cboxLanguage, ComboBox cboxPageSize, CheckBox chkServAutoTrack, CheckBox chkPortableMode, CheckBox chkSetUseV4, CheckBox chkSetEnableStat, CheckBox chkSetUpdateUseProxy, CheckBox chkSetCheckWhenAppStart) { this.setting = Service.Setting.Instance; this.servers = Service.Servers.Instance; // Do not put these lines of code into InitElement. this.cboxLanguage = cboxLanguage; this.cboxPageSize = cboxPageSize; this.chkServAutoTrack = chkServAutoTrack; this.chkPortableMode = chkPortableMode; this.chkSetUseV4 = chkSetUseV4; this.chkSetEnableStat = chkSetEnableStat; this.chkSetCheckWhenAppStart = chkSetCheckWhenAppStart; this.chkSetUpdateUseProxy = chkSetUpdateUseProxy; InitElement(); }
public void Run( Service.Setting setting, Service.Servers servers) { this.settingService = setting; this.serversService = servers; }
public MenuItemsBasic( Form formMain, ToolStripMenuItem pluginToolStrip, ToolStripMenuItem miSimVmessServer, ToolStripMenuItem miImportLinkFromClipboard, ToolStripMenuItem miExportAllServer, ToolStripMenuItem miImportFromFile, ToolStripMenuItem miAbout, ToolStripMenuItem miHelp, ToolStripMenuItem miFormConfigEditor, ToolStripMenuItem miFormQRCode, ToolStripMenuItem miFormLog, ToolStripMenuItem miFormOptions, ToolStripMenuItem miDownloadV2rayCore, ToolStripMenuItem miRemoveV2rayCore, ToolStripMenuItem miCheckVgcUpdate) { servers = Service.Servers.Instance; slinkMgr = Service.ShareLinkMgr.Instance; updater = Service.Updater.Instance; pluginServ = Service.PluginsServer.Instance; this.formMain = formMain; InitMenuPlugin(pluginToolStrip); InitMenuFile(miSimVmessServer, miImportLinkFromClipboard, miExportAllServer, miImportFromFile); InitMenuWindows(miFormConfigEditor, miFormQRCode, miFormLog, miFormOptions); InitMenuAbout(miAbout, miHelp, miDownloadV2rayCore, miRemoveV2rayCore, miCheckVgcUpdate); }
public FlyServer( Form formMain, FlowLayoutPanel panel, ToolStripLabel lbMarkFilter, ToolStripComboBox cboxMarkeFilter, ToolStripStatusLabel tslbTotal, ToolStripDropDownButton tsdbtnPager, ToolStripStatusLabel tslbPrePage, ToolStripStatusLabel tslbNextPage) { this.servers = Service.Servers.Instance; this.setting = Service.Setting.Instance; this.formMain = formMain; this.flyPanel = panel; this.cboxMarkFilter = cboxMarkeFilter; this.tsdbtnPager = tsdbtnPager; this.tslbTotal = tslbTotal; this.tslbPrePage = tslbPrePage; this.tslbNextPage = tslbNextPage; this.welcomeItem = new Views.UserControls.WelcomeUI(); InitFormControls(lbMarkFilter); BindDragDropEvent(); RefreshUI(); servers.OnRequireFlyPanelUpdate += OnRequireFlyPanelUpdateHandler; servers.OnRequireFlyPanelReload += OnRequireFlyPanelReloadHandler; servers.OnRequireStatusBarUpdate += OnRequireStatusBarUpdateHandler; }
public void Run( Service.Cache cache, Service.Setting setting, Service.ConfigMgr configMgr, Service.Servers servers) { //external dependency injection coreCtrl = new CoreServerComponent.CoreCtrl(setting, configMgr); states = new CoreServerComponent.CoreStates(servers, coreInfo); logger = new CoreServerComponent.Logger(setting); configer = new CoreServerComponent.Configer( setting, cache, configMgr, servers, coreInfo); Plug(this, coreCtrl); Plug(this, states); Plug(this, logger); Plug(this, configer); //inter-container dependency injection coreCtrl.Prepare(); states.Prepare(); logger.Prepare(); configer.Prepare(); //other initializiations coreCtrl.BindEvents(); }
public Quick( Button skipCN, Button mtProto, CheckBox chkUseV4) { cache = Service.Cache.Instance; servers = Service.Servers.Instance; configMgr = Service.ConfigMgr.Instance; isUseV4 = chkUseV4.Checked; chkUseV4.CheckedChanged += (s, a) => { isUseV4 = chkUseV4.Checked; }; skipCN.Click += (s, a) => { container.InjectConfigHelper( () => configMgr .InjectSkipCnSiteSettingsIntoConfig( ref container.config, isUseV4) ); }; mtProto.Click += (s, a) => { container.InjectConfigHelper(() => { InsertMTProto(ref container.config); }); }; }
public MenuItemsServer( // for invoke ui refresh MenuStrip menuContainer, // misc ToolStripMenuItem refreshSummary, ToolStripMenuItem deleteAllServers, ToolStripMenuItem deleteSelected, // copy ToolStripMenuItem copyAsV2cfgLinks, ToolStripMenuItem copyAsVmessLinks, ToolStripMenuItem copyAsVeeLinks, ToolStripMenuItem copyAsVmessSubscriptions, ToolStripMenuItem copyAsVeeSubscriptions, // batch op ToolStripMenuItem speedTestOnSelected, ToolStripMenuItem modifySelected, ToolStripMenuItem stopSelected, ToolStripMenuItem restartSelected, // view ToolStripMenuItem moveToTop, ToolStripMenuItem moveToBottom, ToolStripMenuItem foldPanel, ToolStripMenuItem expansePanel, ToolStripMenuItem sortBySpeed, ToolStripMenuItem sortBySummary) { cache = Service.Cache.Instance; servers = Service.Servers.Instance; setting = Service.Setting.Instance; slinkMgr = Service.ShareLinkMgr.Instance; this.menuContainer = menuContainer; // for invoke ui update InitCtrlSorting(sortBySpeed, sortBySummary); InitCtrlView(moveToTop, moveToBottom, foldPanel, expansePanel); InitCtrlCopyToClipboard( copyAsV2cfgLinks, copyAsVmessLinks, copyAsVeeLinks, copyAsVmessSubscriptions, copyAsVeeSubscriptions); InitCtrlMisc( refreshSummary, deleteSelected, deleteAllServers); InitCtrlBatchOperation( stopSelected, restartSelected, speedTestOnSelected, modifySelected); }
public void Run( Service.Setting setting, Service.Servers servers) { this.apiUtils = new Apis.ApiUtils(); this.settingService = setting; this.serversService = servers; }
public WelcomeUI() { servers = Service.Servers.Instance; setting = Service.Setting.Instance; InitializeComponent(); marginBottom = this.Height - pnlBasicUsage.Top; }
public MenuItemVgcAutoUpdate( ToolStripMenuItem miCheckVgcUpdate) { setting = Service.Setting.Instance; servers = Service.Servers.Instance; InitAutoUpdater(); miCheckVgcUpdate.Click += CheckForUpdate; }
public FormConfigerCtrl(string originalConfig) { servers = Service.Servers.Instance; this.originalFile = string.Empty; this.originalConfig = string.Empty; LoadConfig(originalConfig); }
FormBatchModifyServerSetting() { servers = Service.Servers.Instance; InitializeComponent(); VgcApis.Libs.UI.AutoSetFormIcon(this); this.Show(); }
public CoreCtrl( Service.Setting setting, Service.Servers servers, Service.ConfigMgr configMgr) { this.setting = setting; this.servers = servers; this.configMgr = configMgr; }
public FormMain() { setting = Service.Setting.Instance; servers = Service.Servers.Instance; InitializeComponent(); VgcApis.Libs.UI.AutoSetFormIcon(this); Lib.UI.AutoScaleToolStripControls(this, 16); GenFormTitle(); }
public FormQRCode() { servers = Service.Servers.Instance; slinkMgr = Service.ShareLinkMgr.Instance; servIndex = -1; linkType = VgcApis.Models.Datas.Enum.LinkTypes.vmess; InitializeComponent(); VgcApis.Libs.UI.AutoSetFormIcon(this); }
public FlyServer( FlowLayoutPanel panel, ComboBox cboxMarkeFilter) { this.servers = Service.Servers.Instance; this.flyPanel = panel; this.cboxMark = cboxMarkeFilter; InitMarkFilter(cboxMarkeFilter); BindDragDropEvent(); servers.OnRequireFlyPanelUpdate += OnRequireFlyPanelUpdateHandler; }
FormQRCode() { servers = Service.Servers.Instance; servIndex = 0; linkType = 0; InitializeComponent(); VgcApis.Libs.UI.AutoSetFormIcon(this); this.Show(); }
FormBatchModifyServerSetting() { servers = Service.Servers.Instance; InitializeComponent(); #if DEBUG this.Icon = Properties.Resources.icon_light; #else this.Icon = Properties.Resources.icon_dark; #endif this.Show(); }
FormMain() { setting = Service.Setting.Instance; servers = Service.Servers.Instance; InitializeComponent(); #if DEBUG this.Icon = Properties.Resources.icon_light; #endif Lib.UI.AutoScaleToolSripControls(this, 16); this.Show(); }
FormMain() { setting = Service.Setting.Instance; servers = Service.Servers.Instance; InitializeComponent(); #if DEBUG this.Icon = Properties.Resources.icon_light; #endif this.Show(); }
public Configer( Service.Setting setting, Service.Cache cache, Service.ConfigMgr configMgr, Service.Servers servers, VgcApis.Models.Datas.CoreInfo coreInfo) { this.configMgr = configMgr; this.setting = setting; this.cache = cache; this.servers = servers; this.coreInfo = coreInfo; }
public void Run( Service.Cache cache, Service.Setting setting, Service.Servers servers) { this.cache = cache; this.servers = servers; this.setting = setting; server = new Service.Core(setting); server.OnLog += OnLogHandler; server.OnCoreStatusChanged += OnCoreStateChangedHandler; }
public MenuItemsServer( // for invoke ui refresh MenuStrip menuContainer, // system proxy ToolStripMenuItem curSysProxySummary, ToolStripMenuItem copyCurPacUrl, ToolStripMenuItem visitCurPacDebuggerUrl, ToolStripMenuItem clearSysProxy, ToolStripMenuItem restartPACServer, ToolStripMenuItem stopPACServer, // misc ToolStripMenuItem refreshSummary, ToolStripMenuItem deleteAllServers, ToolStripMenuItem deleteSelected, // copy ToolStripMenuItem copyAsV2rayLinks, ToolStripMenuItem copyAsVmessLinks, ToolStripMenuItem copyAsSubscriptions, // batch op ToolStripMenuItem speedTestOnSelected, ToolStripMenuItem modifySelected, ToolStripMenuItem packSelected, ToolStripMenuItem stopSelected, ToolStripMenuItem restartSelected, // view ToolStripMenuItem moveToTop, ToolStripMenuItem moveToBottom, ToolStripMenuItem foldPanel, ToolStripMenuItem expansePanel, ToolStripMenuItem sortBySpeed, ToolStripMenuItem sortBySummary) { cache = Service.Cache.Instance; servers = Service.Servers.Instance; setting = Service.Setting.Instance; pacServer = Service.PacServer.Instance; this.menuContainer = menuContainer; // for invoke ui update InitCtrlSorting(sortBySpeed, sortBySummary); InitCtrlView(moveToTop, moveToBottom, foldPanel, expansePanel); InitCtrlCopyToClipboard(copyAsV2rayLinks, copyAsVmessLinks, copyAsSubscriptions); InitCtrlMisc(refreshSummary, deleteSelected, deleteAllServers); InitCtrlBatchOperation(stopSelected, restartSelected, speedTestOnSelected, modifySelected, packSelected); InitCtrlSysProxy(curSysProxySummary, copyCurPacUrl, visitCurPacDebuggerUrl, clearSysProxy, restartPACServer, stopPACServer); }
public FormConfiger(string originalConfigString = null) { setting = Service.Setting.Instance; servers = Service.Servers.Instance; isShowPanel = setting.isShowConfigerToolsPanel; formSearch = null; InitializeComponent(); formTitle = this.Text; this.originalConfigString = originalConfigString; VgcApis.Libs.UI.AutoSetFormIcon(this); this.Show(); }
FormQRCode() { servers = Service.Servers.Instance; servIndex = 0; linkType = 0; InitializeComponent(); #if DEBUG this.Icon = Properties.Resources.icon_light; #endif this.Show(); }