Ejemplo n.º 1
0
        //

        protected override void OnInit()
        {
            buttonUpdate        = ProcedureForm.CreateButton(EditorLocalization.Translate("General", "Update"));
            buttonUpdate.Click += ButtonUpdate_Click;

            checkAutoUpdate        = ProcedureForm.CreateCheck(EditorLocalization.Translate("General", "Auto update"));
            checkAutoUpdate.Click += CheckAutoUpdate_Click;

            ProcedureForm.AddRow(new ProcedureUI.Control[] { buttonUpdate, checkAutoUpdate });
        }
Ejemplo n.º 2
0
        private void CheckAutoUpdate_Click(ProcedureUI.Check obj)
        {
            if (checkAutoUpdate.Checked == ProcedureUI.Check.CheckValue.Indeterminate)
            {
                return;
            }

            var undoItems = new List <UndoActionPropertiesChange.Item>();

            foreach (var effect in GetObjects <Component_RenderingEffect_CodeGenerated>())
            {
                var oldValue = effect.EditorAutoUpdate;

                effect.EditorAutoUpdate = checkAutoUpdate.Checked == ProcedureUI.Check.CheckValue.Checked;

                var property = (Metadata.Property)effect.MetadataGetMemberBySignature("property:EditorAutoUpdate");
                undoItems.Add(new UndoActionPropertiesChange.Item(effect, property, oldValue));
            }

            var undoAction = new UndoActionPropertiesChange(undoItems);

            Provider.DocumentWindow.Document.CommitUndoAction(undoAction);
        }