public GetDescriptor ( string type, bool includeEmbeddeds = false ) : |
||
type | string | |
includeEmbeddeds | bool | |
Результат |
/// <summary> /// Initializes a new instance of the EntryEditorViewModel class. /// </summary> public EntryEditorViewModel(Entry entry, ManifestEditorViewModel manifestEditor) { Entry = entry; _manifestEditor = manifestEditor; Descriptor = _manifestEditor.GetDescriptor(entry.Type, true); if (Descriptor == null) { IsEditable = false; Categories = new List <PropertyEntryCategoryEditorViewModel>(); return; } IsArtifact = Descriptor.Interfaces.Contains("udm.DeployableArtifact"); var categoryQuery = from p in Descriptor.Properties where !p.Hidden orderby p.Category ascending let categoryName = p.Category ?? "Common" let propertyViewModel = GetPropertyEditor(p) where propertyViewModel != null group propertyViewModel by categoryName into category select new PropertyEntryCategoryEditorViewModel(category.Key, category); Categories = categoryQuery.ToList(); CurrentViewedCategory = Categories[0]; IsEditable = true; }
protected override void LoadChildren() { (from entry in _entryProperty.GetListOrSetOfEmbEntry() select new EntryItemViewModel(entry, this, _editor, _editor.GetDescriptor(entry.Type, true)) ).ToList() .ForEach(Children.Add); }
/// <summary> /// Initializes a new instance of the EntryEditorViewModel class. /// </summary> public EntryEditorViewModel(Entry entry, ManifestEditorViewModel manifestEditor) { Entry = entry; _manifestEditor = manifestEditor; Descriptor = _manifestEditor.GetDescriptor(entry.Type, true); if (Descriptor == null) { IsEditable = false; Categories = new List<PropertyEntryCategoryEditorViewModel>(); return; } IsArtifact = Descriptor.Interfaces.Contains("udm.DeployableArtifact"); var categoryQuery = from p in Descriptor.Properties where !p.Hidden orderby p.Category ascending let categoryName = p.Category ?? "Common" let propertyViewModel = GetPropertyEditor(p) where propertyViewModel != null group propertyViewModel by categoryName into category select new PropertyEntryCategoryEditorViewModel(category.Key, category); Categories = categoryQuery.ToList(); CurrentViewedCategory = Categories[0]; IsEditable = true; }