コード例 #1
0
            // Callback for the narrow format
            public void FormatNarrow()
            {
                SampleControl ctrl = (SampleControl)_parent.Component;

                // Create the callback
                TransactedChangeCallback toCall = new TransactedChangeCallback(DoFormat);

                // Create the transacted change in the control
                ControlDesigner.InvokeTransactedChange(ctrl, toCall, "FormatNarrow", "Use a narrow format");
            }
コード例 #2
0
        internal static void SetRenderOuterTable(bool value, ControlDesigner designer, bool isFormView)
        {
            TransactedChangeCallback callback = null;
            IComponent component             = designer.Component;
            IRenderOuterTableControl control = (IRenderOuterTableControl)component;

            if (value != control.RenderOuterTable)
            {
                if (!value && IsAnyPropertyOnOuterTableChanged(component, isFormView))
                {
                    if (UIServiceHelper.ShowMessage(component.Site, System.Design.SR.GetString("RenderOuterTable_RemoveOuterTableWarning"), System.Design.SR.GetString("RenderOuterTable_RemoveOuterTableCaption", new object[] { control.GetType().Name, control.ID }), MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        return;
                    }
                    if (callback == null)
                    {
                        callback = delegate(object context) {
                            try
                            {
                                PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(component);
                                string[] strArray = isFormView ? formViewStylePropertiesOnOuterTable : loginStylePropertiesOnOuterTable;
                                if (isFormView)
                                {
                                    ((FormView)control).ControlStyle.Reset();
                                }
                                foreach (string str in strArray)
                                {
                                    properties[str].ResetValue(component);
                                }
                                return(true);
                            }
                            catch (Exception)
                            {
                                return(false);
                            }
                        };
                    }
                    ControlDesigner.InvokeTransactedChange(component, callback, null, System.Design.SR.GetString("RenderOuterTableHelper_ResetProperties"));
                }
                control.RenderOuterTable = value;
                TypeDescriptor.Refresh(component);
            }
        }
コード例 #3
0
ファイル: ControlDesigner.cs プロジェクト: pmq20/mono_forked
 public static void InvokeTransactedChange(IServiceProvider serviceProvider, IComponent component, TransactedChangeCallback callback, object context, string description, MemberDescriptor member)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
ファイル: ControlDesigner.cs プロジェクト: pmq20/mono_forked
 public static void InvokeTransactedChange(IComponent component, TransactedChangeCallback callback, object context, string description)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
ファイル: ControlDesigner.cs プロジェクト: nlhepler/mono
		public static void InvokeTransactedChange (IServiceProvider serviceProvider, IComponent component, TransactedChangeCallback callback, object context, string description, MemberDescriptor member)
		{
			throw new NotImplementedException ();
		}
コード例 #6
0
ファイル: ControlDesigner.cs プロジェクト: nlhepler/mono
		public static void InvokeTransactedChange (IComponent component, TransactedChangeCallback callback, object context, string description)
		{
			throw new NotImplementedException ();
		}
コード例 #7
0
 public static void InvokeTransactedChange(System.IServiceProvider serviceProvider, System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description, System.ComponentModel.MemberDescriptor member)
 {
 }
コード例 #8
0
 public static void InvokeTransactedChange(System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description)
 {
 }
コード例 #9
0
	public static void InvokeTransactedChange(System.IServiceProvider serviceProvider, System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description, System.ComponentModel.MemberDescriptor member) {}
コード例 #10
0
	public static void InvokeTransactedChange(System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description) {}
コード例 #11
0
ファイル: TabViewDesigner.cs プロジェクト: Confirmit/Portal
            // Create a set of transacted callback methods
            // Callback for the wide format
            public void CreateTabPage()
            {
                TabsView tabView = (TabsView)_parent.Component;

                // Create the callback
                TransactedChangeCallback toCall = new TransactedChangeCallback(AddTabPage);
                // Create the transacted change in the control
                ControlDesigner.InvokeTransactedChange(tabView, toCall, null, "Add Tab Page");
            }
コード例 #12
0
 public static void InvokeTransactedChange(IServiceProvider serviceProvider, IComponent component, TransactedChangeCallback callback, object context, string description, MemberDescriptor member)
 {
     if (component == null)
     {
         throw new ArgumentNullException("component");
     }
     if (callback == null)
     {
         throw new ArgumentNullException("callback");
     }
     if (serviceProvider == null)
     {
         throw new ArgumentException(System.Design.SR.GetString("ControlDesigner_TransactedChangeRequiresServiceProvider"), "serviceProvider");
     }
     IDesignerHost host = (IDesignerHost) serviceProvider.GetService(typeof(IDesignerHost));
     using (DesignerTransaction transaction = host.CreateTransaction(description))
     {
         IComponentChangeService service = (IComponentChangeService) serviceProvider.GetService(typeof(IComponentChangeService));
         if (service != null)
         {
             try
             {
                 service.OnComponentChanging(component, member);
             }
             catch (CheckoutException exception)
             {
                 if (exception != CheckoutException.Canceled)
                 {
                     throw exception;
                 }
                 return;
             }
         }
         ControlDesigner designer = host.GetDesigner(component) as ControlDesigner;
         bool flag = false;
         try
         {
             if (designer != null)
             {
                 designer.IgnoreComponentChanges(true);
             }
             if (callback(context))
             {
                 if (designer != null)
                 {
                     flag = true;
                     designer.IgnoreComponentChanges(false);
                 }
                 if (service != null)
                 {
                     service.OnComponentChanged(component, member, null, null);
                 }
                 TypeDescriptor.Refresh(component);
                 transaction.Commit();
             }
         }
         finally
         {
             if ((designer != null) && !flag)
             {
                 designer.IgnoreComponentChanges(false);
             }
         }
     }
 }
コード例 #13
0
 public static void InvokeTransactedChange(IComponent component, TransactedChangeCallback callback, object context, string description, MemberDescriptor member)
 {
     if (component == null)
     {
         throw new ArgumentNullException("component");
     }
     InvokeTransactedChange(component.Site, component, callback, context, description, member);
 }
コード例 #14
0
 public static void InvokeTransactedChange(IComponent component, TransactedChangeCallback callback, object context, string description)
 {
     InvokeTransactedChange(component, callback, context, description, null);
 }