示例#1
0
 void item_Label_ValueChanged(IViewableProperty <string> property, string newValue, string oldValue)
 {
     if (TrackRenamed != null)
     {
         TrackRenamed(oldValue, newValue);
     }
 }
 // BeUtilExtensions.FlowIntoRd subscribes to Advise on source.Change, which is a signal. This means it doesn't
 // send the acknowledgement (i.e. set the current value immediately) as part of Advise. FlowIntoRd will set the
 // target value from the source itself, but doesn't check if the source value has been set, which can cause
 // exceptions. We'll Advise the source itself, which does check the source value, and sends an acknowledgement
 public static void FlowIntoRdSafe <TValue>(
     [NotNull] this IViewableProperty <TValue> source,
     Lifetime lifetime,
     [NotNull] IViewableProperty <TValue> target)
 {
     source.Advise(lifetime, val => target.Value = val);
 }
 public static void FlowIntoRdSafe <TValue, TResult>(
     [NotNull] this IViewableProperty <TValue> source,
     Lifetime lifetime,
     Func <TValue, TResult> converter,
     [NotNull] IViewableProperty <TResult> target)
 {
     source.Advise(lifetime, val => target.Value = converter(val));
 }
示例#4
0
        public RdOtBasedText(RdOtState @delegate) : base(@delegate)
        {
            myTextChanged = new ViewableProperty <RdTextChange>();
            myDiff        = new List <OtOperation>();

            // disabling mastering, text buffer must resolve conflicts by itself
            ((RdProperty <OtOperation>)Delegate.Operation).IsMaster = false;
        }
示例#5
0
        public RdTextBuffer(RdTextBufferState state) : base(state)
        {
            myTextChanged = new ViewableProperty <RdTextChange>();
            myChangesToConfirmOrRollback = new List <RdTextBufferChange>();
            BufferVersion = TextBufferVersion.InitVersion;
            myLocalOrigin = IsMaster ? RdChangeOrigin.Master : RdChangeOrigin.Slave;

            // disabling mastering, text buffer must resolve conflicts by itself
            ((RdProperty <RdTextBufferChange>)Delegate.Changes).IsMaster = false;
        }
 public static void FlowChangesIntoRdDeferred<TValue>(
     [NotNull] this IViewableProperty<TValue> source,
     Lifetime lifetime,
     [NotNull] Func<IViewableProperty<TValue>> nullableTargetCreator)
 {
     // If the source has a value, Advise will immediately try to set it on target
     source.Advise(lifetime, args =>
     {
         var target = nullableTargetCreator();
         if (target != null) target.Value = source.Value;
     });
 }
示例#7
0
        void Time_ValueChanged(IViewableProperty <float> property, float newValue, float oldValue)
        {
            if (NeighbourLeft != null)
            {
                if (NeighbourLeft.Time.Value > this.Time.Value)
                {
                    NeighbourChanged();
                    return;
                }
            }

            if (NeighbourRight != null)
            {
                if (NeighbourRight.Time.Value < this.Time.Value)
                {
                    NeighbourChanged();
                    return;
                }
            }
        }
示例#8
0
 public T4OutputExtensionChangeListener([NotNull] IViewableProperty <string> sink) => Sink = sink;
 public LifeModel()
 {
     StrProperty = new RdProperty <string>(Serializers.ReadString, Serializers.WriteString);
 }
示例#10
0
 void EaseChanged(IViewableProperty <int> property, int newValue, int oldValue)
 {
     FIsDirty = true;
 }
示例#11
0
 void CurveChanged(IViewableProperty <float> property, float newValue, float oldValue)
 {
     FIsDirty = true;
 }
示例#12
0
 void item_Label_ValueChanged(IViewableProperty<string> property, string newValue, string oldValue)
 {
     if (TrackRenamed != null)
         TrackRenamed(oldValue, newValue);
 }
示例#13
0
 public DeferredCacheProgressBar(Lifetime lifetime, DeferredHelperCache cache)
 {
     CurrentFile = new ViewableProperty <IPsiSourceFile>(null);
 }
示例#14
0
 public ViewablePropertyCell(IViewableProperty property)
 {
     FProperty = property;
     FProperty.ValueObjectChanged += HandleValueObjectChanged;
 }
示例#15
0
 void FNameProperty_ValueChanged(IViewableProperty <string> property, string newValue, string oldValue)
 {
     Name = newValue;
 }
示例#16
0
 public MappedProperty(IViewableProperty <T> source, Func <T, R> map)
 {
     mySource = source;
     myMap    = map;
     Change   = new MappedSink <T, R>(source.Change, myMap);
 }
示例#17
0
 public static void Set <T>(this IViewableProperty <T> p, T value)
 {
     p.Value = value;
 }
示例#18
0
 public static IReadonlyProperty <R> Select <T, R>(this IViewableProperty <T> source, Func <T, R> f)
 {
     return(new MappedProperty <T, R>(source, f));
 }
示例#19
0
 public ViewablePropertyCellProvider(IViewableProperty property)
 {
     FNameCell  = new Cell(property.Name, typeof(string), false);
     FValueCell = new ViewablePropertyCell(property);
 }
示例#20
0
 public WrongInitializedTypeTest()
 {
     ViewableProperty = new ViewableProperty <string>();
 }
示例#21
0
 void HandleValueObjectChanged(IViewableProperty property, object newValue, object oldValue)
 {
     OnValueChanged(EventArgs.Empty);
 }