private void OnConfigurationCategoryClick(object sender, RoutedEventArgs e) { ConfigurationCategory category = (ConfigurationCategory)((Button)sender).DataContext; ConfigurationDialogContentControl.Content = category; ConfigurationDialogContent.Width = ActualWidth - 50; ConfigurationDialogContent.Height = Application.Current.MainWindow.ActualHeight - 50; DialogHost.Show(ConfigurationDialogContent, "RootDialog"); }
/// <summary> /// 配置信息的类型判断 /// </summary> /// <param name="configuration">配置信息类型</param> /// <returns>配置信息类型</returns> public static ConfigurationCategory GetConfiguration(string configuration) { ConfigurationCategory returnValue = ConfigurationCategory.Configuration; foreach (ConfigurationCategory configurationCategory in Enum.GetValues(typeof(ConfigurationCategory))) { if (configurationCategory.ToString().Equals(configuration)) { returnValue = configurationCategory; break; } } return(returnValue); }
public ConfigurationItemAttribute(ConfigurationCategory configurationCategory, string displayName, string introduction, object defultValue) { if (!Enum.IsDefined(typeof(ConfigurationCategory), configurationCategory)) { throw new ArgumentOutOfRangeException(nameof(configurationCategory), "Value should be defined in the ConfigurationCategory enum."); } ConfigurationCategory = configurationCategory; DisplayName = displayName ?? throw new ArgumentNullException(nameof(displayName)); Introduction = introduction ?? throw new ArgumentNullException(nameof(introduction)); DefultValue = defultValue ?? throw new ArgumentNullException(nameof(defultValue)); }
public static ConfigurationCategory GetConfiguration(string configuration) { ConfigurationCategory category = ConfigurationCategory.Configuration; using (IEnumerator enumerator = Enum.GetValues(typeof(ConfigurationCategory)).GetEnumerator()) { ConfigurationCategory current; while (enumerator.MoveNext()) { current = (ConfigurationCategory)enumerator.Current; if (current.ToString().Equals(configuration)) { goto Label_0046; } } return(category); Label_0046: category = current; } return(category); }
public ConfigurationEntryServerValue(IConfiguration configuration, ConfigurationEntryMetadata metadata, RavenServer.AuthenticationStatus authenticationStatus) : base(metadata) { ServerValues = new Dictionary <string, ConfigurationEntrySingleValue>(); foreach (var key in Metadata.Keys) { var value = ConfigurationCategory.GetValueForKey(key, configuration); if (value == null) { continue; } var hasAccess = authenticationStatus == RavenServer.AuthenticationStatus.ClusterAdmin; ServerValues[key] = new ConfigurationEntrySingleValue { Value = hasAccess && Metadata.IsSecured == false ? value : null, HasAccess = hasAccess, HasValue = true, }; } }