private void SaveServiceProperties()
        {
            // find control
            try
            {
                IHostingServiceProviderSettings ctrl = serviceProps.Controls[0] as IHostingServiceProviderSettings;
                if (ctrl == null)
                {
                    return;
                }

                // grab settings
                StringDictionary settings = new StringDictionary();
                ctrl.SaveSettings(settings);

                // save settings
                int result = ES.Services.Servers.UpdateServiceSettings(PanelRequest.ServiceId,
                                                                       ConvertDictionaryToArray(settings));

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("SERVER_UPDATE_SERVICE_PROPS", ex);
                return;
            }
        }
        private void BindServiceProperties()
        {
            // find control
            IHostingServiceProviderSettings ctrl = serviceProps.Controls[0] as IHostingServiceProviderSettings;

            if (ctrl == null)
            {
                return;
            }

            // load service properties and bind them
            string[] settings = ES.Services.Servers.GetServiceSettings(PanelRequest.ServiceId);

            // bind
            ctrl.BindSettings(ConvertArrayToDictionary(settings));
        }
예제 #3
0
        private void LoadSettingsControl()
        {
            try
            {
                // try to locate suitable control
                string currPath = this.AppRelativeVirtualPath;
                currPath = currPath.Substring(0, currPath.LastIndexOf("/"));
                string ctrlPath = currPath + "/ProviderControls/" + provider.EditorControl + "_Settings.ascx";

                IHostingServiceProviderSettings ctrl =
                    (IHostingServiceProviderSettings)Page.LoadControl(ctrlPath);

                // add control to the placeholder
                serviceProps.Controls.Add((Control)ctrl);
            }
            catch (Exception ex)
            {
                ShowErrorMessage("SERVER_LOAD_SERVICE_CONTROL", ex);
                return;
            }
        }