Exemplo n.º 1
0
		public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
		{
			try
			{
				this._applicationObject = (DTE2)application;
				this._addInInstance = (AddIn)addInInst;
				if (connectMode == ext_ConnectMode.ext_cm_Startup && AddinSetupState.State == SetupState.FirstRun)
				{
					LogHelper.LogDebug("Add-in SetupState is FirstRun");
					LogHelper.LogDebug("Removing add-in commands");
					this.RemoveAddinCommands();
					LogHelper.LogDebug("Creating add-in commands");
					this.CreateAddinCommands();
					LogHelper.LogDebug("Opening FirstRunStep1 form");
					FirstRunStep1 firstRunStep = new FirstRunStep1();
					firstRunStep.ShowDialog();
					LogHelper.LogDebug("Setting add-in SetupState to complete");
					AddinSetupState.State = SetupState.SetupComplete;
				}
				if (connectMode == ext_ConnectMode.ext_cm_Startup || connectMode == ext_ConnectMode.ext_cm_AfterStartup)
				{
					LogHelper.LogDebug("Creating add-in menus");
					this.CreateAddinMenus();
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "CodeKeep");
			}
		}
Exemplo n.º 2
0
		private void btnBack_Click(object sender, EventArgs e)
		{
			LogHelper.LogDebug("Showing FirstRunStep1 form");
			this.KillForm();
			FirstRunStep1 firstRunStep = new FirstRunStep1();
			firstRunStep.ShowDialog();
		}
Exemplo n.º 3
0
		private void SetVisibility(FirstRunStep1.FormState state)
		{
			switch (state)
			{
			case FirstRunStep1.FormState.DontUseProxy:
				this.lblPrivateProxyAddr.Enabled = false;
				this.txtPrivateProxyAddr.Enabled = false;
				this.lblPrivateProxyPort.Enabled = false;
				this.txtPrivateProxyPort.Enabled = false;
				this.chkProxyAuthz.Enabled = false;
				this.lblProxyUserName.Enabled = false;
				this.txtProxyUserName.Enabled = false;
				this.lblProxyPswd.Enabled = false;
				this.txtProxyPswd.Enabled = false;
				this.rdoProxyUseIE.Checked = false;
				this.rdoProxyUsePrivate.Checked = false;
				return;
			case FirstRunStep1.FormState.UseIEProxy:
				this.lblPrivateProxyAddr.Enabled = false;
				this.txtPrivateProxyAddr.Enabled = false;
				this.lblPrivateProxyPort.Enabled = false;
				this.txtPrivateProxyPort.Enabled = false;
				this.chkProxyAuthz.Enabled = false;
				this.lblProxyUserName.Enabled = false;
				this.txtProxyUserName.Enabled = false;
				this.lblProxyPswd.Enabled = false;
				this.txtProxyPswd.Enabled = false;
				this.rdoProxyUseNone.Checked = false;
				this.rdoProxyUsePrivate.Checked = false;
				return;
			case FirstRunStep1.FormState.UsePrivateProxy:
				this.lblPrivateProxyAddr.Enabled = true;
				this.txtPrivateProxyAddr.Enabled = true;
				this.lblPrivateProxyPort.Enabled = true;
				this.txtPrivateProxyPort.Enabled = true;
				this.chkProxyAuthz.Enabled = true;
				this.rdoProxyUseNone.Checked = false;
				this.rdoProxyUseIE.Checked = false;
				if (this.chkProxyAuthz.Checked)
				{
					this.SetVisibility(FirstRunStep1.FormState.ProxyNeedsAuthZ);
					return;
				}
				break;
			case FirstRunStep1.FormState.ProxyNeedsAuthZ:
				this.lblProxyUserName.Enabled = true;
				this.txtProxyUserName.Enabled = true;
				this.lblProxyPswd.Enabled = true;
				this.txtProxyPswd.Enabled = true;
				break;
			default:
				return;
			}
		}