コード例 #1
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            Window.Title = Constants.Name + " - " + Messages.WindowsConnectionTitle;

            m_connectionActive = Connection.BuildConnectionActive(true);

            TxtOvpnGenerated.Value = Core.Platform.Instance.NormalizeString(m_connectionActive.OpenVpnProfileStartup.Get());
            if (Connection.Path != "")
            {
                if (Core.Platform.Instance.FileExists(Connection.Path))
                {
                    string original = Core.Platform.Instance.FileContentsReadText(Connection.Path);
                    TxtOvpnOriginal.Value = original;
                }
            }
            else
            {
                TabMain.Remove(TabMain.Items[1]);
            }

            CmdOk.Activated += (object sender, EventArgs e) =>
            {
                Window.Close();
                NSApplication.SharedApplication.StopModal();
            };

            CmdCancel.Activated += (object sender, EventArgs e) =>
            {
                Window.Close();
                NSApplication.SharedApplication.StopModal();
            };
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (TabMain != null)
            {
                TabMain.Dispose();
                TabMain = null;
            }

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

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

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

            if (CmdCancel != null)
            {
                CmdCancel.Dispose();
                CmdCancel = null;
            }
        }
コード例 #3
0
 void Connect()
 {
     if ((Engine.CanConnect() == true) && (Engine.IsConnected() == false) && (Engine.IsWaiting() == false))
     {
         TabMain.SelectAt(0);
         Engine.Connect();
     }
 }
コード例 #4
0
 private void button5_Click_1(object sender, EventArgs e)
 {
     switch (menuOption)
     {
     case 4: TabMain.SelectTab(0);
         break;
     }
 }
コード例 #5
0
 /// <summary>
 /// The set state offline.
 /// </summary>
 private void SetStateOffline()
 {
     this.Dispatcher.BeginInvoke(
         new Action(
             () =>
     {
         TabCommunityChat.IsEnabled = false;
         TabMain.Focus();
     }));
 }
コード例 #6
0
 /// <summary>
 /// The set state offline.
 /// </summary>
 private void SetStateOffline()
 {
     this.Dispatcher.BeginInvoke(
         new Action(
             () =>
     {
         TabCommunityChat.IsEnabled = false;
         TabMain.Focus();
         menuSub.Visibility = Visibility.Collapsed;
     }));
 }
コード例 #7
0
 private void LoadProfileData()
 {
     lblUsername.Text = LoggedUser.UserName.ToUpper();
     lblCity.Text     = LoggedUser.Location;
     lblDate.Text     = LoggedUser.RegisterDate.ToShortDateString();
     TabMain.TabPages.Remove(TabPageRestManagement);
     if (LoggedUser.IsUserRestaurantOwner())
     {
         TabMain.TabPages.Add(TabPageRestManagement);
         TabMain.SelectTab(TabPageRestManagement);
     }
 }
コード例 #8
0
 void ConnectManual()
 {
     if (TableServers.SelectedRows.Count == 1)
     {
         ConnectionInfo s = TableServersController.GetRelatedItem((int)TableServers.SelectedRow);
         if (s.CanConnect())
         {
             Engine.NextServer = s;
             TabMain.SelectAt(0);
             Connect();
         }
     }
 }
コード例 #9
0
ファイル: App.cs プロジェクト: uuware/mobile-memo
        public App()
        {
            Resources = new ResourceDictionary();
            Resources.Add("primaryGreen", Color.FromHex("91CA47"));
            Resources.Add("primaryDarkGreen", Color.FromHex("6FA22E"));

            if (Cfg.SessionGet("IsLogin", false))
            {
                MainPage = new LoginPage();
            }
            else
            {
                MainPage = new TabMain();
            }
        }
