/// <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);
        }
Example #3
0
        /// <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);
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
        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);
            }
        }
Example #7
0
 public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo)
 {
 }
Example #8
0
 /// <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);
 }
Example #10
0
 public void Show(object smartPart, ISmartPartInfo smartPartInfo)
 {
     composer.Show(smartPart, smartPartInfo);
 }
Example #11
0
 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));
 }
Example #14
0
 /// <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));
 }
Example #15
0
 public void Show(object smartPart, ISmartPartInfo smartPartInfo)
 {
     smartParts.Add(smartPart);
     ShownSmartPart = smartPart;
 }
 public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo)
 {
     _deckWorkspace.ApplySmartPartInfo(smartPart, smartPartInfo);
 }
Example #17
0
 public void Show(object smartPart, ISmartPartInfo smartPartInfo)
 {
     dashboardWorkspace.Show(smartPart, smartPartInfo);
     dashboardWorkspace.DocumentWindows[dashboardWorkspace.DocumentWindows.Count - 1].MoveToNewHorizontalContainer();
 }
Example #18
0
 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);
 }
Example #21
0
 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));
 }
Example #23
0
 /// <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);
 }
Example #25
0
 /// <summary>
 /// See <see cref="IComposableWorkspace{TSmartPart, TSmartPartInfo}.ConvertFrom"/> for more information.
 /// </summary>
 XtraTabSmartPartInfo IComposableWorkspace <Control, XtraTabSmartPartInfo> .ConvertFrom(ISmartPartInfo source)
 {
     return(SmartPartInfo.ConvertTo <XtraTabSmartPartInfo>(source));
 }
Example #26
0
 /// <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));
 }
Example #28
0
 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;
 }
Example #30
0
 protected override MockSPI ConvertFrom(ISmartPartInfo source)
 {
     ConvertCalls++;
     return(base.ConvertFrom(source));
 }
Example #31
0
 public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo)
 {
     composer.ApplySmartPartInfo(smartPart, smartPartInfo);
 }
Example #32
0
        /// <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));
 }
Example #34
0
 public void ApplySmartPartInfo(object smartPart, ISmartPartInfo smartPartInfo)
 {
     throw new Exception("The method or operation is not implemented.");
 }