예제 #1
0
        public ISmartPartInfo GetSmartPartInfo(Type smartPartInfoType)
        {
            ShellHyperlink hyperlink = null;

            if (browser.Source != null)
            {
                hyperlink = new ShellHyperlink();
                hyperlink.Data["Title"] = _title;
                hyperlink.ModuleId      = DashboardModule.ModuleId;
                hyperlink.Link          = _url;
            }

            ShellSmartPartInfo info = new ShellSmartPartInfo(_title, "", hyperlink);

            return(info);
        }
예제 #2
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;
            }
        }