コード例 #10
0
        void ReleaseDesignerOutlets()
        {
            if (CboKey != null)
            {
                CboKey.Dispose();
                CboKey = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (CmdUpdater != null)
            {
                CmdUpdater.Dispose();
                CmdUpdater = null;
            }
        }
コード例 #11
0
        public void EnabledUI()
        {
            ConnectionInfo selectedConnection = null;

            if (TableServers.SelectedRowCount == 1)
            {
                selectedConnection = TableServersController.GetRelatedItem((int)TableServers.SelectedRow);
            }

            bool connected = Engine.IsConnected();
            bool waiting   = Engine.IsWaiting();

            if (Engine.Instance.AirVPN != null)
            {
                LblLoginIcon.Hidden = false;
                LblLogin.Hidden     = false;
                TxtLogin.Hidden     = false;
                LblPassword.Hidden  = false;
                TxtPassword.Hidden  = false;
                CmdLogin.Hidden     = false;
                ChkRemember.Hidden  = false;

                bool airvpnLogged = Engine.IsLogged();

                if (airvpnLogged == false)
                {
                    CmdLogin.Title = LanguageManager.GetText("CommandLoginButton");
                }
                else
                {
                    CmdLogin.Title = LanguageManager.GetText("CommandLogout");
                }

                CmdLogin.Enabled = ((waiting == false) && (connected == false) && (TxtLogin.StringValue.Trim() != "") && (TxtPassword.StringValue.Trim() != ""));

                TxtLogin.Enabled    = (airvpnLogged == false);
                TxtPassword.Enabled = (airvpnLogged == false);
                LblKey.Hidden       = ((airvpnLogged == false) || (CboKey.ItemCount < 2));
                CboKey.Hidden       = LblKey.Hidden;
            }
            else
            {
                LblLoginIcon.Hidden = true;
                LblLogin.Hidden     = true;
                TxtLogin.Hidden     = true;
                LblPassword.Hidden  = true;
                TxtPassword.Hidden  = true;
                CmdLogin.Hidden     = true;
                LblKey.Hidden       = true;
                CboKey.Hidden       = true;
                ChkRemember.Hidden  = true;
            }

            ChangeVisibility(this.Window.IsVisible);

            CmdConnect.Enabled = Engine.Instance.CanConnect();

            CmdProviderAdd.Enabled    = true;
            CmdProviderRemove.Enabled = (TableProviders.SelectedRowCount > 0);
            CmdProviderEdit.Enabled   = (TableProviders.SelectedRowCount > 0);

            CmdServersConnect.Enabled   = ((selectedConnection != null) && (selectedConnection.CanConnect()));
            CmdServersWhiteList.Enabled = (TableServers.SelectedRowCount > 0);
            CmdServersBlackList.Enabled = CmdServersWhiteList.Enabled;
            CmdServersUndefined.Enabled = CmdServersWhiteList.Enabled;
            MnuServersConnect.Enabled   = CmdServersConnect.Enabled;
            MnuServersWhitelist.Enabled = CmdServersWhiteList.Enabled;
            MnuServersBlacklist.Enabled = CmdServersBlackList.Enabled;
            MnuServersUndefined.Enabled = CmdServersUndefined.Enabled;

            CmdServersMore.Enabled = (TableServers.SelectedRowCount == 1);
            MnuServersMore.Enabled = CmdServersMore.Enabled;

            CmdServersRename.Enabled = ((selectedConnection != null) && (selectedConnection.Provider is Core.Providers.OpenVPN));
            MnuServersRename.Enabled = CmdServersRename.Enabled;

            CmdAreasWhiteList.Enabled = (TableAreas.SelectedRowCount > 0);
            CmdAreasBlackList.Enabled = CmdAreasWhiteList.Enabled;
            CmdAreasUndefined.Enabled = CmdAreasWhiteList.Enabled;
            MnuAreasWhitelist.Enabled = CmdAreasWhiteList.Enabled;
            MnuAreasBlacklist.Enabled = CmdAreasBlackList.Enabled;
            MnuAreasUndefined.Enabled = CmdAreasUndefined.Enabled;

            CmdLogsCommand.Hidden = (Engine.Storage.GetBool("advanced.expert") == false);

            if (Engine.Instance.NetworkLockManager != null)
            {
                CmdNetworkLock.Hidden = (Engine.Instance.NetworkLockManager.CanEnabled() == false);
                ImgNetworkLock.Hidden = CmdNetworkLock.Hidden;
                if (Engine.Instance.NetworkLockManager.IsActive())
                {
                    CmdNetworkLock.Title = LanguageManager.GetText("NetworkLockButtonActive");
                    ImgNetworkLock.Image = NSImage.ImageNamed("netlock_on.png");

                    LblNetLockStatus.Image   = NSImage.ImageNamed("netlock_status_on.png");
                    LblNetLockStatus.ToolTip = LanguageManager.GetText("NetworkLockStatusActive");
                }
                else
                {
                    CmdNetworkLock.Title = LanguageManager.GetText("NetworkLockButtonDeactive");
                    ImgNetworkLock.Image = NSImage.ImageNamed("netlock_off.png");

                    LblNetLockStatus.Image   = NSImage.ImageNamed("netlock_status_off.png");
                    LblNetLockStatus.ToolTip = LanguageManager.GetText("NetworkLockStatusDeactive");
                }
            }

            if (Engine.Instance.Storage.GetBool("advanced.providers"))
            {
                if (TabMain.Items[1] != TabProviders)
                {
                    TabMain.Insert(TabProviders, 1);
                }
            }
            else
            {
                if (TabMain.Items[1] == TabProviders)
                {
                    TabMain.Remove(TabProviders);
                }
            }
        }
コード例 #12
0
        void ReleaseDesignerOutlets()
        {
            if (CboAdvancedManifestRefresh != null)
            {
                CboAdvancedManifestRefresh.Dispose();
                CboAdvancedManifestRefresh = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (TxtProxyTorControlPort != null)
            {
                TxtProxyTorControlPort.Dispose();
                TxtProxyTorControlPort = null;
            }
        }
コード例 #13
0
ファイル: AddEdit.cs プロジェクト: Gitenax/TrackingApp
        // +---------------------------------------------------+
        // |			            ЗАГРУЗКА ФОРМЫ                   |
        // +---------------------------------------------------+
        private void FormLoad(object sender, EventArgs e)
        {
            TabMain.ItemSize = new Size(0, 1);

            if (selectedIndex.Split('_')[1].Equals("OrganizationEstimate"))
            {
                TabMain.SelectTab("FPage_Estimate");
            }
            else
            {
                TabMain.SelectTab(selectedIndex);
            }

            object[] Values;             // Для редактирования

            #region Косметические изменения формы
            int constW1 = 305;
            switch (TabMain.SelectedTab.Name)
            {
            case "FPage_CarBrand":                  Width = constW1;                        Height = 110;   break;

            case "FPage_CarModel":                  Width = 337;                                    Height = 150;   break;

            case "FPage_Cars":                                      Width = constW1;                        Height = 230;   break;

            case "FPage_CarType":                           Width = constW1;                        Height = 230;   break;

            case "FPage_Drivers":                           Width = constW1;                        Height = 275;   break;

            case "FPage_Estimate":                  Width = 560;                                    Height = 340;   break;

            case "FPage_Organizations": Width = constW1;                    Height = 160;   break;

            case "FPage_Staff":                                     Width = constW1;                        Height = 235;   break;

            case "FPage_StaffPosition": Width = constW1;                    Height = 110;   break;

            case "FPage_Trackinglists": Width = constW1;                    Height = 500;   break;
            }
            Controls.Add(new Panel
            {
                BackColor = Color.White,
                Location  = new Point(0, 0),
                Width     = Width,
                Height    = 6
            });
            TabMain.SendToBack();
            #endregion

            // Заполнение полей в зависимости от типа открываемой формы
            switch (TYPE)
            {
            case DataCommon.FormType.Add:
                switch (TabMain.SelectedTab.Name)
                {
                case "FPage_CarModel":
                    Image img = new Bitmap(Properties.Resources.add, 16, 16);
                    Button_AddNew_CarBrand.BackgroundImage = img;
                    comboBox1.exFill(DB_ID, "Carbrand_name", "CarBrand");
                    break;

                case "FPage_Cars":
                    Width = constW1; Height = 230;
                    comboBox2.exFillExtra(DB_ID, "CarModel.ID, [CarBrand]![Carbrand_name] & \" - \" & [CarModel]![Carmodel_name] AS Result", "CarBrand INNER JOIN CarModel ON CarBrand.ID = CarModel.Carmodel_brand");
                    comboBox3.exFillExtra(DB_ID, "CarType.ID,  \"[\" & [CarType]![Cartype_code] & \"] - \" & [CarType]![Cartype_name] & \" - \" & [CarType]![Cartype_capacity] AS Result", "CarType");
                    break;

                case "FPage_Estimate":
                    comboBox4.exFill(DB_ID, "Trackinglist_number", "Trackinglists", "Trackinglists.ID NOT IN(SELECT Estimate.Estimate_tracklist FROM Estimate)");
                    break;

                case "FPage_Organizations":
                    comboBox5.SelectedIndex = 0;
                    break;

                case "FPage_Staff":
                    comboBox6.exFill(DB_ID, "Staffposition_name", "StaffPosition");
                    break;

                case "FPage_Trackinglists":
                    int lastnum = Trackinglists.GetLastTrackingNumber();
                    if (lastnum == 0)
                    {
                        textBox23.Text = "0";
                    }
                    else
                    {
                        textBox23.Text = (lastnum + 1).ToString();
                    }
                    comboBox7.exFill(DB_ID, "Organization_name", "Organizations", "Organization_ratio=0");
                    comboBox8.exFillExtra(DB_ID, "Cars.ID, [CarBrand]![Carbrand_name] & \" \" & [CarModel]![Carmodel_name] & \", Гос. номер: \" & [Cars]![Car_number] AS Result", "(CarBrand INNER JOIN CarModel ON CarBrand.ID = CarModel.Carmodel_brand) INNER JOIN Cars ON CarModel.ID = Cars.Car_model");
                    comboBox9.exFillExtra(DB_ID, "Drivers.ID, [Drivers]![Driver_lastname] & \" \" & [Drivers]![Driver_firstname] & \" \" &  [Drivers]![Driver_thirdname] AS Result", "Drivers");
                    comboBox10.exFillExtra(DB_ID, "Staff.ID, [Staff]![Staff_lastname] & \" \" & [Staff]![Staff_firstname] & \" \" &  [Staff]![Staff_thirdname] AS Result", "Staff");
                    comboBox11.exFillExtra(DB_ID, "Staff.ID, [Staff]![Staff_lastname] & \" \" & [Staff]![Staff_firstname] & \" \" &  [Staff]![Staff_thirdname] AS Result", "Staff");
                    comboBox12.exFillExtra(DB_ID, "Staff.ID, [Staff]![Staff_lastname] & \" \" & [Staff]![Staff_firstname] & \" \" &  [Staff]![Staff_thirdname] AS Result", "Staff");
                    comboBox13.exFill(DB_ID, "Organization_name", "Organizations", "Organization_ratio=1");
                    comboBox14.exFill(DB_ID, "Organization_name", "Organizations", "Organization_ratio=2");
                    if (comboBox11.Items.Count > 0)
                    {
                        comboBox11.SelectedIndex = 1;
                    }
                    if (comboBox12.Items.Count > 0)
                    {
                        comboBox12.SelectedIndex = 1;
                    }
                    break;
                }
                break;

            case DataCommon.FormType.Edit:
                switch (TabMain.SelectedTab.Name)
                {
                case "FPage_CarBrand":
                    Values        = Base.GetRowFields(ID, "CarBrand");
                    textBox1.Text = Values[0].ToString();
                    break;

                case "FPage_CarModel":
                    Values = Base.GetRowFields(ID, "CarModel");
                    comboBox1.exFill(DB_ID, "Carbrand_name", "CarBrand");
                    comboBox1.SelectedValue = (int)Values[0];
                    textBox2.Text           = Values[1].ToString();
                    break;

                case "FPage_Cars":
                    Values = Base.GetRowFields(ID, "Cars");
                    comboBox2.exFillExtra(DB_ID, "CarModel.ID, [CarBrand]![Carbrand_name] & \" - \" & [CarModel]![Carmodel_name] AS Result", "CarBrand INNER JOIN CarModel ON CarBrand.ID = CarModel.Carmodel_brand");
                    comboBox3.exFillExtra(DB_ID, "CarType.ID,  \"[\" & [CarType]![Cartype_code] & \"] - \" & [CarType]![Cartype_name] & \" - \" & [CarType]![Cartype_capacity] AS Result", "CarType");
                    comboBox2.SelectedValue = (int)Values[0];
                    textBox3.Text           = Values[1].ToString();
                    textBox4.Text           = Values[2].ToString();
                    comboBox3.SelectedValue = (int)Values[3];
                    break;

                case "FPage_CarType":
                    Values         = Base.GetRowFields(ID, "CarType");
                    textBox5.Text  = Values[0].ToString();
                    textBox6.Text  = Values[1].ToString();
                    textBox7.Text  = Values[2].ToString();
                    textBox33.Text = Values[3].ToString();
                    textBox32.Text = Values[4].ToString();
                    break;

                case "FPage_Drivers":
                    Values         = Base.GetRowFields(ID, "Drivers");
                    textBox9.Text  = Values[0].ToString();
                    textBox8.Text  = Values[1].ToString();
                    textBox10.Text = Values[2].ToString();
                    textBox11.Text = Values[3].ToString();
                    textBox16.Text = Values[4].ToString();
                    break;

                case "FPage_Estimate":
                    int ThisTrackingList = DataCommon.GetFieldValue(ID, "Estimate_tracklist", "Estimate").exToInt();
                    Values = Base.GetRowFields(ID, "Estimate");
                    comboBox4.exFill(DB_ID, "Trackinglist_number", "Trackinglists", $"Trackinglists.ID NOT IN(SELECT Estimate.Estimate_tracklist FROM Estimate WHERE Trackinglists.ID NOT IN({ThisTrackingList}))");
                    textBox13.Text          = Values[0].ToString();
                    textBox14.Text          = Values[1].ToString();
                    comboBox4.SelectedValue = (int)Values[2];
                    //comboBox4.Enabled = false;
                    dateTimePicker1.Value = Convert.ToDateTime(Values[3]);
                    textBox15.Text        = Values[4].ToString();
                    textBox12.Text        = Values[5].ToString();                             //Пробег
                    textBox24.Text        = Values[6].ToString();
                    textBox25.Text        = Values[7].ToString();
                    textBox26.Text        = Values[8].ToString();
                    textBox31.Text        = Values[9].ToString();
                    textBox29.Text        = Values[10].ToString();
                    textBox30.Text        = Values[11].ToString();
                    textBox27.Text        = Values[12].ToString();
                    textBox28.Text        = Values[13].ToString();
                    textBox35.Text        = Values[14].ToString();
                    break;

                case "FPage_Organizations":
                    Values                  = Base.GetRowFields(ID, "Organizations");
                    textBox17.Text          = Values[0].ToString();
                    comboBox5.SelectedIndex = (int)Values[1];
                    break;

                case "FPage_Staff":
                    Values = Base.GetRowFields(ID, "Staff");
                    comboBox6.exFill(DB_ID, "Staffposition_name", "StaffPosition");
                    textBox20.Text          = Values[0].ToString();
                    textBox21.Text          = Values[1].ToString();
                    textBox19.Text          = Values[2].ToString();
                    comboBox6.SelectedValue = (int)Values[3];
                    break;

                case "FPage_StaffPosition":
                    Values         = Base.GetRowFields(ID, "StaffPosition");
                    textBox18.Text = Values[0].ToString();
                    break;

                case "FPage_Trackinglists":
                    Values = Base.GetRowFields(ID, "Trackinglists");
                    comboBox7.exFill(DB_ID, "Organization_name", "Organizations", "Organization_ratio=0");
                    comboBox8.exFillExtra(DB_ID, "Cars.ID, [CarBrand]![Carbrand_name] & \" \" & [CarModel]![Carmodel_name] & \", Гос. номер: \" & [Cars]![Car_number] AS Result", "(CarBrand INNER JOIN CarModel ON CarBrand.ID = CarModel.Carmodel_brand) INNER JOIN Cars ON CarModel.ID = Cars.Car_model");
                    comboBox9.exFillExtra(DB_ID, "Drivers.ID, [Drivers]![Driver_lastname] & \" \" & [Drivers]![Driver_firstname] & \" \" &  [Drivers]![Driver_thirdname] AS Result", "Drivers");
                    comboBox10.exFillExtra(DB_ID, "Staff.ID, [Staff]![Staff_lastname] & \" \" & [Staff]![Staff_firstname] & \" \" &  [Staff]![Staff_thirdname] AS Result", "Staff");
                    comboBox11.exFillExtra(DB_ID, "Staff.ID, [Staff]![Staff_lastname] & \" \" & [Staff]![Staff_firstname] & \" \" &  [Staff]![Staff_thirdname] AS Result", "Staff");
                    comboBox12.exFillExtra(DB_ID, "Staff.ID, [Staff]![Staff_lastname] & \" \" & [Staff]![Staff_firstname] & \" \" &  [Staff]![Staff_thirdname] AS Result", "Staff");
                    comboBox13.exFill(DB_ID, "Organization_name", "Organizations", "Organization_ratio=1");
                    comboBox14.exFill(DB_ID, "Organization_name", "Organizations", "Organization_ratio=2");
                    textBox22.Text           = Values[0].ToString();
                    textBox23.Text           = Values[1].ToString();
                    dateTimePicker2.Value    = Convert.ToDateTime(Values[2]);
                    comboBox7.SelectedValue  = (int)Values[3];
                    comboBox8.SelectedValue  = (int)Values[4];
                    comboBox9.SelectedValue  = (int)Values[5];
                    comboBox10.SelectedValue = (int)Values[6];
                    comboBox11.SelectedValue = (int)Values[7];
                    comboBox12.SelectedValue = (int)Values[8];
                    comboBox13.SelectedValue = (int)Values[9];
                    comboBox14.SelectedValue = (int)Values[10];
                    break;
                }
                break;
            }

            if (TYPE == DataCommon.FormType.Edit)
            {
                // Замена событий
                Button_Add.Click -= Button_Add_Click;
                Button_Add.Click += Button_Save_Click;

                // Прочие изменения
                Text            = "Редактировать запись";
                Button_Add.Text = "Сохранить";
            }
        }
コード例 #14
0
 public MenuPrincipal()
 {
     InitializeComponent();
     TabMain.SelectTab(2);
 }