예제 #1
0
 public ListViewItemEditorInitializedEventArgs(
     BaseListViewVisualItem visualItem,
     IValueEditor editor)
     : base(visualItem)
 {
     this.editor = editor;
 }
 public PropertyGridItemEditorInitializedEventArgs(
     PropertyGridItemElementBase visualItem,
     IValueEditor editor)
     : base(visualItem)
 {
     this.editor = editor;
 }
 public ListViewItemEditedEventArgs(
     BaseListViewVisualItem visualItem,
     IValueEditor editor,
     bool canceled)
     : base(visualItem)
 {
     this.editor   = editor;
     this.canceled = canceled;
 }
 public PropertyGridItemEditedEventArgs(
     PropertyGridItemElement visualItem,
     IValueEditor editor,
     bool canceled)
     : base((PropertyGridItemElementBase)visualItem)
 {
     this.editor   = editor;
     this.canceled = canceled;
 }
예제 #5
0
        protected RadItem GetEditorElement(IValueEditor editor)
        {
            BaseInputEditor baseInputEditor = this.editor as BaseInputEditor;

            if (baseInputEditor != null)
            {
                return(baseInputEditor.EditorElement as RadItem);
            }
            return(editor as RadItem);
        }
예제 #6
0
        protected virtual RadItem GetEditorElement(IValueEditor editor)
        {
            BaseInputEditor editor1 = this.editor as BaseInputEditor;

            if (editor1 != null)
            {
                return(editor1.EditorElement as RadItem);
            }
            return(editor as RadItem);
        }
예제 #7
0
 protected override RadItem GetEditorElement(IValueEditor editor)
 {
     if (this.EditingItem != null && this.EditingItem.EditorItem != null)
     {
         BaseInputEditor editor1 = this.EditingItem.EditorItem.Editor as BaseInputEditor;
         if (editor1 != null)
         {
             return(editor1.EditorElement as RadItem);
         }
     }
     return(editor as RadItem);
 }
예제 #8
0
        private void SaveControls(Control control)
        {
            IValueEditor editor = control as IValueEditor;

            if (editor != null)
            {
                editor.Save();
            }

            foreach (Control child in control.Controls)
            {
                SaveControls(child);
            }
        }
예제 #9
0
 public TreeNodeEditorInitializedEventArgs(TreeNodeElement nodeElement, IValueEditor editor)
     : base(nodeElement)
 {
     this.editor = editor;
 }
예제 #10
0
 public TreeNodeEditingEventArgs(RadTreeNode node, IValueEditor editor)
     : base(node)
 {
     this.editor = editor;
 }
예제 #11
0
 public PropertyGridItemEditingEventArgs(PropertyGridItemBase item, IValueEditor editor)
     : base(item)
 {
     this.editor = editor;
 }
예제 #12
0
 public TreeNodeEditedEventArgs(TreeNodeElement nodeElement, IValueEditor editor, bool canceled)
     : base(nodeElement)
 {
     this.editor   = editor;
     this.canceled = canceled;
 }
 public ListViewItemEditingEventArgs(ListViewDataItem item, IValueEditor editor) : base(item)
 {
     this.editor = editor;
 }
예제 #14
0
        private void UpdateInstance(IValueEditor editor, object valueOverride, bool committedChange)
        {
            if (lstProperties.SelectedItem is EffectProperty effectProperty)
            {
                // Store this change in the Mini.
                if (frmPersistentEffectPropertyEditor != null)
                {
                    Control childAtPoint = frmPersistentEffectPropertyEditor.GetChildAtPoint(new Point(4, 4));
                    if (childAtPoint is IValueEditor valueEditor)
                    {
                        BasePropertyChanger propertyChanger = valueEditor.GetPropertyChanger();
                        string saveValue = propertyChanger.Value;
                        if (propertyChanger != null)
                        {
                            string[] paths      = effectProperty.Paths.Split(';');
                            bool     needToSave = true;
                            foreach (string path in paths)
                            {
                                propertyChanger.FullPropertyPath = path;
                                propertyChanger.ValueOverride    = valueOverride;
                                propertyChanger.ModifyProperty(Instance);

                                if (needToSave)
                                {
                                    if (committedChange)
                                    {
                                        needToSave = false;
                                        IOldPersistentEffect persistentEffect = Mini.GetPersistentEffect();
                                        if (editor is IScriptEditor scriptEditor)
                                        {
                                            //Talespire.Log.Debug($"");
                                            //Talespire.Log.Warning($"editor is IScriptEditor scriptEditor!!!");
                                            //Talespire.Log.Warning($"effectProperty.Type = {effectProperty.Type?.FullName}");
                                            //Talespire.Log.Warning($"scriptEditor.LastSerializedData = \"{scriptEditor.LastSerializedData}\"");
                                            //Talespire.Log.Debug($"");
                                            if (persistentEffect is SuperPersistentEffect superPersistentEffect)
                                            {
                                                if (effectProperty.Type != null)
                                                {
                                                    superPersistentEffect.ScriptData[effectProperty.Type.FullName] = scriptEditor.LastSerializedData;
                                                    Mini.SavePersistentEffect(persistentEffect);
                                                }
                                            }
                                        }
                                        else
                                        {
                                            string propertyKey;

                                            if (effectProperty.Name.StartsWith("$"))
                                            {
                                                propertyKey = effectProperty.Name;
                                            }
                                            else
                                            {
                                                propertyKey = effectProperty.Paths;
                                            }

                                            if (persistentEffect != null)
                                            {
                                                Talespire.Log.Warning($"Properties[{propertyKey}] = \"{saveValue}\"!!!");

                                                // TODO: Use the correct EffectProperties instead of Properties (based on the prefix of the selected control).
                                                // TODO: Change this to be indexed by the property NAME, not the path (to support multiple linked properties (to a single SmartProperty).
                                                persistentEffect.Properties[propertyKey] = saveValue;                                                 // valueOverride.ToString();
                                                Talespire.Log.Debug($"Mini.SavePersistentEffect();");
                                                Mini.SavePersistentEffect(persistentEffect);
                                            }
                                            else
                                            {
                                                Talespire.Log.Error($"persistentEffect is not found!!");
                                            }
                                        }
                                    }
                                    else
                                    {
                                        //Talespire.Log.Warning($"Not a committed change! Not saving my friend!");
                                    }
                                }
                            }
                        }
                        else
                        {
                            Talespire.Log.Error($"propertyChanger not found!!!");
                        }
                    }
                    else
                    {
                        Talespire.Log.Error($"childAtPoint is not a value editor!");
                    }
                }
                else
                {
                    Talespire.Log.Error($"frmPersistentEffectPropertyEditor is null!");
                }
            }
            else
            {
                Talespire.Log.Error($"effectProperty is NULL!!!");
            }
        }
예제 #15
0
 public void ValueHasChanged(IValueEditor editor, object value, bool committedChange = false)
 {
     UpdateInstance(editor, value, committedChange);
 }
 public ValueChangedEventArgs(IValueEditor editor, object value, bool committedChange)
 {
     CommittedChange = committedChange;
     Editor          = editor;
     Value           = value;
 }