/// <summary> /// Shows SmartPart using the given <see cref="ISmartPartInfo"/>. /// </summary> /// <exception cref="ArgumentException">The smartPart cannot be /// assigned to TSmartPart.</exception> /// <remarks> /// If the smartPart was previously shown, /// <see cref="ApplySmartPartInfo"/> and <see cref="Activate"/> will be called. /// Otherwise, <see cref="OnShow"/> is called. /// </remarks> public void Show(object smartPart, ISmartPartInfo smartPartInfo) { Guard.ArgumentNotNull(smartPart, "smartPart"); Guard.ArgumentNotNull(smartPartInfo, "smartPartInfo"); ThrowIfUnsupportedSP(smartPart); TSmartPartInfo typedInfo = GetSupportedSPI(smartPartInfo); TSmartPart typedSmartPart = (TSmartPart)smartPart; if (smartParts.Contains(typedSmartPart)) { ApplySmartPartInfo(smartPart, smartPartInfo); Activate(smartPart); } else { smartParts.Add(typedSmartPart); OnShow(typedSmartPart, typedInfo); } }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { Control ctrl = smartPart as Control; if (ctrl != null && _deckWorkspace.SmartParts.Contains(ctrl) == false) { IconSmartPartInfo info = smartPartInfo as IconSmartPartInfo; if (info == null) { info = nullSmartPartInfo; } ToolStripButton item = new ToolStripButton(info.Title, info.Icon.ToBitmap()); item.ToolTipText = info.Description; item.Tag = smartPart; _toolStrip.Items.Add(item); _smartParts.Add(smartPart, item); } _deckWorkspace.Show(smartPart, smartPartInfo); OnSmartPartActivated(smartPart); }
/// <summary> /// Shows SmartPart using the given <see cref="ISmartPartInfo"/>. /// </summary> /// <exception cref="ArgumentException">The smartPart cannot be /// assigned to TSmartPart.</exception> /// <remarks> /// If the smartPart was previously shown, /// <see cref="ApplySmartPartInfo"/> and <see cref="Activate"/> will be called. /// Otherwise, <see cref="OnShow"/> is called. /// </remarks> public bool Show(object smartPart, ISmartPartInfo smartPartInfo) { Guard.ArgumentNotNull(smartPart, "smartPart"); Guard.ArgumentNotNull(smartPartInfo, "smartPartInfo"); ThrowIfUnsupportedSP(smartPart); TSmartPartInfo typedInfo = GetSupportedSPI(smartPartInfo); TSmartPart typedSmartPart = (TSmartPart)smartPart; if (smartParts.Contains(typedSmartPart)) { ApplySmartPartInfo(smartPart, smartPartInfo); return(Activate(smartPart)); } else { WorkspaceCancelEventArgs e = RaiseSmartPartActivating(smartPart); if (e.Cancel) { return(false); } smartParts.Add(typedSmartPart); _suppressSmartPartActivating = true; try { OnShow(typedSmartPart, typedInfo); } finally { _suppressSmartPartActivating = false; } return(true); } }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { if (this.Content == smartPart) { if (smartPart is FrameworkElement) { (smartPart as FrameworkElement).Visibility = Visibility.Visible; } if (this.Content != smartPart) { children.Add(smartPart as UIElement); activeSmartPartInfo = smartPartInfo; Activate(smartPart); } } else { children.Add(smartPart as UIElement); activeSmartPartInfo = smartPartInfo; Activate(smartPart); } }
public void SaveUserSettings(DashboardSettingsRepository settings) { if (!_settingsSaved) { if (_presenter.Settings == null) { settings.ActivationLinks.Clear(); int count = 0; foreach (DocumentWindow document in dashboardWorkspace.DocumentWindows) { document.Name = string.Format("Window{0}", count); count++; ISmartPartInfoProvider provider = document.Content as ISmartPartInfoProvider; if (provider != null) { ISmartPartInfo info = provider.GetSmartPartInfo(typeof(ShellSmartPartInfo)); ShellSmartPartInfo shellSmartPartInfo = info as ShellSmartPartInfo; if (shellSmartPartInfo != null && shellSmartPartInfo.Hyperlink != null) { settings.ActivationLinks.Add(shellSmartPartInfo.Hyperlink); } } } DockSiteLayoutSerializer serializer = new DockSiteLayoutSerializer(); serializer.SerializationBehavior = DockSiteSerializationBehavior.All; settings.Layout = serializer.SaveToString(dashboardWorkspace); } _settingsSaved = true; } }
/// <summary> /// Shows SmartPart using the given <see cref="ISmartPartInfo"/>. /// </summary> /// <exception cref="ArgumentException">The smartPart cannot be /// assigned to TSmartPart.</exception> /// <remarks> /// If the smartPart was previously shown, /// <see cref="ApplySmartPartInfo"/> and <see cref="Activate"/> will be called. /// Otherwise, <see cref="OnShow"/> is called. /// </remarks> public void Show(object smartPart, ISmartPartInfo smartPartInfo) { //Guard.ArgumentNotNull(smartPart, "smartPart"); //Guard.ArgumentNotNull(smartPartInfo, "smartPartInfo"); if (smartPart is UIElement) { smartPart = elementHosts.Wrap(smartPart as UIElement); } ThrowIfUnsupportedSP(smartPart); TSmartPartInfo typedInfo = GetSupportedSPI(smartPartInfo); var typedSmartPart = (TSmartPart)smartPart; if (smartParts.Contains(typedSmartPart)) { ApplySmartPartInfo(smartPart, smartPartInfo); Activate(smartPart); } else { smartParts.Add(typedSmartPart); OnShow(typedSmartPart, typedInfo); } }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { }
/// <summary> /// Shows the given smartpart in a workspace with the /// given smartpartinfo which provides additional information. /// </summary> /// <param name="smartPart"></param> /// <param name="smartPartInfo"></param> public void Show(object smartPart, ISmartPartInfo smartPartInfo) { this.customersDeckedWorkspace.Show(smartPart, smartPartInfo); }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { GetWorkspace(_shellModuleService.ActiveModule).Show(smartPart, smartPartInfo); }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { composer.Show(smartPart, smartPartInfo); }
public SmartPartInfo ConvertFrom(ISmartPartInfo source) { return(SmartPartInfo.ConvertTo <SmartPartInfo>(source)); }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { if ( _activeWrapper != null ) Close(_activeSmartPart); bool resizable = false; if (smartPartInfo is WindowSmartPartInfo) resizable = ((WindowSmartPartInfo)smartPartInfo).Resizable; Show(smartPart, smartPartInfo.Title, resizable); }
/// <summary> /// Converts a smart part information to a compatible one for the workspace. /// </summary> protected virtual ZoneSmartPartInfo OnConvertFrom(ISmartPartInfo source) { return(WPFSmartPartInfo.ConvertTo <ZoneSmartPartInfo>(source)); }
/// <summary> /// Converts a smart part information to a compatible one for the workspace. /// </summary> protected virtual XtraTabSmartPartInfo ConvertFrom(ISmartPartInfo source) { return(SmartPartInfo.ConvertTo <XtraTabSmartPartInfo>(source)); }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { smartParts.Add(smartPart); ShownSmartPart = smartPart; }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { _deckWorkspace.ApplySmartPartInfo(smartPart, smartPartInfo); }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { dashboardWorkspace.Show(smartPart, smartPartInfo); dashboardWorkspace.DocumentWindows[dashboardWorkspace.DocumentWindows.Count - 1].MoveToNewHorizontalContainer(); }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { dashboardWorkspace.ApplySmartPartInfo(smartPart, smartPartInfo); }
public void Show(object smartPart, ISmartPartInfo smartPartInfo) { dialogWorkspace.Show(smartPart, smartPartInfo); }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { GetWorkspace(_module).ApplySmartPartInfo(smartPart, smartPartInfo); }
public bool Show(object smartPart, ISmartPartInfo smartPartInfo) { return(_composer.Show(smartPart, smartPartInfo)); }
/// <summary> /// See <see cref="IComposableWorkspace{TSmartPart, TSmartPartInfo}.ConvertFrom"/> for more information. /// </summary> XtraNavBarGroupSmartPartInfo IComposableWorkspace <Control, XtraNavBarGroupSmartPartInfo> .ConvertFrom(ISmartPartInfo source) { return(OnConvertFrom(source)); }
/// <summary> /// By default uses the conversion implemented in <see cref="WPFSmartPartInfo.ConvertTo{TSmartPartInfo}"/>. /// A derived class can implement a different conversion scheme. /// </summary> protected virtual TSmartPartInfo ConvertFrom(ISmartPartInfo source) { return(WPFSmartPartInfo.ConvertTo <TSmartPartInfo>(source)); }
/// <summary> /// Shows the smart part within the workspace using the specified smart part info. /// </summary> /// <param name="smartPart">Smart part that should be displayed</param> /// <param name="smartPartInfo">Smart part info to applied to the smart part</param> public void Show(object smartPart, ISmartPartInfo smartPartInfo) { ((Control)smartPart).Dock = DockStyle.Fill; composer.Show(smartPart, smartPartInfo); }
/// <summary> /// See <see cref="IComposableWorkspace{TSmartPart, TSmartPartInfo}.ConvertFrom"/> for more information. /// </summary> XtraTabSmartPartInfo IComposableWorkspace <Control, XtraTabSmartPartInfo> .ConvertFrom(ISmartPartInfo source) { return(SmartPartInfo.ConvertTo <XtraTabSmartPartInfo>(source)); }
/// <summary> /// Converts a smart part information to a compatible one for the workspace. /// </summary> protected virtual SmartPartInfo OnConvertFrom(ISmartPartInfo source) { return(SmartPartInfo.ConvertTo <SmartPartInfo>(source)); }
/// <summary> /// See <see cref="IComposableWorkspace{TSmartPart, TSmartPartInfo}.ConvertFrom"/> for more information. /// </summary> ZoneSmartPartInfo IComposableWorkspace <Control, ZoneSmartPartInfo> .ConvertFrom(ISmartPartInfo source) { return(OnConvertFrom(source)); }
public MockSPProvider(ISmartPartInfo spi) { this.spi = spi; }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { if ( _activeWrapper != null && _activeWrapper.Form != null ) _activeWrapper.Form.Text = smartPartInfo.Title; }
protected override MockSPI ConvertFrom(ISmartPartInfo source) { ConvertCalls++; return(base.ConvertFrom(source)); }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { composer.ApplySmartPartInfo(smartPart, smartPartInfo); }
/// <summary> /// Shows the view in workspace. /// </summary> /// <typeparam name="TView">The type of the view.</typeparam> /// <param name="viewId">The view id.</param> /// <param name="workspaceName">Name of the workspace.</param> /// <param name="spi">The spi.</param> /// <returns></returns> public virtual TView ShowViewInWorkspace <TView>(string viewId, string workspaceName, ISmartPartInfo spi) { TView view = default(TView); if (WorkItem.SmartParts.Contains(viewId)) { view = WorkItem.SmartParts.Get <TView>(viewId); } else { view = WorkItem.SmartParts.AddNew <TView>(viewId); } IWorkspace wp = WorkItem.Workspaces.Get(workspaceName); if (wp != null) { wp.Show(view, spi); } return(view); }
/// <summary> /// Calls <see cref="IComposableWorkspace{TSmartPart, TSmartPartInfo}.ConvertFrom"/> /// on the composed workspace. /// </summary> protected override TSmartPartInfo ConvertFrom(ISmartPartInfo source) { return(composedWorkspace.ConvertFrom(source)); }
public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo) { throw new Exception("The method or operation is not implemented."); }