protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingFrame frame = null;

            if (null != tmplEditingVerbs)
            {
                ITemplateEditingService tmplEditingService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));
                if (null != tmplEditingService)
                {
                    Style style = ((TemplateMenu)Component).ControlStyle;
                    if (tmplEditingVerbs[0] == verb)
                    {
                        frame = tmplEditingService.CreateFrame(this, verb.Text, new string[] { "Header Template" }, style, null);
                    }
                    if (tmplEditingVerbs[1] == verb)
                    {
                        frame = tmplEditingService.CreateFrame(this, verb.Text, new string[] { "Separator Template" }, style, null);
                    }
                    if (tmplEditingVerbs[2] == verb)
                    {
                        frame = tmplEditingService.CreateFrame(this, verb.Text, new string[] { "Footer Template" }, style, null);
                    }
                }
            }
            return(frame);
        }
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService service = (ITemplateEditingService)this.GetService(typeof(ITemplateEditingService));
            DataList viewControl            = (DataList)base.ViewControl;

            string[] templateNames  = null;
            Style[]  templateStyles = null;
            switch (verb.Index)
            {
            case 0:
                templateNames  = ItemTemplateNames;
                templateStyles = new Style[] { viewControl.ItemStyle, viewControl.AlternatingItemStyle, viewControl.SelectedItemStyle, viewControl.EditItemStyle };
                break;

            case 1:
                templateNames  = HeaderFooterTemplateNames;
                templateStyles = new Style[] { viewControl.HeaderStyle, viewControl.FooterStyle };
                break;

            case 2:
                templateNames  = SeparatorTemplateNames;
                templateStyles = new Style[] { viewControl.SeparatorStyle };
                break;
            }
            return(service.CreateFrame(this, verb.Text, templateNames, viewControl.ControlStyle, templateStyles));
        }
Example #3
0
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingFrame frame = null;

            if ((_templateEditingVerbs != null) && ((IList)_templateEditingVerbs).Contains(verb))
            {
                ITemplateEditingService teService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

                if (teService != null)
                {
                    ListView lv             = (ListView)Component;
                    string[] templateNames  = null;
                    Style[]  templateStyles = null;

                    switch (verb.Index)
                    {
                    case HeaderFooterTemplates:
                        templateNames  = HeaderFooterTemplateNames;
                        templateStyles = new Style[] { lv.HeaderStyle, lv.FooterStyle };
                        break;

                    case ItemTemplates:
                        templateNames  = ItemTemplateNames;
                        templateStyles = new Style[] { lv.ItemStyle, lv.EditItemStyle };
                        break;
                    }
                    frame = teService.CreateFrame(this, verb.Text, templateNames, lv.ControlStyle, templateStyles);
                }
            }
            return(frame);
        }
Example #4
0
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingFrame frame = null;

            for (int i = 0; i < _templateEditingVerbs.Length; i++)
            {
                if (_templateEditingVerbs[i] == verb)
                {
                    index = i;
                }
            }

            System.Diagnostics.Debug.WriteLine(index.ToString() + ":CreateTemplateEditingFrame");

            if ((_templateEditingVerbs != null) && (index >= 0))             //(_templateEditingVerbs[0] == verb))
            {
                ITemplateEditingService teService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

                if (teService != null)
                {
                    Style style = ((WeavverTabControl)Component).ControlStyle;
                    frame = teService.CreateFrame(this, verb.Text, new string[] { "New Tab Template" }, style, null);
                }
            }
            return(frame);
        }
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService service = (ITemplateEditingService)this.GetService(typeof(ITemplateEditingService));
            DataGrid viewControl            = (DataGrid)base.ViewControl;

            Style[] templateStyles = new Style[] { viewControl.ItemStyle, viewControl.EditItemStyle, viewControl.HeaderStyle, viewControl.FooterStyle };
            return(service.CreateFrame(this, verb.Text, ColumnTemplateNames, viewControl.ControlStyle, templateStyles));
        }
        /// <include file='doc\DataGridDesigner.uex' path='docs/doc[@for="DataGridDesigner.CreateTemplateEditingFrame"]/*' />
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService teService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

            Debug.Assert(teService != null, "How did we get this far without an ITemplateEditingService");

            Style[] templateStyles = new Style[] { dataGrid.HeaderStyle, dataGrid.ItemStyle, dataGrid.AlternatingItemStyle, dataGrid.FooterStyle };

            ITemplateEditingFrame editingFrame =
                teService.CreateFrame(this, verb.Text, ColumnTemplateNames, dataGrid.ControlStyle, templateStyles);

            return(editingFrame);
        }
