Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            connections connections = new connections();

            connections.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (datosDeConexion.Name != "")
                {
                    /*
                     *  In the properties of the complement we are storing the connections,
                     *  then we obtain the existing connections to add the new one.
                     *  If we do not have a connection we establish that we will create a list of connections.
                     *  We validate that there is no connection with a duplicate name and
                     *  add it to the list of connections, write it in the properties of the project and save the information.
                     */
                    List <conexionesOData> lista = JsonConvert.DeserializeObject <List <conexionesOData> >(MrBotAddIn.Properties.Settings.Default.jsonDeConexiones);
                    if (lista == null)
                    {
                        lista = new List <conexionesOData>();
                    }
                    if (lista.Where(x => x.Name == datosDeConexion.Name).Count() == 0)
                    {
                        lista.Add(datosDeConexion);
                        MrBotAddIn.Properties.Settings.Default.jsonDeConexiones = JsonConvert.SerializeObject(lista);
                        MrBotAddIn.Properties.Settings.Default.Save();

                        connections connections = new connections();
                        connections.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("You already have a connection with this name.");
                    }
                }
                else
                {
                    MessageBox.Show("Enter a new name for the connection.");
                }
            }catch
            {
                MessageBox.Show("The connection could not be created, check the provided URL.");
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            connections connections = new connections();

            connections.Show();
        }