コード例 #1
0
        /// <summary>
        /// Creates a new strongly typed scalar data which can be used as data binding source, from exising property or field .
        /// </summary>
        /// <typeparam name="T">The type of the scalar data.</typeparam>
        /// <param name="propertyOrFieldName">The name of the property or field.</param>
        /// <param name="equalityComparer">The equality comparer.</param>
        /// <returns>A new strongly typed scalar data which can be used as data binding source, from exising property or field.</returns>
        protected Scalar <T> NewLinkedScalar <T>(string propertyOrFieldName, IEqualityComparer <T> equalityComparer = null)
        {
            var getter = this.GetPropertyOrFieldGetter <T>(propertyOrFieldName);
            var setter = this.GetPropertyOrFieldSetter <T>(propertyOrFieldName);

            return(ScalarContainer.CreateNew(getter, setter, equalityComparer));
        }
コード例 #2
0
ファイル: Scalar_T.cs プロジェクト: xydoublez/RDO.Net
 public LinkedScalar(ScalarContainer container, int ordinal, IEqualityComparer <T> equalityComparer, Func <T> getter, Action <T> setter)
     : base(container, ordinal, equalityComparer)
 {
     Debug.Assert(getter != null);
     Debug.Assert(setter != null);
     _getter = getter;
     _setter = setter;
 }
コード例 #3
0
ファイル: Scalar_T.cs プロジェクト: xydoublez/RDO.Net
 internal Scalar(ScalarContainer container, int ordinal, IEqualityComparer <T> equalityComparer)
     : base(container, ordinal)
 {
     if (equalityComparer == null)
     {
         equalityComparer = EqualityComparer <T> .Default;
     }
     _equalityComparer = equalityComparer;
 }
コード例 #4
0
ファイル: Scalar_T.cs プロジェクト: xydoublez/RDO.Net
 public EntityScalar(ScalarContainer container, int ordinal, IEqualityComparer <T> equalityComparer, T value)
     : base(container, ordinal, equalityComparer)
 {
     _value = value;
     if (IsEditing)
     {
         _editingValue = _value;
     }
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="BasePresenter"/> class.
 /// </summary>
 protected BasePresenter()
 {
     _scalarContainer = new ScalarContainer(this);
 }
コード例 #6
0
 /// <summary>
 /// Creates a new strongly typed scalar data which can be used as data binding source, from existing getter and setter.
 /// </summary>
 /// <typeparam name="T">The type of the scalar data.</typeparam>
 /// <param name="getter">The exising getter of the scalar data.</param>
 /// <param name="setter">The existing setter of the scalar data.</param>
 /// <param name="equalityComparer">The equality comparer.</param>
 /// <returns>A new strongly typed scalar data which can be used as data binding source, from exising getter and setter.</returns>
 protected Scalar <T> NewLinkedScalar <T>(Func <T> getter, Action <T> setter, IEqualityComparer <T> equalityComparer = null)
 {
     getter.VerifyNotNull(nameof(getter));
     setter.VerifyNotNull(nameof(setter));
     return(ScalarContainer.CreateNew(getter, setter, equalityComparer));
 }
コード例 #7
0
 /// <summary>
 /// Creates a new strongly typed scalar data which can be used as data binding source.
 /// </summary>
 /// <typeparam name="T">The type of the scalar data.</typeparam>
 /// <param name="value">The initial value of the scalar data.</param>
 /// <param name="equalityComparer">The equality comparer.</param>
 /// <returns>A new strongly typed scalar data which can be used as data binding source.</returns>
 protected Scalar <T> NewScalar <T>(T value = default(T), IEqualityComparer <T> equalityComparer = null)
 {
     return(ScalarContainer.CreateNew(value, equalityComparer));
 }
コード例 #8
0
ファイル: Scalar_T.cs プロジェクト: xydoublez/RDO.Net
 internal static Scalar <T> Create(ScalarContainer container, int ordinal, IEqualityComparer <T> equalityComparer, Func <T> getter, Action <T> setter)
 {
     return(new LinkedScalar(container, ordinal, equalityComparer, getter, setter));
 }
コード例 #9
0
ファイル: Scalar_T.cs プロジェクト: xydoublez/RDO.Net
 internal static Scalar <T> Create(ScalarContainer container, int ordinal, IEqualityComparer <T> equalityComparer, T value)
 {
     return(new EntityScalar(container, ordinal, equalityComparer, value));
 }
コード例 #10
0
 internal Scalar(ScalarContainer container, int ordinal)
 {
     _container = container;
     _ordinal   = ordinal;
 }