public override void Execute() { IMessageDisplayService service = this.services.GetService <IMessageDisplayService>(); SceneView sceneView = (SceneView)this.services.GetService <IViewService>().ActiveView; if (sceneView != null) { IInstanceDictionary instanceDictionary = sceneView.InstanceDictionary; if (instanceDictionary == null) { return; } StringBuilder stringBuilder1 = new StringBuilder(); foreach (KeyValuePair <object, ViewNode> keyValuePair in (IEnumerable <KeyValuePair <object, ViewNode> >)instanceDictionary) { try { StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append(keyValuePair.Key.ToString()); stringBuilder2.Append(": "); stringBuilder2.Append(keyValuePair.Value.ToString()); stringBuilder1.AppendLine(stringBuilder2.ToString()); } catch (Exception ex) { StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append(keyValuePair.Key.GetType().ToString()); stringBuilder2.Append(": "); stringBuilder2.Append(keyValuePair.Value.ToString()); stringBuilder1.AppendLine(stringBuilder2.ToString()); } } Dump.Write(stringBuilder1.ToString()); } else { service.ShowError("No Active Scene"); } }
protected InstanceBuilderContextBase(IPlatform platform, IDocumentContext documentContext, IDocumentRootResolver documentRootResolver, IViewRootResolver viewRootResolver, ITypeMetadataFactory metadataFactory, INameScope nameScope, IInstanceBuilderContext parentContext, bool useShadowProperties, ITextBufferService textBufferService, DocumentNode alternateSiteNode) { this.documentContext = documentContext; this.platform = platform; this.effectManager = platform.EffectManager; this.instanceBuilderFactory = platform.InstanceBuilderFactory; this.documentRootResolver = documentRootResolver; this.viewRootResolver = viewRootResolver; this.metadataFactory = metadataFactory; this.AllowPostponingResourceEvaluation = true; this.viewNodeManager = this.platform.Create(); this.viewNodeManager.Initialize(this); this.userControlInstances = new HashSet <ViewNode>(); this.currentlyInstantiatingUserControlPreviews = new HashSet <string>(); this.instanceDictionary = this.platform.CreateInstanceDictionary(this.viewNodeManager); this.exceptionDictionary = new Microsoft.Expression.DesignModel.InstanceBuilders.ExceptionDictionary(this.viewNodeManager); this.warningDictionary = new Microsoft.Expression.DesignModel.InstanceBuilders.WarningDictionary(this.viewNodeManager); this.nameScope = nameScope; this.useShadowProperties = useShadowProperties; this.shouldRegisterInstantiatedElements = true; this.parentContext = parentContext; this.textBufferService = textBufferService; this.alternateSiteNode = alternateSiteNode; }
public static FrameworkElement GetLogicalElementForVisual(DependencyObject dependencyObject, IInstanceDictionary dictionary) { if (dictionary == null) { throw new ArgumentNullException("dictionary"); } for (; dependencyObject != null; dependencyObject = VisualTreeHelper.GetParent(dependencyObject)) { FrameworkElement frameworkElement = dependencyObject as FrameworkElement; if (frameworkElement != null && dictionary.GetViewNode((object)frameworkElement, false) != null) { return(frameworkElement); } } return((FrameworkElement)null); }