Ejemplo n.º 1
0
 protected Binder(IChangable source, IChangable target, BindingMode mode)
 {
     _source       = source;
     _target       = target;
     _sourceIsUsed = mode == BindingMode.OneWay || mode == BindingMode.TwoWay;
     _targetIsUsed = mode == BindingMode.OneWayToSource || mode == BindingMode.TwoWay;
 }
Ejemplo n.º 2
0
 protected Binder(IChangable source, IChangable target, BindingMode mode)
 {
     _source = source;
     _target = target;
     _sourceIsUsed = mode == BindingMode.OneWay || mode == BindingMode.TwoWay;
     _targetIsUsed = mode == BindingMode.OneWayToSource || mode == BindingMode.TwoWay;
 }
Ejemplo n.º 3
0
        public void ShouldChangeStructstate()
        {
            var p = new ChangeablePoint(1, 1);

            p.Change(2, 2);
            IChangable o = p;

            o.Change(3, 3);

            Assert.AreNotEqual(o, p);
        }
Ejemplo n.º 4
0
 public static void AddCustomChangable(Type targetType, IChangable changable)
 {
     CustomChangableMap.Add(targetType, changable);
 }
Ejemplo n.º 5
0
		public bool IsModified(IChangable latest)
		{
			return latest.LastModified > LastModified;
		}
Ejemplo n.º 6
0
 /// <summary>
 /// Stops changable from receiving notifications about state changes
 /// </summary>
 /// <param name="chnagable">Changable to register</param>
 /// <returns>Current game state</returns>
 public void Unsubscribe(IChangable chnagable)
 {
     Changables.Remove(chnagable);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Registers new changable to notify about state changes
 /// </summary>
 /// <param name="changable">Changable to register</param>
 /// <returns>Current game state</returns>
 public GameState Subscribe(IChangable changable)
 {
     Changables.Add(changable);
     return(State);
 }
Ejemplo n.º 8
0
 public static void AddCustomChangable(Type targetType, IChangable changable)
 {
     CustomChangableMap.Add(targetType, changable);
 }