private void Page_Loaded(object sender, RoutedEventArgs e) { Properties.Add(new PropertyItem { Header = "项目名称", Value = _task.References.Project.Name, Glyph = WtIconHelper.GetGlyph(_task.References.Project.Visibility), IsReadonly = true, Color = new SolidColorBrush((Color)Resources["SystemAccentColor"]) }); string taskTypeId = _task.Value.TaskTypeId; var taskType = _task.References.TaskTypes.Single(t => t.Id == taskTypeId); Properties.Add(new PropertyItem { Header = "任务类型", Value = taskType.Name, Glyph = WtIconHelper.GetGlyph("wtf-type-" + taskType.Icon), IsReadonly = true, Color = WtColorHelper.GetSolidColorBrush(WtColorHelper.GetColorByClass(taskType.Icon)) }); var reader = new PropertiesReader(); var props = reader.Read(_task); foreach (var item in props) { Properties.Add(item); } reader.LoadOptions(_task.Value.Id, Properties, Dispatcher); }
public void Read_should_process_category_lines() { using (var pr = new PropertiesReader(new StringReader("[category]\nkey=value"))) { Assert.True(pr.Read()); Assert.Equal(PropertyNodeKind.Category, pr.NodeKind); Properties p = new Properties(pr.ReadToEnd()); Assert.True(p.HasProperty("category.key")); } }
public void Load(FileInfo globalConfigFile) { s_props = this; PropertiesReader.Read(globalConfigFile, PropertyRead); }