当前位置: 首页>>代码示例>>C#>>正文


C# ISelectionService.SetSelectedComponents方法代码示例

本文整理汇总了C#中ISelectionService.SetSelectedComponents方法的典型用法代码示例。如果您正苦于以下问题:C# ISelectionService.SetSelectedComponents方法的具体用法?C# ISelectionService.SetSelectedComponents怎么用?C# ISelectionService.SetSelectedComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISelectionService的用法示例。


在下文中一共展示了ISelectionService.SetSelectedComponents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectItems

 private void SelectItems(ToolStripDropDownItem oldSelection, ISelectionService selSvc)
 {
     ToolStripDropDown owner = (ToolStripDropDown) this.MenuItem.Owner;
     int num = Math.Max(owner.Items.IndexOf(oldSelection), owner.Items.IndexOf(this.MenuItem));
     int num2 = Math.Min(owner.Items.IndexOf(oldSelection), owner.Items.IndexOf(this.MenuItem));
     ToolStripItem[] components = new ToolStripItem[(num - num2) + 1];
     int index = 0;
     while (num2 <= num)
     {
         components[index] = owner.Items[num2];
         index++;
         num2++;
     }
     selSvc.SetSelectedComponents(components);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:ToolStripMenuItemDesigner.cs

示例2: CreatePage

        internal static WizardPage CreatePage(Wizard parent, bool innerPage, IDesignerHost dh, IComponentChangeService cc, ISelectionService ss, eWizardStyle wizardStyle)
        {
            DesignerTransaction dt = dh.CreateTransaction();
            WizardPage page=null;
            try
            {
                page = dh.CreateComponent(typeof(WizardPage)) as WizardPage;
				
				page.AntiAlias=false;
                page.InteriorPage = innerPage;
                if (innerPage)
                {
                    page.PageTitle = "< Wizard step title >";
                    page.PageDescription = "< Wizard step description >";
                }
                if (wizardStyle == eWizardStyle.Default)
                    ApplyDefaultInnerPageStyle(page, dh, cc);
                else if (wizardStyle == eWizardStyle.Office2007)
                    ApplyOffice2007InnerPageStyle(page, dh, cc);
                //else
                //{
                //    TypeDescriptor.GetProperties(page.Style)["BackColor"].SetValue(page.Style, Color.White);
                //}

                if (cc != null)
                    cc.OnComponentChanging(parent, TypeDescriptor.GetProperties(parent)["WizardPages"]);
                parent.WizardPages.Add(page);
                if (cc != null)
                    cc.OnComponentChanged(parent, TypeDescriptor.GetProperties(parent)["WizardPages"], null, null);

                if (ss != null)
                    ss.SetSelectedComponents(new WizardPage[] { page }, SelectionTypes.Replace);

                TypeDescriptor.GetProperties(parent)["SelectedPageIndex"].SetValue(parent, parent.WizardPages.IndexOf(page));
            }
            catch
            {
                dt.Cancel();
            }
            finally
            {
                if (!dt.Canceled)
                    dt.Commit();
            }

            return page;
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:47,代码来源:WizardDesigner.cs

示例3: CreateWelcomePage

        internal static WizardPage CreateWelcomePage(Wizard parent, IDesignerHost dh, IComponentChangeService cc, ISelectionService ss, eWizardStyle style)
        {
            DesignerTransaction dt = dh.CreateTransaction();
            WizardPage page = null;
            try
            {
                page = dh.CreateComponent(typeof(WizardPage)) as WizardPage;

                if(style == eWizardStyle.Default)
                    ApplyDefaultWelcomePageStyle(page, null, null);
                else
                    ApplyOffice2007WelcomePageStyle(page, null, null);
                //TypeDescriptor.GetProperties(page)["InteriorPage"].SetValue(page, false);
                //TypeDescriptor.GetProperties(page)["BackColor"].SetValue(page, Color.White);
                //TypeDescriptor.GetProperties(page)["CanvasColor"].SetValue(page, Color.White);
                //TypeDescriptor.GetProperties(page.Style)["BackColor"].SetValue(page.Style, Color.White);
                //TypeDescriptor.GetProperties(page.Style)["BackgroundImage"].SetValue(page.Style, GetWelcomeImage(false));
                //TypeDescriptor.GetProperties(page.Style)["BackgroundImagePosition"].SetValue(page.Style, eStyleBackgroundImage.TopLeft);
                page.Size = new Size(534, 289);

                // Load labels onto the page, first Welcome to the Wizard...
                System.Windows.Forms.Label label = dh.CreateComponent(typeof(System.Windows.Forms.Label)) as System.Windows.Forms.Label;
                page.Controls.Add(label);
                label.Location = new Point(210, 18);
                label.Text = "Welcome to the <Wizard Name> Wizard";
                label.BackColor = Color.Transparent;
                try
                {
                    label.Font = new Font("Tahoma", 16);
                    TypeDescriptor.GetProperties(label)["AutoSize"].SetValue(label, false);
                }
                catch { }
                label.Size = new Size(310, 66);
                label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;

                // Wizard description label...
                label = dh.CreateComponent(typeof(System.Windows.Forms.Label)) as System.Windows.Forms.Label;
                page.Controls.Add(label);
                label.Location = new Point(210, 100);
                label.Text = "This wizard will guide you through the <Enter Process Name>.\r\n\r\n<Enter brief description of the process wizard is covering.>";
                label.BackColor = Color.Transparent;
                try
                {
                    TypeDescriptor.GetProperties(label)["AutoSize"].SetValue(label, false);
                }
                catch { }
                label.Size = new Size(309, 157);
                label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;

                // Click Next to Continue label...
                label = dh.CreateComponent(typeof(System.Windows.Forms.Label)) as System.Windows.Forms.Label;
                page.Controls.Add(label);
                label.Location = new Point(210, 266);
                label.Text = "To continue, click Next.";
                label.Size = new Size(120, 13);
                label.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
                label.BackColor = Color.Transparent;
                
                if (cc != null)
                    cc.OnComponentChanging(parent, TypeDescriptor.GetProperties(parent)["WizardPages"]);
                parent.WizardPages.Add(page);
                if (cc != null)
                    cc.OnComponentChanged(parent, TypeDescriptor.GetProperties(parent)["WizardPages"], null, null);


                if (ss != null)
                    ss.SetSelectedComponents(new WizardPage[] { page }, SelectionTypes.Replace);

                TypeDescriptor.GetProperties(parent)["SelectedPageIndex"].SetValue(parent, parent.WizardPages.IndexOf(page));
            }
            catch
            {
                dt.Cancel();
            }
            finally
            {
                if (!dt.Canceled)
                    dt.Commit();
            }

            return page;
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:82,代码来源:WizardDesigner.cs

示例4: GotoPage

        internal static void GotoPage(Wizard w, IComponentChangeService cc, ISelectionService ss)
        {
            if (w == null)
                return;

            WizardPageOrderDialog d = new WizardPageOrderDialog();
            d.SetWizard(w);
            d.StartPosition = FormStartPosition.CenterScreen;
            if (d.ShowDialog() == DialogResult.OK)
            {
                string pageName = d.SelectedPageName;
                
                if (d.OrderChanged)
                {
                    if (cc != null)
                        cc.OnComponentChanging(w, TypeDescriptor.GetProperties(w)["WizardPages"]);

                    string[] newOrder = d.OrderedPageNames;
                    w.WizardPages.IgnoreEvents = true;
                    try
                    {
                        WizardPageCollection col = new WizardPageCollection();
                        w.WizardPages.CopyTo(col);
                        w.WizardPages.Clear();
                        foreach (string pn in newOrder)
                            w.WizardPages.Add(col[pn]);
                    }
                    finally
                    {
                        w.WizardPages.IgnoreEvents = false;
                    }

                    if (cc != null)
                        cc.OnComponentChanged(w, TypeDescriptor.GetProperties(w)["WizardPages"], null, null);
                }

                if (pageName != "")
                    w.SelectedPage = w.WizardPages[pageName];
                else if (d.OrderChanged)
                    w.SelectedPageIndex = 0;

                if (ss != null && (pageName!="" || d.OrderChanged))
                    ss.SetSelectedComponents(new WizardPage[] { w.SelectedPage }, SelectionTypes.Replace);
            }
            d.Dispose();
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:46,代码来源:WizardDesigner.cs

示例5: SelectPageInProperyGrid

 private void SelectPageInProperyGrid(ISelectionService selection)
 {
     selection.SetSelectedComponents(new object[] {_wizard.CurrentPage}, SelectionTypes.MouseDown);
 }
开发者ID:SteveBate,项目名称:AdvancedWizard,代码行数:4,代码来源:DesignTimeWizard.cs

示例6: CreatePage

        internal static PageSliderPage CreatePage(PageSlider parent, IDesignerHost dh, IComponentChangeService cc, ISelectionService ss)
        {
            DesignerTransaction dt = dh.CreateTransaction();
            PageSliderPage page = null;
            try
            {
                page = dh.CreateComponent(typeof(PageSliderPage)) as PageSliderPage;

                if (cc != null)
                    cc.OnComponentChanging(parent, TypeDescriptor.GetProperties(parent)["Controls"]);
                parent.Controls.Add(page);
                if (cc != null)
                    cc.OnComponentChanged(parent, TypeDescriptor.GetProperties(parent)["Controls"], null, null);

                if (ss != null)
                    ss.SetSelectedComponents(new PageSliderPage[] { page }, SelectionTypes.Replace);

                TypeDescriptor.GetProperties(parent)["SelectedPage"].SetValue(parent, page);
            }
            catch
            {
                dt.Cancel();
            }
            finally
            {
                if (!dt.Canceled)
                    dt.Commit();
            }

            return page;
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:31,代码来源:PageSliderDesigner.cs


注:本文中的ISelectionService.SetSelectedComponents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。