protected override void UpdateNode(IAssetNodePresenter node) { if (!(node.Asset is SkeletonViewModel)) { return; } if (typeof(NodeInformation).IsAssignableFrom(node.Type) && node.IsVisible) { // Hide all children foreach (var child in node.Children) { child.IsVisible = false; } var name = (string)node[nameof(NodeInformation.Name)].Value; var depth = (int)node[nameof(NodeInformation.Depth)].Value; // Set the display name to be the name of the node, indented using space. node.DisplayName = $"{"".PadLeft(2 * depth)}{name}"; // Set the order to be the index, we don't want to sort alphabetically var index = (node as AssetItemNodePresenter)?.Index ?? NodeIndex.Empty; if (index.IsInt) { node.Order = index.Int; } } }
protected override void UpdateNode(IAssetNodePresenter node) { if (node.Asset != null) { node.AttachedProperties.Add(OwnerAssetData.Key, node.Asset); } }
protected override void UpdateNode(IAssetNodePresenter node) { var entity = node.Root.Value as Entity; var asset = node.Asset; if (asset == null || entity == null) { return; } if (node.Name == nameof(ModelNodeLinkComponent.Target) && node.Parent?.Value is ModelNodeLinkComponent) { var parent = (IAssetNodePresenter)node.Parent; parent.AttachedProperties.Set(ModelNodeLinkData.Key, GetAvailableNodesForLink(asset, (ModelNodeLinkComponent)parent?.Value)); } if (node.Name == nameof(SpriteStudioNodeLinkComponent.Target) && node.Parent?.Value is SpriteStudioNodeLinkComponent) { var parent = (IAssetNodePresenter)node.Parent; parent.AttachedProperties.Set(ModelNodeLinkData.Key, GetAvailableNodesForLink(asset, (SpriteStudioNodeLinkComponent)parent?.Value)); } var physicsComponent = node.Value as PhysicsComponent; if (physicsComponent != null) { node.AttachedProperties.Set(ModelNodeLinkData.Key, GetAvailableNodesForLink(asset, physicsComponent)); } }
protected override void UpdateNode(IAssetNodePresenter node) { var asset = node.Asset?.Asset as VideoAsset; if (asset != null && node.Name == nameof(VideoAsset.Width)) { node.IsVisible = asset.IsSizeInPercentage; var absoluteWidth = node.Parent.Children.FirstOrDefault(x => x.Name == AbsoluteWidth) ?? node.Factory.CreateVirtualNodePresenter(node.Parent, AbsoluteWidth, typeof(int), node.Order, () => node.Value, node.UpdateValue, () => node.HasBase, () => node.IsInherited, () => node.IsOverridden); absoluteWidth.IsVisible = !asset.IsSizeInPercentage; absoluteWidth.AttachedProperties.Set(NumericData.MinimumKey, 0); absoluteWidth.AttachedProperties.Set(NumericData.MaximumKey, float.MaxValue); absoluteWidth.AttachedProperties.Set(NumericData.DecimalPlacesKey, 0); } if (asset != null && node.Name == nameof(VideoAsset.Height)) { node.IsVisible = asset.IsSizeInPercentage; var absoluteHeight = node.Parent.Children.FirstOrDefault(x => x.Name == AbsoluteHeight) ?? node.Factory.CreateVirtualNodePresenter(node.Parent, AbsoluteHeight, typeof(int), node.Order, () => node.Value, node.UpdateValue, () => node.HasBase, () => node.IsInherited, () => node.IsOverridden); absoluteHeight.IsVisible = !asset.IsSizeInPercentage; absoluteHeight.AttachedProperties.Set(NumericData.MinimumKey, 0); absoluteHeight.AttachedProperties.Set(NumericData.MaximumKey, float.MaxValue); absoluteHeight.AttachedProperties.Set(NumericData.DecimalPlacesKey, 0); } }
protected override void UpdateNode(IAssetNodePresenter node) { if (node.Asset is SpriteSheetViewModel asset) { if (node.Name == nameof(SpriteSheetAsset.Sprites) && node.Value is List <SpriteInfo> ) { node.Children.ForEach(x => x.IsVisible = false); node.IsVisible = false; } if (typeof(SpriteInfo).IsAssignableFrom(node.Type)) { switch (asset.Asset.Type) { case SpriteSheetType.Sprite2D: node[nameof(SpriteInfo.Borders)].IsVisible = false; break; case SpriteSheetType.UI: node[nameof(SpriteInfo.Center)].IsVisible = false; node[nameof(SpriteInfo.CenterFromMiddle)].IsVisible = false; break; default: throw new ArgumentOutOfRangeException(); } } } }
/// <inheritdoc/> protected override void UpdateNode(IAssetNodePresenter node) { if (node.Type == typeof(Thickness)) { foreach (var child in node.Children) { child.IsVisible = false; } } if (node.Type == typeof(StripDefinition)) { node[nameof(StripDefinition.Type)].IsVisible = false; node[nameof(StripDefinition.SizeValue)].IsVisible = false; } if (node.Asset is UIBaseViewModel) { if (node.Type.HasInterface(typeof(UIElement)) || node.Type.HasInterface(typeof(IEnumerable <UIElement>))) { // Hide UIElement properties node.IsVisible = false; if (!node.IsObjectReference(node.Value)) { UpdateDependencyProperties(node); } } } }
public void FinalizeNodePresenterTree(IAssetNodePresenter root) { foreach (var node in root.Children.BreadthFirst(x => x.Children)) { if (node.Parent?.Value is CameraComponent) { if (node.Name == nameof(CameraComponent.VerticalFieldOfView)) { node.AddDependency(node.Parent[nameof(CameraComponent.Projection)], false); // Set to true if it has children properties node.IsVisible = (CameraProjectionMode)node.Parent[nameof(CameraComponent.Projection)].Value == CameraProjectionMode.Perspective; } if (node.Name == nameof(CameraComponent.OrthographicSize)) { node.AddDependency(node.Parent[nameof(CameraComponent.Projection)], false); // Set to true if it has children properties node.IsVisible = (CameraProjectionMode)node.Parent[nameof(CameraComponent.Projection)].Value == CameraProjectionMode.Orthographic; } if (node.Name == nameof(CameraComponent.AspectRatio)) { node.AddDependency(node.Parent[nameof(CameraComponent.UseCustomAspectRatio)], false); // Set to true if it has children properties node.IsVisible = (bool)node.Parent[nameof(CameraComponent.UseCustomAspectRatio)].Value; } } } }
protected override void UpdateNode(IAssetNodePresenter node) { if (!(node.Asset is MaterialViewModel)) { return; } // Bypass the Attributes node to display directly the attribute items if (node.Name == nameof(MaterialAsset.Attributes) && node.Value is MaterialAttributes) { node.BypassNode(); } if (node.Name == nameof(ComputeShaderClassBase <ComputeNode> .MixinReference) && node.Parent != null && typeof(IComputeNode).IsAssignableFrom(node.Parent.Type)) { // Pick only effect shaders visible from the package in which the related asset is contained var asset = node.Asset; node.AttachedProperties.Add(MaterialData.Key, asset.Directory.Package.AllAssets.Where(x => x.AssetType == typeof(EffectShaderAsset)).Select(x => x.Name)); } // The node is a material blend layer if (typeof(MaterialBlendLayer).IsAssignableFrom(node.Type)) { var layer = (MaterialBlendLayer)node.Value; node.DisplayName = !string.IsNullOrWhiteSpace(layer.Name) ? layer.Name : $"Layer {node.Index}"; node[nameof(MaterialBlendLayer.Name)].IsVisible = false; if (node.Commands.All(x => x.Name != RenameStringKeyCommand.CommandName)) { node.Commands.Add(new SyncAnonymousNodePresenterCommand(RenameStringKeyCommand.CommandName, (x, name) => x[nameof(MaterialBlendLayer.Name)].UpdateValue(name))); } node.AddDependency(node[nameof(MaterialBlendLayer.Name)], false); } }
protected override void FinalizeTree(IAssetNodePresenter root) { var asset = root.Asset?.Asset as AnimationAsset; if (asset?.Type is DifferenceAnimationAssetType) { var clipDuration = root[nameof(AnimationAsset.Type)][nameof(DifferenceAnimationAssetType.ClipDuration)]; var mode = root[nameof(AnimationAsset.Type)][nameof(DifferenceAnimationAssetType.Mode)]; clipDuration.AddDependency(mode, false); var enabledNode = clipDuration[nameof(AnimationAssetDurationUnchecked.Enabled)]; var startNode = clipDuration[nameof(AnimationAssetDurationUnchecked.StartAnimationTimeBox)]; startNode.AddDependency(enabledNode, false); var endNode = clipDuration[nameof(AnimationAssetDurationUnchecked.EndAnimationTimeBox)]; endNode.AddDependency(enabledNode, false); } if (asset != null) { var enabledNode = root[nameof(AnimationAsset.ClipDuration)][nameof(AnimationAssetDuration.Enabled)]; var startNode = root[nameof(AnimationAsset.ClipDuration)][nameof(AnimationAssetDuration.StartAnimationTime)]; startNode.AddDependency(enabledNode, false); var endNode = root[nameof(AnimationAsset.ClipDuration)][nameof(AnimationAssetDuration.EndAnimationTime)]; endNode.AddDependency(enabledNode, false); } }
private static void SetComponent(IAssetNodePresenter node, FieldInfo field, object component) { var value = node.Value; field.SetValue(value, component); node.UpdateValue(value); }
protected override void UpdateNode(IAssetNodePresenter node) { var memberNode = node as MemberNodePresenter; MemberCollectionAttribute memberCollection; if (memberNode != null && memberNode.IsEnumerable) { memberCollection = memberNode.MemberAttributes.OfType <MemberCollectionAttribute>().FirstOrDefault(); } else { memberCollection = node.Descriptor.Attributes.OfType <MemberCollectionAttribute>().FirstOrDefault() ?? TypeDescriptorFactory.Default.AttributeRegistry.GetAttribute <MemberCollectionAttribute>(node.Type); } if (memberCollection != null) { if (memberCollection.CanReorderItems) { node.AttachedProperties.Add(CollectionData.ReorderCollectionItemKey, new ReorderCollectionItemViewModel()); } if (memberCollection.ReadOnly) { node.AttachedProperties.Add(CollectionData.ReadOnlyCollectionKey, true); } } }
protected override void FinalizeTree(IAssetNodePresenter root) { if (root.PropertyProvider is GraphicsCompositorViewModel) { root.Children.Where(x => x.Name != ArchetypeNodeUpdater.ArchetypeNodeName).ForEach(x => x.IsVisible = false); } base.FinalizeTree(root); }
protected override void UpdateNode(IAssetNodePresenter node) { // Root node if (typeof(SpriteFontAsset).IsAssignableFrom(node.Type)) { node.AttachedProperties.Add(SpriteFontData.Key, InstalledFonts); } }
protected override void UpdateNode(IAssetNodePresenter node) { if (!(node.Asset is GameSettingsViewModel)) { return; } if (node.Name == nameof(GameSettingsAsset.Defaults) && node.Value is List <Configuration> ) { foreach (var item in node.Children.ToList()) { item.Order = node.Order + item.Index.Int; item.AttachedProperties.Add(CategoryData.Key, true); } if (!node.Commands.Any(cmd => cmd.Name == AddNewItemCommand.CommandName)) { node.Commands.Add(new AddNewItemCommand()); } if (!node.Commands.Any(cmd => cmd.Name == RemoveItemCommand.CommandName)) { node.Commands.Add(new RemoveItemCommand()); } } if (typeof(Configuration).IsAssignableFrom(node.Type)) { node.DisplayName = DisplayAttribute.GetDisplayName(node.Value?.GetType()) ?? DisplayAttribute.GetDisplayName(typeof(Configuration)); } if (typeof(ConfigurationOverride).IsAssignableFrom(node.Type)) { node.DisplayName = $"Override {node.Index}"; node.AttachedProperties.Add(CategoryData.Key, true); } if (node.Parent != null && typeof(ConfigurationOverride).IsAssignableFrom(node.Parent.Type) && node.Name == nameof(ConfigurationOverride.SpecificFilter)) { if (node.Commands.All(x => x.Name != "ClearSelection")) { node.Commands.Add(new SyncAnonymousNodePresenterCommand("ClearSelection", (n, x) => n.UpdateValue(-1))); } } if (typeof(ICollection <Configuration>).IsAssignableFrom(node.Type)) { var types = node.AttachedProperties.Get(AbstractNodeEntryData.Key); types = types.Where(x => ((ICollection <Configuration>)node.Value).All(y => !(x is AbstractNodeType && y.GetType() == ((AbstractNodeType)x).Type))); node.AttachedProperties.Set(AbstractNodeEntryData.Key, types); } }
protected override void UpdateNode(IAssetNodePresenter node) { var type = node.Descriptor.GetInnerCollectionType(); if (type.IsAbstract && !IsReferenceType(type) && !node.IsObjectReference(node.Value) && IsInstantiable(type)) { var abstractNodeEntries = FillDefaultAbstractNodeEntry(node); node.AttachedProperties.Add(AbstractNodeEntryData.Key, abstractNodeEntries); } }
protected override void UpdateNode(IAssetNodePresenter node) { if (!(node.Asset is AnimationViewModel)) { return; } if (node.Name == nameof(AnimationAsset.AnimationTimeMinimum) || node.Name == nameof(AnimationAsset.AnimationTimeMaximum)) { node.IsVisible = false; } // Base clip duration if (node.Name == nameof(AnimationAssetDuration.StartAnimationTime) || node.Name == nameof(AnimationAssetDuration.EndAnimationTime)) { var childNode = node.Parent[nameof(AnimationAssetDuration.Enabled)]; if (childNode != null && childNode.Value.ToString().ToLowerInvariant().Equals("false")) { node.IsVisible = false; } else { node.IsVisible = true; } } // Reference clip duration if (node.Name == nameof(AnimationAssetDurationUnchecked.StartAnimationTimeBox) || node.Name == nameof(AnimationAssetDurationUnchecked.EndAnimationTimeBox)) { var childNode = node.Parent[nameof(AnimationAssetDurationUnchecked.Enabled)]; if (childNode != null && childNode.Value.ToString().ToLowerInvariant().Equals("false")) { node.IsVisible = false; } else { node.IsVisible = true; } } // If there is a skeleton, hide ScaleImport and PivotPosition (they are overriden by skeleton values) if (typeof(AnimationAsset).IsAssignableFrom(node.Type)) { if (node[nameof(AnimationAsset.Skeleton)].Value != null) { node[nameof(AnimationAsset.PivotPosition)].IsVisible = false; node[nameof(AnimationAsset.ScaleImport)].IsVisible = false; } // Add dependency to reevaluate if value changes node.AddDependency(node[nameof(AnimationAsset.Skeleton)], false); } }
protected override void FinalizeTree(IAssetNodePresenter root) { var asset = root.Asset?.Asset as VideoAsset; if (asset != null) { var size = CategoryData.ComputeCategoryNodeName("Size"); root[size][nameof(VideoAsset.Width)].AddDependency(root[size][nameof(VideoAsset.IsSizeInPercentage)], false); root[size][nameof(VideoAsset.Height)].AddDependency(root[size][nameof(VideoAsset.IsSizeInPercentage)], false); } }
protected override void UpdateNode(IAssetNodePresenter node) { if (mathematicsTypes.Contains(node.Type)) { foreach (var field in node.Type.GetFields(BindingFlags.Public | BindingFlags.Instance)) { var dataMemberAttribute = field.GetCustomAttribute <DataMemberAttribute>(); var component = node.Factory.CreateVirtualNodePresenter(node, field.Name, field.FieldType, dataMemberAttribute?.Order, () => field.GetValue(node.Value), x => SetComponent(node, field, x), () => node.HasBase, () => node.IsInherited, () => node.IsOverridden); component.IsVisible = false; } } }
protected override void UpdateNode(IAssetNodePresenter node) { if (node.Value is IUnloadable && node.Name != DisplayData.UnloadableObjectInfo) { node.AttachedProperties.Add(DisplayData.AutoExpandRuleKey, ExpandRule.Once); node.Factory.CreateVirtualNodePresenter(node, DisplayData.UnloadableObjectInfo, typeof(object), 0, () => node.Value, null, () => node.HasBase, () => node.IsInherited, () => node.IsOverridden); } }
protected override void UpdateNode(IAssetNodePresenter node) { var entity = node.Root.Value as Entity; if (node.Asset?.Editor == null || entity == null) { return; } var partId = new AbsoluteId(node.Asset.Id, entity.Id); var viewModel = (EntityHierarchyElementViewModel)((EntityHierarchyEditorViewModel)node.Asset.Editor).FindPartViewModel(partId); viewModel?.UpdateNodePresenter(node); }
protected override void FinalizeTree(IAssetNodePresenter root) { var entity = root.Value as Entity; if (root.Asset?.Editor == null || entity == null) { return; } var partId = new AbsoluteId(root.Asset.Id, entity.Id); var viewModel = (EntityHierarchyElementViewModel)((EntityHierarchyEditorViewModel)root.Asset.Editor).FindPartViewModel(partId); viewModel?.FinalizeNodePresenterTree(root); base.FinalizeTree(root); }
private AssetVirtualNodePresenter CreateDependencyPropertyNode(IAssetNodePresenter propertyNodeParent, [NotNull] IAssetNodePresenter node, [NotNull] PropertyKey property, int?order) { var propertyType = property.PropertyType; var propertyIndex = new NodeIndex(property); var accessor = node.GetNodeAccessor(); var propertyContainerNode = ((IObjectNode)accessor.Node)[nameof(UIElement.DependencyProperties)].Target; var undoRedoService = propertyNodeParent.Asset.ServiceProvider.Get <IUndoRedoService>(); var virtualNode = node.Factory.CreateVirtualNodePresenter(propertyNodeParent, property.Name, propertyType, order, () => Getter(propertyContainerNode, propertyIndex), o => Setter(undoRedoService, propertyContainerNode, propertyIndex, o)); return(virtualNode); }
protected override void UpdateNode(IAssetNodePresenter node) { if ((node.Parent?.Value?.GetType() == typeof(NavigationComponent) && node.Name == nameof(NavigationComponent.GroupId)) || (node.Root.Type == typeof(NavigationMeshAsset) && node.Parent?.Name == nameof(NavigationMeshAsset.SelectedGroups) && node.Type == typeof(Guid))) { var gameSettingsAsset = GetGameSettingsAssetViewModel()?.Asset as GameSettingsAsset; if (gameSettingsAsset == null) { // Selecting groups is only supported for games node.AttachedProperties.Add(DisplayData.AttributeDisplayNameKey, "Not available"); return; } var navigationSettings = gameSettingsAsset.GetOrDefault <NavigationSettings>(); foreach (var child in node.Children) { child.IsVisible = false; } // TODO: Add dependency on game settings, so that this value updates automatically IEnumerable <AbstractNodeEntry> types = AbstractNodeValue.Null.Yield(); // Add groups from navigation settings types = types.Concat(navigationSettings.Groups.Select(x => new AbstractNodeValue(x, x.ToString(), 0))); var selectedId = (Guid)node.Value; var selectedGroup = navigationSettings.Groups.FirstOrDefault(x => x.Id == selectedId); node.AttachedProperties[AbstractNodeEntryData.Key] = types; if (node.Commands.All(x => x.Name != CreateNewInstanceCommand.CommandName)) { node.Commands.Add(new SyncAnonymousNodePresenterCommand(CreateNewInstanceCommand.CommandName, UpdateNavigationGroup)); } node.AttachedProperties.Add(DisplayData.AttributeDisplayNameKey, selectedGroup?.Name ?? AbstractNodeValue.Null.DisplayValue); } else if (typeof(NavigationMeshGroup).IsAssignableFrom(node.Type)) { var group = (NavigationMeshGroup)node.Value; // Provide a display name for groups to uniquely identify them node.AttachedProperties.Add(DisplayData.AttributeDisplayNameKey, group?.ToString() ?? "None"); // Bypass agent settings to simplify the group settings node.Children.First(x => x.Name == nameof(NavigationMeshGroup.AgentSettings)).BypassNode(); } }
public static IEnumerable <AbstractNodeEntry> FillDefaultAbstractNodeEntry(IAssetNodePresenter node) { var type = node.Descriptor.GetInnerCollectionType(); IEnumerable <AbstractNodeEntry> abstractNodeMatchingEntries = AbstractNodeType.GetInheritedInstantiableTypes(type); if (abstractNodeMatchingEntries != null) { // Prepend the value that will allow to set the value to null, if this command is allowed. if (IsAllowingNull(node)) { abstractNodeMatchingEntries = AbstractNodeValue.Null.Yield().Concat(abstractNodeMatchingEntries); } } return(abstractNodeMatchingEntries); }
protected override void UpdateNode(IAssetNodePresenter node) { if (!(node.PropertyProvider is AssetViewModel) || node.Asset == null) { return; } // Add a link to the archetype in the root node, if there is an archetype for this asset. if (typeof(Asset).IsAssignableFrom(node.Type) && node.Asset.Asset.Archetype != null) { var session = node.Asset.Session; var archetype = session.GetAssetById(node.Asset.Asset.Archetype.Id); var assetReference = ContentReferenceHelper.CreateReference <AssetReference>(archetype); var archetypeNode = node.Factory.CreateVirtualNodePresenter(node, ArchetypeNodeName, typeof(AssetReference), int.MinValue, () => assetReference); archetypeNode.DisplayName = nameof(Asset.Archetype); archetypeNode.IsReadOnly = true; } }
protected override void UpdateNode(IAssetNodePresenter node) { if (AssetRegistry.IsContentType(node.Type) || typeof(AssetReference).IsAssignableFrom(node.Type)) { node.AttachedProperties.Add(SessionData.SessionKey, session); node.AttachedProperties.Add(ReferenceData.Key, new ContentReferenceViewModel()); } // Numeric and TimeSpan templates need access to the UndoRedoService to create transactions if (node.Type == typeof(TimeSpan) || node.Type.IsNumeric()) { node.AttachedProperties.Add(SessionData.SessionKey, session); } if (AssetRegistry.IsContentType(node.Type)) { var assetTypes = AssetRegistry.GetAssetTypes(node.Type); var thumbnailService = session.ServiceProvider.Get <IThumbnailService>(); node.AttachedProperties.Add(SessionData.DynamicThumbnailKey, !assetTypes.All(thumbnailService.HasStaticThumbnail)); } }
protected override void UpdateNode(IAssetNodePresenter node) { if (node.Value is SceneCameraSlot) { SceneCameraSlot slot = (SceneCameraSlot)node.Value; // Hide children node.Children.ForEach(x => x.IsVisible = false); node.AttachedProperties.Set(DisplayData.AttributeDisplayNameKey, slot.Name); } else if (node.Value is SceneCameraSlotId) { // Grab all graphics compositor of the same package as the asset. // TODO: we do not take all package dependencies for now because we don't want to include Stride package compositors. var graphicsCompositors = node.Asset.Directory.Package.Assets.Where(x => x.AssetType == typeof(GraphicsCompositorAsset)); var entries = new List <AbstractNodeEntry>(); foreach (var compositor in graphicsCompositors) { var asset = (GraphicsCompositorAsset)compositor.Asset; entries.Add(new AbstractNodeValue(new SceneCameraSlotId(), AbstractNodeValue.Null.DisplayValue, AbstractNodeValue.Null.Order)); var i = 0; foreach (var slot in asset.Cameras) { var slotId = slot.ToSlotId(); var entry = new AbstractNodeValue(slotId, $"{compositor.Url} > {slot.Name}", i++); entries.Add(entry); } } node.AttachedProperties.Add(AbstractNodeEntryData.Key, entries); node.Children.ForEach(x => x.IsVisible = false); // TODO: turn this into a real command! if (node.Commands.All(x => x.Name != CameraSlotData.UpdateCameraSlotIndex)) { node.Commands.Add(new SyncAnonymousNodePresenterCommand(CameraSlotData.UpdateCameraSlotIndex, (n, id) => UpdateCameraSlotIndex(n, (SceneCameraSlotId)id))); } } }
/// <summary> /// Checks if <see cref="MemberCollectionAttribute.NotNullItems"/> is present and set. /// </summary> /// <param name="node">The node to check.</param> /// <returns>True if null is a possible choice for this node, otherwise false.</returns> public static bool IsAllowingNull(IAssetNodePresenter node) { var abstractNodeAllowNull = true; var memberNode = node as MemberNodePresenter ?? (node as ItemNodePresenter)?.Parent as MemberNodePresenter; if (memberNode != null) { var memberCollection = memberNode.MemberAttributes.OfType <MemberCollectionAttribute>().FirstOrDefault() ?? memberNode.Descriptor.Attributes.OfType <MemberCollectionAttribute>().FirstOrDefault(); if (memberNode.IsEnumerable && memberCollection != null && memberCollection.NotNullItems) { // Collections abstractNodeAllowNull = false; } else { // Members abstractNodeAllowNull = !memberNode.MemberAttributes.OfType <NotNullAttribute>().Any(); } } return(abstractNodeAllowNull); }
protected override void UpdateNode(IAssetNodePresenter node) { if (!(node is MemberNodePresenter memberNode)) { return; } if (node.Index.Value is PropertyKey propertyKey) { var propertyKeyDocumentation = documentationService.GetPropertyKeyDocumentation(propertyKey); if (propertyKeyDocumentation != null) { node.AttachedProperties.Add(DocumentationData.Key, propertyKeyDocumentation); } } else { var memberDocumentation = documentationService.GetMemberDocumentation(memberNode.MemberDescriptor, node.Root.Type); if (memberDocumentation != null) { node.AttachedProperties.Add(DocumentationData.Key, memberDocumentation); } } }
private void UpdateDependencyProperties([NotNull] IAssetNodePresenter node) { var element = node.Value as UIElement; var parent = element?.VisualParent; if (parent == null) { return; } // Create a virtual node for each attached dependency property declared by the parent var startOrder = AttachedPropertyOrder; foreach (var property in GetDeclaredProperties(parent).Where(p => p.Metadatas.Any(m => (m as DependencyPropertyKeyMetadata)?.Flags.HasFlag(DependencyPropertyFlags.Attached) ?? false))) { string displayName, categoryName; int? order; GetDisplayData(property, out displayName, out categoryName, out order); var propertyNodeparent = node.GetCategory(categoryName) ?? node; var propNode = CreateDependencyPropertyNode(propertyNodeparent, node, property, order ?? startOrder++); propNode.DisplayName = parent.GetType().Name + "." + displayName; propNode.ChangeParent(node.GetCategory(categoryName) ?? node); } }