protected override void OnSchemaRefreshed()
 {
     if (!base.InTemplateModeInternal)
     {
         ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.RefreshSchemaCallback), null, System.Design.SR.GetString("DataList_RefreshSchemaTransaction"));
     }
 }
            // 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");
            }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            ControlDesigner.InvokeTransactedChange(
                (IComponent)context.Instance,
                new TransactedChangeCallback(EditQueryChangeCallback),
                new Pair(context, value),
                Strings.ExpressionEditorTransactionDescription);

            return(value);
        }
 public override void Configure()
 {
     try
     {
         this.SuppressDataSourceEvents();
         ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.ConfigureDataSourceChangeCallback), null, System.Design.SR.GetString("DataSource_ConfigureTransactionDescription"));
     }
     finally
     {
         this.ResumeDataSourceEvents();
     }
 }
Exemplo n.º 5
0
        /// <summary>设置分页模版</summary>
        public void SetPagerTemplate()
        {
            Cursor current = Cursor.Current;

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                ControlDesigner.InvokeTransactedChange(base.Component, SetPagerTemplateCallback, null, "设置分页模版");
                UpdateDesignTimeHtml();
            }
            finally
            {
                Cursor.Current = current;
            }
        }
Exemplo n.º 6
0
 protected override void OnSchemaRefreshed()
 {
     if (!base.InTemplateMode)
     {
         Cursor current = Cursor.Current;
         try
         {
             Cursor.Current = Cursors.WaitCursor;
             ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.SchemaRefreshedCallback), null, "Refresh Schema");
             this.UpdateDesignTimeHtml();
         }
         finally
         {
             Cursor.Current = current;
         }
     }
 }
        private void EditRoleGroups()
        {
            PropertyDescriptor context = TypeDescriptor.GetProperties(base.Component)["RoleGroups"];

            ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.EditRoleGroupsChangeCallback), context, System.Design.SR.GetString("LoginView_EditRoleGroupsTransactionDescription"), context);
            int num = this._loginView.RoleGroups.Count + 2;

            if (this.CurrentView >= num)
            {
                this.CurrentView = num - 1;
            }
            if (this.CurrentView < 0)
            {
                this.CurrentView = 0;
            }
            this._templateGroups = null;
        }
        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);
            }
        }
Exemplo n.º 9
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            DataBoundControl dataBoundControl = context.Instance as DataBoundControl;

            if (dataBoundControl != null)
            {
                IDesignerHost            service       = (IDesignerHost)provider.GetService(typeof(IDesignerHost));
                DataBoundControlDesigner designer      = (DataBoundControlDesigner)service.GetDesigner(dataBoundControl);
                IComponentChangeService  changeService = (IComponentChangeService)provider.GetService(typeof(IComponentChangeService));
                ControlDesigner.InvokeTransactedChange(dataBoundControl, delegate(object callbackContext) {
                    DataControlFieldsEditor form = new DataControlFieldsEditor(designer);
                    DialogResult result          = UIServiceHelper.ShowDialog(provider, form);
                    if ((result == DialogResult.OK) && (changeService != null))
                    {
                        changeService.OnComponentChanged(dataBoundControl, null, null, null);
                    }
                    return(result == DialogResult.OK);
                }, null, System.Design.SR.GetString("GridView_EditFieldsTransaction"));
                return(value);
            }
            return(null);
        }
Exemplo n.º 10
0
        internal void EditRightItems()
        {
            PropertyDescriptor propertyToEdit = TypeDescriptor.GetProperties(this.Component)["RightItems"];

            ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.EditItemsCallback), propertyToEdit, Resources.DualList_EditRightItemsEffectDescription, propertyToEdit);
        }
Exemplo n.º 11
0
 internal void ConnectToDataSourceAction()
 {
     ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.ConnectToDataSourceCallback), null, System.Design.SR.GetString("ListControlDesigner_ConnectToDataSource"));
 }
 private void ConvertToTemplate()
 {
     ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.ConvertToTemplateChangeCallback), null, System.Design.SR.GetString("WebControls_ConvertToTemplate"), this.TemplateDescriptor);
 }
 private void Reset()
 {
     this.UpdateDesignTimeHtml();
     ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.ResetChangeCallback), null, System.Design.SR.GetString("WebControls_Reset"), this.TemplateDescriptor);
 }
Exemplo n.º 14
0
        private void EditMenuItems()
        {
            PropertyDescriptor member = TypeDescriptor.GetProperties(base.Component)["Items"];

            ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.EditMenuItemsChangeCallback), null, null, member);
        }
Exemplo n.º 15
0
 private void CreateDataSource()
 {
     ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.CreateDataSourceCallback), null, System.Design.SR.GetString("BaseDataBoundControl_CreateDataSourceTransaction"));
 }
Exemplo n.º 16
0
 private void ConvertToStaticTemplate()
 {
     ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.ConvertToStaticTemplateChangeCallback), null, System.Design.SR.GetString("MenuDesigner_ConvertToStaticTemplate"));
 }
Exemplo n.º 17
0
        private void EditMenuItems()
        {
            PropertyDescriptor member = TypeDescriptor.GetProperties(base.Component)["Items"];

            ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.EditMenuItemsChangeCallback), null, System.Design.SR.GetString("MenuDesigner_EditNodesTransactionDescription"), member);
        }
Exemplo n.º 18
0
        internal void EditItems()
        {
            PropertyDescriptor context = TypeDescriptor.GetProperties(base.Component)["Items"];

            ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.EditItemsCallback), context, System.Design.SR.GetString("ListControlDesigner_EditItems"), context);
        }
Exemplo n.º 19
0
 public override void Configure()
 {
     ControlDesigner.InvokeTransactedChange(base.Component, new TransactedChangeCallback(this.ConfigureDataSourceChangeCallback), null, System.Design.SR.GetString("DataSource_ConfigureTransactionDescription"));
 }
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     ControlDesigner.InvokeTransactedChange((IComponent)context.Instance, new TransactedChangeCallback(this.EditQueryChangeCallback), new Pair(context.Instance, value), System.Design.SR.GetString("SqlDataSourceDesigner_EditQueryTransactionDescription"));
     return(value);
 }