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


C# IComponentChangeService.OnComponentChanging方法代码示例

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


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

示例1: OnComponentChanging

 private void OnComponentChanging(RadialMenuItem parent, IComponentChangeService cc)
 {
     if (parent == null)
     {
         if (_RadialMenu != null)
             cc.OnComponentChanging(_RadialMenu, TypeDescriptor.GetProperties(_RadialMenu)["Items"]);
         else if (_RadialMenuContainer != null)
             cc.OnComponentChanging(_RadialMenuContainer, TypeDescriptor.GetProperties(_RadialMenuContainer)["SubItems"]);
     }
     else
         cc.OnComponentChanging(parent, TypeDescriptor.GetProperties(parent)["SubItems"]);
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:12,代码来源:RadialMenuItemEditor.cs

示例2: SmartTagTransactions

		public SmartTagTransactions(string transactionname,DesignerActionList list,Control ctrl)
		{
			
			this.actionList = list;
			this.ctrl = ctrl;
			host = (IDesignerHost)this.actionList.GetService(typeof(IDesignerHost));
			this.transaction = host.CreateTransaction(transactionname);
			changeService = (IComponentChangeService)this.actionList.GetService(typeof(IComponentChangeService));
			changeService.OnComponentChanging(ctrl,null);                                                      
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:10,代码来源:SmartTagTransactions.cs

示例3: SaveGridState

 internal static void SaveGridState(DesignerTransaction dt, Grid grid, IComponentChangeService service)
 {
     service.OnComponentChanging(grid, null);
     service.OnComponentChanged(grid, null, null, null);
     dt.Commit();
 }
开发者ID:webgrid,项目名称:WebGrid,代码行数:6,代码来源:DesignTime.cs

示例4: 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

示例5: 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

示例6: ApplyOffice2007InnerPageStyle

 internal static void ApplyOffice2007InnerPageStyle(WizardPage page, IDesignerHost dh, IComponentChangeService cc)
 {
     if (cc != null) cc.OnComponentChanging(page, null);
     
     page.BackColor = Color.Transparent;
     page.Style.Reset();
     
     if (cc != null) cc.OnComponentChanged(page, null, null, null);
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:9,代码来源:WizardDesigner.cs

示例7: ApplyDefaultInnerPageStyle

        internal static void ApplyDefaultInnerPageStyle(WizardPage page, IDesignerHost dh, IComponentChangeService cc)
        {
            if (cc != null) cc.OnComponentChanging(page, null);

            page.BackColor = SystemColors.Control;
            if (!page.InteriorPage)
            {
                TypeDescriptor.GetProperties(page.Style)["BackColor"].SetValue(page.Style, Color.White);
            }
            
            if (cc != null) cc.OnComponentChanged(page, null, null, null);
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:12,代码来源:WizardDesigner.cs

示例8: ApplyOffice2007WelcomePageStyle

        internal static void ApplyOffice2007WelcomePageStyle(WizardPage page, IDesignerHost dh, IComponentChangeService cc)
        {
            DesignerTransaction dt = null;
            if (dh != null) dt = dh.CreateTransaction();
            
            try
            {
                if (cc != null) cc.OnComponentChanging(page, null);
                page.BackColor = Color.Transparent;
                page.Style.Reset();
                //page.BackColor = ColorScheme.GetColor(0xBBDBF7);
                //page.CanvasColor = page.BackColor;
                //page.Style.BackColor = Color.Empty;
                //page.Style.BackColor2 = Color.Empty;
                //page.Style.BackColorBlend.Clear();
                //page.Style.BackColorBlend.AddRange(new BackgroundColorBlend[] {
                //new BackgroundColorBlend(ColorScheme.GetColor(0xBBDBF7), 0f),
                //new BackgroundColorBlend(ColorScheme.GetColor(0xBBDBF7), .3f),
                //new BackgroundColorBlend(ColorScheme.GetColor(0xF3F9FE), .9f),
                //new BackgroundColorBlend(ColorScheme.GetColor(0xFEFFFF), 1f)});
                //page.Style.BackColorGradientAngle = 90;
                //page.Style.BackgroundImage = GetWelcomeImage(eWizardImages.BackgroundOffice2007);
                //page.Style.BackgroundImagePosition = eStyleBackgroundImage.TopLeft;

                if (cc != null) cc.OnComponentChanged(page, null, null, null);
            }
            catch
            {
                dt.Cancel();
                throw;
            }
            finally
            {
                if (dt != null && !dt.Canceled)
                    dt.Commit();
            }
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:37,代码来源:WizardDesigner.cs

示例9: DeletePage

        internal static void DeletePage(WizardPage page, IDesignerHost dh, IComponentChangeService cc)
        {
            if (page == null || !(page.Parent is Wizard))
                return;

            Wizard w = page.Parent as Wizard;

            DesignerTransaction dt = dh.CreateTransaction();

            try
            {
                if (cc != null)
                    cc.OnComponentChanging(w, TypeDescriptor.GetProperties(w)["WizardPages"]);

                w.WizardPages.Remove(page);

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

                dh.DestroyComponent(page);
            }
            catch
            {
                dt.Cancel();
            }
            finally
            {
                if (!dt.Canceled)
                    dt.Commit();
            }
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:31,代码来源:WizardDesigner.cs

示例10: 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

示例11: DeletePage

        internal static void DeletePage(WizardPage page, IDesignerHost dh, IComponentChangeService cc)
        {
            if (page == null || !(page.Parent is PageSlider))
                return;

            PageSlider slider = (PageSlider)page.Parent;

            DesignerTransaction dt = dh.CreateTransaction("Deleting page");

            try
            {
                if (cc != null)
                    cc.OnComponentChanging(slider, TypeDescriptor.GetProperties(slider)["Controls"]);

                slider.Controls.Remove(page);

                if (cc != null)
                    cc.OnComponentChanged(slider, TypeDescriptor.GetProperties(slider)["Controls"], null, null);

                dh.DestroyComponent(page);
            }
            catch
            {
                dt.Cancel();
            }
            finally
            {
                if (!dt.Canceled)
                    dt.Commit();
            }
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:31,代码来源:PageSliderDesigner.cs

示例12: 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


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