public FormSettings(CodeWithMeServer _server) : this() { server = _server; txtEmail.Text = Settings.Default.Email; txtDbHost.Text = Settings.Default.DBHost; txtDbPort.Text = Settings.Default.DBPort.ToString(); txtDbName.Text = Settings.Default.DBName; txtDbUsername.Text = Settings.Default.DBUsername; }
/// <summary>Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host application has completed loading.</summary> /// <param term='custom'>Array of parameters that are host application specific.</param> /// <seealso class='IDTExtensibility2' /> public void OnStartupComplete(ref Array custom) { ServerIngredients data; //data = new ServerIngredients(_applicationObject, new UserCredentials(Settings.Default.Email, Settings.Default.Password), 5000, true, new StorageCredentials(Settings.Default.DBHost, Settings.Default.DBPort, Settings.Default.DBName, Settings.Default.DBUsername, Settings.Default.DBPassword)); ApiHandler _apiHandler = new ApiHandler(Settings.Default.ApiUrl, Settings.Default.ApiKeyPrivate, Settings.Default.ApiKeyPublic); data = new ServerIngredients(_applicationObject, _apiHandler, Settings.Default.AutosaveInterval * 1000, Settings.Default.UseAutosave); Server = new CodeWithMeServer(data); //System.Windows.Forms.MessageBox.Show("_applicationObject: " + (_applicationObject == null).ToString()); //System.Windows.Forms.MessageBox.Show("Server: " + (Server == null).ToString()); }
/// <summary>Implements the Exec method of the IDTCommandTarget interface. This is called when the command is invoked.</summary> /// <param term='commandName'>The name of the command to execute.</param> /// <param term='executeOption'>Describes how the command should be run.</param> /// <param term='varIn'>Parameters passed from the caller to the command handler.</param> /// <param term='varOut'>Parameters passed from the command handler to the caller.</param> /// <param term='handled'>Informs the caller if the command was handled or not.</param> /// <seealso class='Exec' /> public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { handled = false; if (executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault) { if (commandName == "CodeWithMeVSAddin.Connect.CodeWithMeVSAddin") { ServerIngredients data; //data = new ServerIngredients(_applicationObject, new UserCredentials(Settings.Default.Email, Settings.Default.Password), 5000, true, new StorageCredentials(Settings.Default.DBHost, Settings.Default.DBPort, Settings.Default.DBName, Settings.Default.DBUsername, Settings.Default.DBPassword)); ApiHandler _apiHandler = new ApiHandler(Settings.Default.ApiUrl, Settings.Default.ApiKeyPrivate, Settings.Default.ApiKeyPublic); data = new ServerIngredients(_applicationObject, _apiHandler, 5000, true); server = new CodeWithMeServer(data); new FormSettings(server).ShowDialog(); handled = true; return; } } }
public FormSettings(CodeWithMeServer _server) : this() { server = _server; }