예제 #1
0
        /// <summary>
        /// General > Network > API Providers > Edit.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEditAPIServer_Click(object sender, EventArgs e)
        {
            // Search for the provider with the selected name
            SerializableAPIProvider customProvider =
                m_settings.APIProviders.CustomProviders.First(provider => provider.Name == (string)cbAPIServer.SelectedItem);

            // Open the config form for this provider
            using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, customProvider))
            {
                apiForm.ShowDialog();
            }
        }
예제 #2
0
        /// <summary>
        /// General > API Providers > Add.
        /// Displays the API provider configuration.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddAPIServer_Click(object sender, EventArgs e)
        {
            SerializableAPIProvider newProvider = new SerializableAPIProvider();

            using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, newProvider))
            {
                DialogResult result = apiForm.ShowDialog();
                if (result == DialogResult.OK)
                {
                    m_settings.APIProviders.CustomProviders.Add(newProvider);
                    InitialiseAPIProvidersDropDown();
                    cbAPIServer.SelectedIndex = cbAPIServer.Items.Count - 1;
                }
            }
        }
예제 #3
0
        /// <summary>
        /// General > Network > API Providers > Edit.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEditAPIServer_Click(object sender, EventArgs e)
        {
            // Search the provider with the selected name
            string name = (string)cbAPIServer.SelectedItem;

            foreach (var provider in m_settings.APIProviders.CustomProviders)
            {
                if (name == provider.Name)
                {
                    // Open the config form for this provider
                    using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, provider))
                    {
                        apiForm.ShowDialog();
                    }
                    return;
                }
            }
        }
예제 #4
0
        /// <summary>
        /// General > API Providers > Add.
        /// Displays the API provider configuration.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddAPIServer_Click(object sender, EventArgs e)
        {
            SerializableAPIProvider newProvider = new SerializableAPIProvider();

            newProvider.Methods.AddRange(APIMethod.CreateDefaultSet().Select(
                                             apiMethod => new SerializableAPIMethod
            {
                MethodName = apiMethod.Method.ToString(),
                Path       = apiMethod.Path
            }));

            using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, newProvider))
            {
                DialogResult result = apiForm.ShowDialog();
                if (result != DialogResult.OK)
                {
                    return;
                }

                m_settings.APIProviders.CustomProviders.Add(newProvider);
                InitializeAPIProvidersDropDown();
                cbAPIServer.SelectedIndex = cbAPIServer.Items.Count - 1;
            }
        }
예제 #5
0
 /// <summary>
 /// General > Network > API Providers > Edit.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEditAPIServer_Click(object sender, EventArgs e)
 {
     // Search the provider with the selected name
     string name = (string)cbAPIServer.SelectedItem;
     foreach (var provider in m_settings.APIProviders.CustomProviders)
     {
         if (name == provider.Name)
         {
             // Open the config form for this provider
             using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, provider))
             {
                 apiForm.ShowDialog();
             }
             return;
         }
     }
 }
예제 #6
0
 /// <summary>
 /// General > API Providers > Add.
 /// Displays the API provider configuration.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddAPIServer_Click(object sender, EventArgs e)
 {
     SerializableAPIProvider newProvider = new SerializableAPIProvider();
     using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, newProvider))
     {
         DialogResult result = apiForm.ShowDialog();
         if (result == DialogResult.OK)
         {
             m_settings.APIProviders.CustomProviders.Add(newProvider);
             InitialiseAPIProvidersDropDown();
             cbAPIServer.SelectedIndex = cbAPIServer.Items.Count - 1;
         }
     }
 }
예제 #7
0
        /// <summary>
        /// General > Network > API Providers > Edit.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEditAPIServer_Click(object sender, EventArgs e)
        {
            // Search for the provider with the selected name
            SerializableAPIProvider customProvider =
                m_settings.APIProviders.CustomProviders.First(provider => provider.Name == (string)cbAPIServer.SelectedItem);

            // Open the config form for this provider
            using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, customProvider))
            {
                apiForm.ShowDialog();
            }
        }
예제 #8
0
        /// <summary>
        /// General > API Providers > Add.
        /// Displays the API provider configuration.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddAPIServer_Click(object sender, EventArgs e)
        {
            SerializableAPIProvider newProvider = new SerializableAPIProvider();
            newProvider.Methods.AddRange(APIMethod.CreateDefaultSet().Select(
                apiMethod => new SerializableAPIMethod
                {
                    MethodName = apiMethod.Method.ToString(),
                    Path = apiMethod.Path
                }));

            using (APISettingsForm apiForm = new APISettingsForm(m_settings.APIProviders, newProvider))
            {
                DialogResult result = apiForm.ShowDialog();
                if (result != DialogResult.OK)
                    return;

                m_settings.APIProviders.CustomProviders.Add(newProvider);
                InitializeAPIProvidersDropDown();
                cbAPIServer.SelectedIndex = cbAPIServer.Items.Count - 1;
            }
        }