public void ApplyNewLayout(string newLayoutRelativePath) { DisposeView(); layoutResourceDictionaries = null; LayoutFilePath = getUrl(newLayoutRelativePath); View.Instance.SaveExtensionsConfigData(); if (ToolPanels != null) { // save the XML for the toolPanels toolsXmlFileContents = ToolPanels.GetToolPanelsXml(); } ToolPanels.Current.Clear(); behaviorsXmlFileContents = GetBehaviorsXml().ToString(SaveOptions.OmitDuplicateNamespaces); controlsXmlFileContents = View.GetConfigurationOfControls(); disposeExtensibilityObjects(); if (ViewerApplication != null) { ViewerApplication.LayoutFilePath = newLayoutRelativePath; } downloadLayoutFile(); // Reset the Identify Popup control and content PopupHelper.Reset(); }
public ViewerApplicationControl() { VerticalContentAlignment = System.Windows.VerticalAlignment.Stretch; HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch; ToolPanels = new ToolPanels(); BehaviorsConfiguration = new Controls.BehaviorsConfiguration(); SetInstance(this); }
private void disposeExtensibilityObjects() { if (ToolPanels != null) { // Dipose attached event handlers ToolPanels.Dispose(); } if (BehaviorsConfiguration != null) { BehaviorsConfiguration.Dispose(); } }
public IEnumerable <string> GetAllAssembliesNamesInUse(out string behaviorsXml) { List <string> assemblies = getUniqueAssemblyNamesForTypes(ToolPanels.GetToolItemObjects()); IEnumerable <string> namespaces = getAllNamespacesInUse(out behaviorsXml); if (namespaces != null) { foreach (string namespaceMapping in namespaces) { string assembly = AssemblyManager.GetAssemblyNameForNamespaceDeclaration(namespaceMapping); if (!string.IsNullOrWhiteSpace(assembly)) { if (!assemblies.Contains(assembly) && !AssemblyManager.IsBuiltInAssembly(assembly)) { assemblies.Add(assembly); } } } } return(assemblies); }