示例#1
0
文件: String.cs 项目: Steell/Dynamo
        protected override bool UpdateValueCore(string name, string value, UndoRedoRecorder recorder)
        {
            if (name == "Value")
            {
                var converter = new StringDisplay();
                Value = converter.ConvertBack(value, typeof(string), null, null) as string;
                return(true);
            }

            return(base.UpdateValueCore(name, value, recorder));
        }
示例#2
0
        protected override bool UpdateValueCore(string name, string value)
        {
            if (name == "Value")
            {
                var converter = new StringDisplay();
                this.Value = ((string)converter.ConvertBack(value, typeof(string), null, null));
                return(true); // UpdateValueCore handled.
            }

            // There's another 'UpdateValueCore' method in 'String' base class,
            // since they are both bound to the same property, 'StringInput'
            // should be given a chance to handle the property value change first
            // before the base class 'String'.
            return(base.UpdateValueCore(name, value));
        }