private void BindData(bool rebuild)
        {
            var addInPath = CommonLogic.SafeMapPath(String.Format("~/{0}", AppLogic.AppConfig("AddInDir")));
            var addIns    = AddInDiscoveryHelper.DiscoverAvailableAddins(addInPath, rebuild);

            grdAddIns.DataSource = addIns;
            grdAddIns.DataBind();
        }
        protected void btnRebuild_Click(object sender, EventArgs e)
        {
            var addInPath = CommonLogic.SafeMapPath(String.Format("~/{0}", AppLogic.AppConfig("AddInDir")));

            AddInDiscoveryHelper.DiscoverAvailableAddins(addInPath, true);
        }
        public override bool UpdateChanges()
        {
            bool addedNew = false;

            foreach (KeyValuePair <int, StoreConfigDataConstruct> kvp in StoreConfigValues)
            {
                AppConfig currentConfig = kvp.Value.EditingConfig;
                if (currentConfig != null)
                {
                    int currentStoreId = kvp.Value.StoreId;

                    //plhConfigValueEditor
                    String editorID =
                        currentConfig.Description = txtDescription.Text;
                    currentConfig.ConfigValue     = GetConfigValue(kvp.Value.EditorPlaceHolder, currentConfig, false, kvp.Value.StoreId); //this.txtConfigValue.Text;
                    currentConfig.GroupName       = cboGroupName.SelectedValue;

                    if (currentConfig.Name.Equals("AddIns.Enabled", StringComparison.OrdinalIgnoreCase))
                    {
                        if (!CommonLogic.FileExists(CommonLogic.SafeMapPath("~/{0}/PipelineSegments.store".FormatWith(AppLogic.AppConfig("AddInDir")))))
                        {
                            String addInPath = CommonLogic.SafeMapPath(String.Format("~/{0}", AppLogic.AppConfig("AddInDir")));

                            AddInDiscoveryHelper.DiscoverAvailableAddins(addInPath, true);
                        }
                    }

                    if (ThisCustomer.IsAdminSuperUser)
                    {
                        currentConfig.SuperOnly = rbSuperOnly.Items[0].Selected; // 0 is Yes
                        currentConfig.ValueType = cboValueType.SelectedValue;
                        if (!string.IsNullOrEmpty(txtAllowableValues.Text))
                        {
                            List <string> allowableValues = new List <string>();
                            allowableValues.AddCommaDelimited(txtAllowableValues.Text);
                            currentConfig.AllowableValues = allowableValues;
                        }
                    }
                }
                else // adding duplicate for store
                {
                    AppConfig DefaultAppConfig = AppLogic.GetAppConfigRouted(kvp.Value.ConfigName, kvp.Value.StoreId);
                    String    NewConfigValue   = GetConfigValue(phStoreValues, DefaultAppConfig, true, kvp.Value.StoreId);
                    if (DefaultAppConfig.ValueType.EqualsIgnoreCase("boolean") || (DefaultAppConfig != null && NewConfigValue.ToLower() != DefaultAppConfig.ConfigValue.ToLower() && NewConfigValue.ToLower() != m_OriginalDefaultValue.ToLower()))
                    {
                        AppConfig newConfig = AppConfig.Create(DefaultAppConfig.Name, DefaultAppConfig.Description, NewConfigValue, DefaultAppConfig.GroupName, DefaultAppConfig.SuperOnly, kvp.Value.StoreId);
                        newConfig.ValueType       = DefaultAppConfig.ValueType;
                        newConfig.AllowableValues = DefaultAppConfig.AllowableValues;
                        addedNew = true;
                    }
                }
            }

            OnUpdatedChanges(EventArgs.Empty);

            if (addedNew)
            {
                AppConfigManager.LoadAllConfigs();
            }

            return(false);
        }