public override void Execute() { IMessageDisplayService service = this.services.GetService <IMessageDisplayService>(); SceneView sceneView = (SceneView)this.services.GetService <IViewService>().ActiveView; if (sceneView != null) { ViewNodeManager viewNodeManager = sceneView.InstanceBuilderContext.ViewNodeManager; if (viewNodeManager == null || viewNodeManager.Root == null) { return; } StringBuilder sb = new StringBuilder(); XmlTextWriter xmlTextWriter = new XmlTextWriter((TextWriter) new StringWriter(sb)); xmlTextWriter.Indentation = 4; xmlTextWriter.Formatting = Formatting.Indented; this.DumpViewNodeTree(viewNodeManager.Root, (XmlWriter)xmlTextWriter); xmlTextWriter.Flush(); Dump.Write(sb.ToString()); } else { service.ShowError("No Active Scene"); } }
public void Scavenge(ViewNodeManager disposingManager) { List <object> objs = new List <object>(); List <Guid> guids = new List <Guid>(); foreach (KeyValuePair <Guid, ISerializationContext> keyValuePair in this.serializationDictionary) { if (keyValuePair.Value.ViewNodeManager != disposingManager) { continue; } if (keyValuePair.Value.Owner == null) { guids.Add(keyValuePair.Key); } else { objs.Add(keyValuePair.Value.Owner); } } foreach (object obj in objs) { this.Remove(obj); } foreach (Guid guid in guids) { this.Remove(guid); } }
private void Awake() { singleton = this; if (viewNodeArray == null || viewNodeArray.Length <= 0) { viewNodeArray = GetComponentsInChildren <ViewNode>(); } }
public PersistentViewNodeDictionary(ViewNodeManager viewNodeManager) { this.viewNodeManager = viewNodeManager; this.count = 0; }
public override void UpdateProperty(IInstanceBuilderContext context, ViewNode viewNode, IProperty propertyKey, DocumentNode valueNode) { string instance; string str; IPropertyId shadowProperty; ReferenceStep referenceStep = propertyKey as ReferenceStep; ViewNode item = viewNode.Properties[propertyKey]; if (item != null && DocumentNodeUtilities.IsBinding(item.DocumentNode) && referenceStep != null) { ReferenceStep referenceStep1 = referenceStep; if (context.UseShadowProperties) { shadowProperty = DesignTimeProperties.GetShadowProperty(propertyKey, viewNode.DocumentNode.Type); } else { shadowProperty = null; } IPropertyId propertyId = shadowProperty; if (propertyId != null && DesignTimeProperties.UseShadowPropertyForInstanceBuilding(context.DocumentContext.TypeResolver, propertyId)) { referenceStep1 = propertyId as ReferenceStep; } if (referenceStep1 != null) { IInstantiatedElementViewNode instantiatedElementViewNode = viewNode as IInstantiatedElementViewNode; if (instantiatedElementViewNode == null) { referenceStep1.ClearValue(viewNode.Instance); } else { foreach (object instantiatedElement in instantiatedElementViewNode.InstantiatedElements) { referenceStep1.ClearValue(instantiatedElement); } } } } if (propertyKey.DeclaringType.Metadata.IsNameProperty(propertyKey) && InstanceBuilderOperations.GetIsInlinedResourceWithoutNamescope(viewNode)) { InstanceBuilderOperations.UpdatePropertyWithoutApply(context, viewNode, propertyKey, valueNode); return; } INameScope nameScope = context.NameScope; bool flag = (nameScope == null ? false : propertyKey.DeclaringType.Metadata.IsNameProperty(propertyKey)); if (flag) { ViewNode item1 = viewNode.Properties[propertyKey]; if (item1 != null) { str = item1.Instance as string; } else { str = null; } string str1 = str; if (!string.IsNullOrEmpty(str1) && nameScope.FindName(str1) != null) { context.NameScope.UnregisterName(str1); } } if ((!context.IsSerializationScope || !(propertyKey is Event)) && (context.IsSerializationScope || !DesignTimeProperties.IsDocumentOnlyDesignTimeProperty(propertyKey))) { base.UpdateProperty(context, viewNode, propertyKey, valueNode); } else { InstanceBuilderOperations.UpdatePropertyWithoutApply(context, viewNode, propertyKey, valueNode); } if (flag) { ViewNode viewNode1 = viewNode.Properties[propertyKey]; if (viewNode1 != null) { instance = viewNode1.Instance as string; } else { instance = null; } string str2 = instance; if (!string.IsNullOrEmpty(str2)) { try { if (!str2.StartsWith("~", StringComparison.Ordinal) && !str2.Contains(".")) { if (nameScope.FindName(str2) != null) { nameScope.UnregisterName(str2); } nameScope.RegisterName(str2, viewNode.Instance); } } catch (ArgumentException argumentException1) { ArgumentException argumentException = argumentException1; ViewNodeManager viewNodeManager = viewNode1.ViewNodeManager; CultureInfo currentCulture = CultureInfo.CurrentCulture; string instanceBuilderUnableToRegisterName = ExceptionStringTable.InstanceBuilderUnableToRegisterName; object[] objArray = new object[] { str2 }; viewNodeManager.OnException(viewNode1, new InstanceBuilderException(string.Format(currentCulture, instanceBuilderUnableToRegisterName, objArray), argumentException, viewNode1.DocumentNode, viewNode), false); } } } }
public WarningDictionary(ViewNodeManager viewNodeManager) : base(viewNodeManager) { }
IInstanceDictionary Microsoft.Expression.DesignModel.InstanceBuilders.IViewNodeManagerFactory.CreateInstanceDictionary(ViewNodeManager manager) { return(this.CreateInstanceDictionary(manager)); }
protected abstract IInstanceDictionary CreateInstanceDictionary(ViewNodeManager manager);
public InstanceDictionary(ViewNodeManager viewNodeManager) { this.viewNodeManager = viewNodeManager; }
public ExceptionDictionary(ViewNodeManager viewNodeManager) : base(viewNodeManager) { }