public bool RemovePlugin(IViewPlugin viewPlugin) { _allControl.Content = _allControl.Content == viewPlugin ? null : _allControl.Content; _rightControl.Content = _rightControl.Content == viewPlugin ? null : _rightControl.Content; _centerControl.Content = _centerControl.Content == viewPlugin ? null : _centerControl.Content; _leftControl.Content = _leftControl.Content == viewPlugin ? null : _leftControl.Content; return(Empty()); }
public void AttachPlugin(IViewPlugin viewPlugin) { if (!_anchorsByZindex.ContainsKey(viewPlugin.Layer)) { _anchorsByZindex[viewPlugin.Layer] = new Anchor(viewPlugin.Layer); RootElement.Children.Add(_anchorsByZindex[viewPlugin.Layer].RootElement); } _anchorsByZindex[viewPlugin.Layer].AttachPlugin(viewPlugin, viewPlugin.Position); }
private void NewView(PluginInfo pluginInfo) { IViewPlugin plugin = WorkflowManager.Instance.GetViewPlugin(pluginInfo.Class); WorkFlowView view = plugin.CreateView(); view.Instance = plugin; view.PluginInfo = pluginInfo; view.Name = pluginInfo.Name; view.Parent = CurrentWorkFlow; CurrentWorkFlow.Views.Add(view); SelectedView = view; }
public void CreateTabFor(string header, ImageSource icon, bool allowDelete, IViewPlugin viewPlugin, UIElement viewElement, object dataInstance, WellKnownView view, bool select) { // If allowdelete = false, we also hide the header var newTab = new TabItem { Header = header, Icon = icon, AllowDelete = allowDelete, ShowHeader = allowDelete, Tag = viewPlugin, WellKnownView = view }; if (viewElement != null) { newTab.Content = viewElement; } if (newTab.Content is IControllableTab) { IControllableTab tab = (IControllableTab)newTab.Content; // Create a textblock and bind it to the header property of the tab slave TextBlock tb = new TextBlock(); tb.SetBinding(TextBlock.TextProperty, new Binding("Title") { Source = tab }); newTab.Header = tb; // Attach the RequestCloseTab event tab.RequestCloseTab += delegate { TabHost.RemoveItem(newTab); }; TabHost.HeaderContent = tab.CustomHeaderContent; } if (newTab.Content is IPersistableTab) { Debug.Assert(dataInstance != null, "Data instance can not be null"); IPersistableTab tab = (IPersistableTab)newTab.Content; tab.LoadData(dataInstance); } TabHost.Items.Add(newTab); if (select) { TabHost.SelectedItem = newTab; } }
public void AttachPlugin(IViewPlugin viewPlugin, Position position) { switch (position) { case Position.All: if (_allControl.Content != viewPlugin) { _allControl.Content = viewPlugin; } break; case Position.Center: if (_centerControl.Content != viewPlugin) { _centerControl.Content = viewPlugin; } break; case Position.Left: if (_leftControl.Content != viewPlugin) { _leftControl.Content = viewPlugin; _leftSplitter.Visibility = Visibility.Visible; } break; case Position.Right: if (_rightControl.Content != viewPlugin) { _rightControl.Content = viewPlugin; _rightSplitter.Visibility = Visibility.Visible; _divisedGrid.ColumnDefinitions[4].Width = new GridLength(250); } break; } }
public void AttachPlugin(IViewPlugin viewPlugin, Position position) { switch (position) { case Position.All: if (_allControl.Content != viewPlugin) _allControl.Content = viewPlugin; break; case Position.Center: if (_centerControl.Content != viewPlugin) _centerControl.Content = viewPlugin; break; case Position.Left: if (_leftControl.Content != viewPlugin) { _leftControl.Content = viewPlugin; _leftSplitter.Visibility = Visibility.Visible; } break; case Position.Right: if (_rightControl.Content != viewPlugin) { _rightControl.Content = viewPlugin; _rightSplitter.Visibility = Visibility.Visible; _divisedGrid.ColumnDefinitions[4].Width = new GridLength(250); } break; } }
public void CreateTabFor(string header, ImageSource icon, bool allowDelete, IViewPlugin viewPlugin, UIElement viewElement, object dataInstance, WellKnownView view, bool select) { // If allowdelete = false, we also hide the header var newTab = new TabItem { Header = header, Icon = icon, AllowDelete = allowDelete, ShowHeader = allowDelete, Tag = viewPlugin, WellKnownView = view }; if (viewElement != null) { newTab.Content = viewElement; } if (newTab.Content is IControllableTab) { IControllableTab tab = (IControllableTab) newTab.Content; // Create a textblock and bind it to the header property of the tab slave TextBlock tb = new TextBlock(); tb.SetBinding(TextBlock.TextProperty, new Binding("Title") { Source = tab }); newTab.Header = tb; // Attach the RequestCloseTab event tab.RequestCloseTab += delegate { TabHost.RemoveItem(newTab); }; TabHost.HeaderContent = tab.CustomHeaderContent; } if (newTab.Content is IPersistableTab) { Debug.Assert(dataInstance != null, "Data instance can not be null"); IPersistableTab tab = (IPersistableTab) newTab.Content; tab.LoadData(dataInstance); } TabHost.Items.Add(newTab); if (select) TabHost.SelectedItem = newTab; }
internal void ResetSpecialView() { if (fileView.Alignment != ListViewAlignment.Top) fileView.Alignment = ListViewAlignment.Top; SpecialViewPanel.Controls.Clear(); SpecialViewPanelVisible = false; currentViewPlugin = null; }
public void RemovePlugin(IViewPlugin viewPlugin) { _viewAnchorer.DesattachPlugin(viewPlugin); }
public void PutPluginOnTop(IViewPlugin viewPlugin) { _viewAnchorer.PutPluginOnTop(viewPlugin); }
public bool RemovePlugin(IViewPlugin viewPlugin) { _allControl.Content = _allControl.Content == viewPlugin ? null : _allControl.Content; _rightControl.Content = _rightControl.Content == viewPlugin ? null : _rightControl.Content; _centerControl.Content = _centerControl.Content == viewPlugin ? null : _centerControl.Content; _leftControl.Content = _leftControl.Content == viewPlugin ? null : _leftControl.Content; return Empty(); }
public void DesattachPlugin(IViewPlugin viewPlugin) { foreach (var kv in _anchorsByZindex.Where(kv => kv.Value.RemovePlugin(viewPlugin)).ToList()) { RootElement.Children.Remove(_anchorsByZindex[kv.Key].RootElement); _anchorsByZindex.Remove(kv.Key); } }
public void PutPluginOnTop(IViewPlugin viewPlugin) { int highest = _anchorsByZindex.Aggregate((kv, rkv) => kv.Key > rkv.Key ? kv : rkv).Key + 1; ForceAttachPlugin(viewPlugin, viewPlugin.Position, highest); }
public void ForceAttachPlugin(IViewPlugin viewPlugin, Position position, int layer) { if (!_anchorsByZindex.ContainsKey(layer)) { _anchorsByZindex[layer] = new Anchor(layer); RootElement.Children.Add(_anchorsByZindex[layer].RootElement); } _anchorsByZindex[layer].AttachPlugin(viewPlugin, position); }
public void AttachPlugin(IViewPlugin viewPlugin) { _viewAnchorer.AttachPlugin(viewPlugin); }