Example #7
0
        /// <summary>
        /// Creates a template editing frame for a specified designer verb.
        /// </summary>
        /// <param name="verb">The template editing verb to create a template editing frame for. </param>
        /// <returns>ITemplateEditingFrame-based frame instance</returns>
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService teService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

            string [] templateNames  = new string[1];
            Style[]   templateStyles = new Style[1];

            switch (verb.Index)
            {
            case 0:
                templateNames[0]  = "HeaderTemplate";
                templateStyles[0] = ((Result)Component).HeaderStyle;
                break;

            case 1:
                templateNames[0]  = "StatusTemplate";
                templateStyles[0] = ((Result)Component).StatusStyle;
                break;

            case 2:
                templateNames[0]  = "ItemTemplate";
                templateStyles[0] = ((Result)Component).ItemStyle;
                break;

            case 3:
                templateNames[0]  = "AlternatingItemTemplate";
                templateStyles[0] = ((Result)Component).AlternatingItemStyle;
                break;

            case 4:
                templateNames[0]  = "SeparatorTemplate";
                templateStyles[0] = ((Result)Component).SeparatorStyle;
                break;

            case 5:
                templateNames[0]  = "FooterTemplate";
                templateStyles[0] = ((Result)Component).FooterStyle;
                break;
            }

            ITemplateEditingFrame editingFrame =
                teService.CreateFrame(this, verb.Text, templateNames,
                                      ((Result)Component).ControlStyle, templateStyles);

            return(editingFrame);
        }
Example #8
0
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingFrame frame = null;

            if (this.templateEditingVerbs != null)
            {
                ITemplateEditingService teService = (ITemplateEditingService)this.GetService(typeof(ITemplateEditingService));

                if (teService != null)
                {
                    Style  style        = ((WebPartZone)Component).ControlStyle;
                    String templateName = verb.Text.Replace(" ", "");
                    frame = teService.CreateFrame(this, verb.Text, new string[] { templateName }, style, null);
                }
            }

            return(frame);
        }
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService teService =
                (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

            Debug.Assert(teService != null,
                         "How did we get this far without an ITemplateEditingService");

            String[] templateNames             = GetTemplateFrameNames(verb.Index);
            ITemplateEditingFrame editingFrame = teService.CreateFrame(
                this,
                TemplateDeviceFilter,
                templateNames,
                WebCtrlStyle,
                null /* we don't have template styles */);

            editingFrame.InitialWidth = _templateWidth;
            return(editingFrame);
        }
        /// <include file='doc\DataListDesigner.uex' path='docs/doc[@for="DataListDesigner.CreateTemplateEditingFrame"]/*' />
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService teService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

            Debug.Assert(teService != null, "How did we get this far without an ITemplateEditingService");

            string[] templateNames  = null;
            Style[]  templateStyles = null;

            switch (verb.Index)
            {
            case HeaderFooterTemplates:
                templateNames  = HeaderFooterTemplateNames;
                templateStyles = new Style[] { dataList.HeaderStyle, dataList.FooterStyle };
                break;

            case ItemTemplates:
                templateNames  = ItemTemplateNames;
                templateStyles = new Style[] { dataList.ItemStyle, dataList.AlternatingItemStyle, dataList.SelectedItemStyle, dataList.EditItemStyle };
                break;

            case SeparatorTemplate:
                templateNames  = SeparatorTemplateNames;
                templateStyles = new Style[] { dataList.SeparatorStyle };
                break;

            default:
                Debug.Fail("Unknown Index value on TemplateEditingVerb");
                break;
            }

            ITemplateEditingFrame editingFrame =
                teService.CreateFrame(this, verb.Text, templateNames, dataList.ControlStyle, templateStyles);

            return(editingFrame);
        }
Example #11
0
        /// <summary>
        /// Override the CreateTemplateEditingFrame method.
        /// This method takes a TemplateEditingVerb instance as an argument.
        /// TemplateEditingVerb is a designer verb (a class that derives from DesignerVerb)
        /// that enables the template editor to add a command to the control at design time.
        /// </summary>
        /// <param name="verb"></param>
        /// <returns></returns>
        protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
        {
            ITemplateEditingService teService = (ITemplateEditingService)GetService(typeof(ITemplateEditingService));

            Trace.Assert(teService != null, "How did we get this far without an ITemplateEditingService?");
            Trace.Assert(verb.Index == 0 || verb.Index == SeparatorTemplates);

            string[] templateNames = null;
            System.Web.UI.WebControls.Style[] templateStyles = null;
            ITemplateEditingFrame             editingFrame;

            System.Web.UI.WebControls.Style[] outputTemplateStyles;

            switch (verb.Index)
            {
            case PaneTemplates:
                templateNames        = DesktopPanesDesigner.PaneTemplateNames;
                outputTemplateStyles = new Style[3];
                outputTemplateStyles[IDX_LEFT_PANE_TEMPLATE]    = desktopPanes.LeftPaneStyle;
                outputTemplateStyles[IDX_CONTENT_PANE_TEMPLATE] = desktopPanes.ControlStyle;
                outputTemplateStyles[IDX_RIGHT_PANE_TEMPLATE]   = desktopPanes.RightPaneStyle;
                templateStyles = outputTemplateStyles;
                break;

            case SeparatorTemplates:
                templateNames        = DesktopPanesDesigner.SeparatorTemplateNames;
                outputTemplateStyles = new Style[2];
                outputTemplateStyles[IDX_HORIZONTAL_SEPARATOR_TEMPLATE] = desktopPanes.HorizontalSeparatorStyle;
                outputTemplateStyles[IDX_VERTICAL_SEPARATOR_TEMPLATE]   = desktopPanes.VerticalSeparatorStyle;
                templateStyles = outputTemplateStyles;
                break;
            }
            editingFrame = teService.CreateFrame(this, verb.Text, templateNames, desktopPanes.ControlStyle, templateStyles);
            //editingFrame = teService.CreateFrame(this, verb.Text, templateNames);
            return(editingFrame);
        }