Exemplo n.º 1
0
        protected void CheckActiveItem(ISidebarContext context)
        {
            string url = HttpContext.Current.Request.RawUrl;

            foreach (SidebarGroup group in context.Groups)
            {
                if (group.Items != null && group.Items.Any())
                {
                    foreach (SidebarItem item in group.Items)
                    {
                        if (item.ViewLink == url)
                        {
                            item.IsActive  = true;
                            group.IsActive = true;
                            return;
                        }
                    }
                }
                else
                {
                    if (group.ViewLink == url)
                    {
                        group.IsActive = true;
                        return;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
        {
            ContentSourceSidebarControl sidebarControl = new ContentSourceSidebarControl(sidebarContext, _context);

            _smartContentEditorCache = sidebarControl;
            return(sidebarControl);
        }
Exemplo n.º 3
0
 public ImagePropertiesSidebarHostControl(
     ISidebarContext sidebarContext,
     IHtmlEditorComponentContext editorContext,
     IBlogPostImageEditingContext imageEditingContext,
     CreateFileCallback createFileCallback)
 {
     // Instead of creating the image sidebar, we now create the manager for ribbon commands releated to image editing.
     _pictureEditingManager = new PictureEditingManager(editorContext, imageEditingContext, createFileCallback);
 }
 public ImagePropertiesSidebarHostControl(
     ISidebarContext sidebarContext,
     IHtmlEditorComponentContext editorContext,
     IBlogPostImageEditingContext imageEditingContext,
     CreateFileCallback createFileCallback)
 {
     // Instead of creating the image sidebar, we now create the manager for ribbon commands releated to image editing.
     _pictureEditingManager = new PictureEditingManager(editorContext, imageEditingContext, createFileCallback);
 }
        public ContentSourceSidebarControl(ISidebarContext sidebarContext, IContentSourceSidebarContext sourceContext)
        {
            ///
            /// Required for Windows.Forms Class Composition Designer support
            ///
            InitializeComponent();

            _contentSourceControls = new Hashtable();
            _sidebarContext = sidebarContext;
            _contentSourceContext = sourceContext;
            _contentSourceContext.ContentResized += new ContentResizedEventHandler(_contentSourceContext_ContentResized);
        }
Exemplo n.º 6
0
        public ContentSourceSidebarControl(ISidebarContext sidebarContext, IContentSourceSidebarContext sourceContext)
        {
            ///
            /// Required for Windows.Forms Class Composition Designer support
            ///
            InitializeComponent();

            _contentSourceControls = new Hashtable();
            _sidebarContext        = sidebarContext;
            _contentSourceContext  = sourceContext;
            _contentSourceContext.ContentResized += new ContentResizedEventHandler(_contentSourceContext_ContentResized);
        }
        public DefaultSidebarControl(ISidebarContext sidebarContext, IBlogPostEditingSite postEditingSite)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // record the post management context and subscribe to the post list changed event
            _postEditingSite = postEditingSite ;

            // subscribe to changes that require us to re-layout the sidebar
            _postEditingSite.WeblogChanged +=new WeblogHandler(_postEditingSite_WeblogChanged);
            _postEditingSite.WeblogSettingsChanged +=new WeblogSettingsChangedHandler(_postEditingSite_WeblogSettingsChanged);
            _postEditingSite.FrameWindow.Layout +=new LayoutEventHandler(FrameWindow_Layout);
            _postEditingSite.PostListChanged +=new EventHandler(_postEditingSite_PostListChanged);
            ContentSourceManager.GlobalContentSourceListChanged +=new EventHandler(ContentSourceManager_GlobalContentSourceListChanged);

            // add the tooltip
            _toolTip = new ToolTip2(components);
            _toolTip.InitialDelay = 750 ;

            // set the caption
            Text = ApplicationEnvironment.ProductName;
            AccessibleName = Res.Get(StringId.SidebarPanel) ;

            //	Turn on double buffered painting.
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            // initialize components
            //_weblogPanelHeader = new PanelHeader(this, WEBLOG_PANEL_CAPTION);
            // _weblogPanelBody = new PanelBody();
            // _weblogHeader = new WeblogHeader(this, _weblogPanelBody) ;
            // _viewWeblogCommand = new LinkCommand(this, _toolTip, CommandId.ViewWeblog.ToString());
            // _viewWeblogCommand.Name = "ViewWeblog";
            // _viewWeblogAdminCommand = new LinkCommand(this, _toolTip, CommandId.ViewWeblogAdmin.ToString());
            // _viewWeblogAdminCommand.Name = "ViewWeblogAdmin";

            _headerControl = new SidebarHeaderControl();

            _openPanelHeader = new PanelHeader(this, OPEN_PANEL_CAPTION) ;
            _openPanelBody = new PanelBody();
            _draftsSectionHeader = new SectionHeader(this, DRAFTS_SECTION_CAPTION, SidebarColors.FirstSectionBottomColor );
            _draftsPostList = new DraftPostList(this, _toolTip, DRAFTS_SECTION_CAPTION);
            _draftsPostList.PostSelected +=new PostEventHandler(_draftsPostList_PostSelected);
            _draftsPostList.PostDeleteRequested +=new PostEventHandler(_draftsPostList_PostDeleteRequested);
            _openDraftCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.OpenPost.png", MORE_DRAFTS_CAPTION, MORE_DRAFTS_ACCNAME, _toolTip, MORE_DRAFTS_TOOLTIP, CommandId.OpenDrafts.ToString());
            _recentPostsSectionHeader = new SectionHeader(this, RECENT_POSTS_SECTION_CAPTION, SidebarColors.SecondSectionBottomColor );
            _recentPostList = new RecentPostList(this, _toolTip, RECENT_POSTS_SECTION_CAPTION);
            _recentPostList.PostSelected +=new PostEventHandler(_recentPostList_PostSelected);
            _openPostCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.OpenPost.png", MORE_POSTS_CAPTION, MORE_POSTS_ACCNAME, _toolTip, MORE_POSTS_TOOLTIP, CommandId.OpenRecentPosts.ToString());
            _insertPanelHeader = new PanelHeader(this, INSERT_PANEL_CAPTION);
            _insertPanelBody = new PanelBody();
            _insertLinkCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.InsertLink.png", INSERT_LINK_CAPTION, INSERT_LINK_ACCNAME, _toolTip, INSERT_LINK_TOOLTIP, CommandId.InsertLink.ToString());
            _insertPictureCommand = new LinkCommand(this, "BlogThis.ItemTypes.Images.ImageItem.png", INSERT_PICTURE_CAPTION, INSERT_PICTURE_ACCNAME, _toolTip, INSERT_PICTURE_TOOLTIP, CommandId.InsertPictureFromFile.ToString());

            ContentSourceInfo csi = ContentSourceManager.GetContentSourceInfoById(PhotoAlbumContentSource.ID);
            if (csi != null)
            {
                _insertPhotoAlbumCommand = new LinkCommand(this, csi.Image,
                    String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), csi.InsertableContentSourceSidebarText),
                    String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), csi.InsertableContentSourceSidebarText),
                    _toolTip,
                    null,
                    PhotoAlbumContentSource.ID);
            }

            ContentSourceInfo csi2 = ContentSourceManager.GetContentSourceInfoById(WebImageContentSource.ID);
            if (csi2 != null)
            {
                _insertWebImage = new LinkCommand(this, csi2.Image,
                    String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), csi2.InsertableContentSourceSidebarText),
                    String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), csi2.InsertableContentSourceSidebarText),
                    _toolTip,
                    null,
                    WebImageContentSource.ID);
            }

            _insertTableCommand = new LinkCommand(this, "Tables.Commands.Images.CommandInsertTableCommandBarButtonBitmapEnabled.png", INSERT_TABLE_CAPTION, INSERT_TABLE_ACCNAME, _toolTip, INSERT_TABLE_TOOLTIP, CommandId.InsertTable.ToString());
            _contentInsertCommands = new ContentInsertCommands(this, _toolTip, LINK_COMMAND_PADDING, int.MaxValue);
            _separator2 = new SeparatorControl();

            Controls.Add(_separator2);
            Controls.Add(_headerControl);

            UpdatePostLists() ;
        }
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     return new DefaultSidebarControl(sidebarContext, _postEditingSite) ;
 }
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     return new ImagePropertiesSidebarHostControl(
         sidebarContext, _editorContext, _dataContext, _createFileCallback);
 }
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     return new MessageSidebarControl(Res.Get(StringId.PluginSidebarDisabled));
 }
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     ContentSourceSidebarControl sidebarControl = new ContentSourceSidebarControl(sidebarContext, _context);
     _smartContentEditorCache = sidebarControl;
     return sidebarControl;
 }
Exemplo n.º 12
0
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     return(new ImagePropertiesSidebarHostControl(
                sidebarContext, _editorContext, _dataContext, _createFileCallback));
 }
Exemplo n.º 13
0
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     return(new MessageSidebarControl(Res.Get(StringId.PluginSidebarDisabled)));
 }