private void InitMainDockManager() { if (_RootVBDesign != null) { return; } if (ACRoot.SRoot.Businessobjects != null) { ACClassDesign acClassDesign = ACRoot.SRoot.Businessobjects.GetDesign(Global.ACKinds.DSDesignLayout, Global.ACUsages.DUMain); if (acClassDesign != null) { _RootVBDesign = new VBDesign(); _RootVBDesign.VBContent = "*" + acClassDesign.ACIdentifier; _RootVBDesign.DataContext = ACRoot.SRoot.Businessobjects; } acClassDesign = ACRoot.SRoot.Businessobjects.GetDesign("AppResourceDict"); if (acClassDesign != null) { ResourceDictionary resDict = Layoutgenerator.LoadResource(acClassDesign.XMLDesign, ACRoot.SRoot.Businessobjects, null); if (resDict != null) { resDict.Add("TouchScreenMode", ControlManager.TouchScreenMode); App._GlobalApp.Resources.MergedDictionaries.Add(resDict); } } } if (_RootVBDesign == null) { _RootVBDesign = new VBDesign(); _RootVBDesign.DataContext = ACRoot.SRoot.Businessobjects; } _RootVBDesign.Margin = new Thickness(0, 0, -5, 0); _RootVBDesign.Loaded += new RoutedEventHandler(RootVBDesign_Loaded); SubMainDockPanel.Children.Add(_RootVBDesign); foreach (ACComponent childComp in ACRoot.SRoot.ACComponentChilds) { if (childComp is ApplicationManagerProxy || childComp is ACComponentManager) { IACPropertyNetBase alarmProperty = childComp.GetPropertyNet("HasAlarms") as IACPropertyNetBase; if (alarmProperty != null) { alarmProperty.PropertyChanged += alarmProperty_PropertyChanged; } alarmProperty = childComp.GetPropertyNet("AlarmsAsText") as IACPropertyNetBase; if (alarmProperty != null) { alarmProperty.PropertyChanged += alarmProperty_PropertyChanged; } } } RefreshWarningIcon(); }
public FocusBSOResult FocusBSO(IACBSO bso) { if (DockingManager == null || DockingManager.vbDockingPanelTabbedDoc_TabControl == null || DockingManager.vbDockingPanelTabbedDoc_TabControl.Items.Count <= 0) { return(FocusBSOResult.NotFocusable); } VBTabItem vbTabItem = DockingManager.vbDockingPanelTabbedDoc_TabControl.SelectedItem as VBTabItem; VBDesign vbDesign = VBLogicalTreeHelper.FindChildObject(vbTabItem, typeof(VBDesign)) as VBDesign; if (vbDesign != null && vbDesign.BSOACComponent == bso) { return(FocusBSOResult.AlreadyFocused); } VBTabItem tabitem2Select = null; foreach (var tabitem in DockingManager.vbDockingPanelTabbedDoc_TabControl.Items) { vbTabItem = tabitem as VBTabItem; if (vbTabItem != null) { vbDesign = VBLogicalTreeHelper.FindChildObject(vbTabItem, typeof(VBDesign)) as VBDesign; if (vbDesign != null && vbDesign.BSOACComponent == bso) { tabitem2Select = vbTabItem; break; } } } if (tabitem2Select != null) { DockingManager.vbDockingPanelTabbedDoc_TabControl.SelectedItem = tabitem2Select; return(FocusBSOResult.SelectionSwitched); } return(FocusBSOResult.NotFocusable); }