// 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"); }
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); } }
public static void InvokeTransactedChange(IServiceProvider serviceProvider, IComponent component, TransactedChangeCallback callback, object context, string description, MemberDescriptor member) { throw new NotImplementedException(); }
public static void InvokeTransactedChange(IComponent component, TransactedChangeCallback callback, object context, string description) { throw new NotImplementedException(); }
public static void InvokeTransactedChange (IServiceProvider serviceProvider, IComponent component, TransactedChangeCallback callback, object context, string description, MemberDescriptor member) { throw new NotImplementedException (); }
public static void InvokeTransactedChange (IComponent component, TransactedChangeCallback callback, object context, string description) { throw new NotImplementedException (); }
public static void InvokeTransactedChange(System.IServiceProvider serviceProvider, System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description, System.ComponentModel.MemberDescriptor member) { }
public static void InvokeTransactedChange(System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description) { }
public static void InvokeTransactedChange(System.IServiceProvider serviceProvider, System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description, System.ComponentModel.MemberDescriptor member) {}
public static void InvokeTransactedChange(System.ComponentModel.IComponent component, TransactedChangeCallback callback, object context, string description) {}
// 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"); }
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); } } } }
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); }
public static void InvokeTransactedChange(IComponent component, TransactedChangeCallback callback, object context, string description) { InvokeTransactedChange(component, callback, context, description, null); }