Exemple #1
0
 /// <summary>
 /// Control's OnPropertyBound event handler extension.
 /// </summary>
 /// <param name="prop">Property object.</param>
 /// <param name="row">The data row context, if in a list.</param>
 public virtual void OnPropertyBound(DateTimeProperty prop, DataRow row)
 {
     if (BaseBinding.Create(txt_DateTime) is BasePropertyBinding pb)
     {
         pb.BindTo(prop, row);
     }
 }
Exemple #2
0
        public Safe()
        {
            _name                  = new StringProperty((byte)HeaderTypes.DbName, "Name");
            _description           = new StringProperty((byte)HeaderTypes.DbDescription, "Description");
            _nonDefaultUserPrefs   = new StringProperty((byte)HeaderTypes.NonDefaultUserPrefs, "NonDefaultUserPrefs");
            _lastUpdateUser        = new StringProperty((byte)HeaderTypes.LastUpdateUser, "LastUpdateUser");
            _lastUpdateHost        = new StringProperty((byte)HeaderTypes.LastUpdateHost, "LastUpdateHost");
            _lastUpdateApplication = new StringProperty((byte)HeaderTypes.LastUpdateApplication, "LastUpdateApplication");
            _version               = new VersionProperty((byte)HeaderTypes.Version, "Version");
            _lastUpdateTime        = new DateTimeProperty((byte)HeaderTypes.LastUpdateTime, "LastUpdateTime");
            _uuid                  = new GuidProperty((byte)HeaderTypes.Uuid, "Uuid");

            Items      = new List <Item>();
            Properties = new Collection <Property>
            {
                _name,
                _description,
                _nonDefaultUserPrefs,
                _lastUpdateUser,
                _lastUpdateHost,
                _lastUpdateApplication,
                _version,
                _lastUpdateTime,
                _uuid
            };
            NotImplementedProperties = new Collection <Property>();
        }
Exemple #3
0
        public override void Write(JsonWriter writer, object value)
        {
            base.Write(writer, value);
            var p = (DateTimeProperty)value;

            writer.WriteFirstArrayProperty("Features", DateTimeProperty.GetColumns(p.Features));
        }
Exemple #4
0
        /// <summary>Generates a feature.</summary>
        /// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
        /// <param name="type">The type.</param>
        /// <param name="name">The name.</param>
        /// <returns>The feature.</returns>
        public static Property GenerateFeature(Type type, string name)
        {
            Property p;

            if (type == typeof(string))
            {
                p = new StringProperty();
            }
            else if (type == typeof(DateTime))
            {
                p = new DateTimeProperty();
            }
            else if (type.GetInterfaces().Contains(typeof(IEnumerable)))
            {
                throw new InvalidOperationException(
                          string.Format("Property {0} needs to be labeled as an EnumerableFeature", name));
            }
            else
            {
                p = new Property();
            }

            p.Discrete = type.BaseType == typeof(Enum) || type == typeof(bool) || type == typeof(string) ||
                         type == typeof(char) || type == typeof(DateTime);

            p.Type = type;
            p.Name = name;

            return(p);
        }
Exemple #5
0
 protected override void Initialize()
 {
     CarrierTrackingNumberProperty      = new TextProperty(this, CarrierTrackingNumber);
     CarrierTrackingNumberProperty.Size = 25;
     LineTotalProperty             = new MoneyProperty(this, LineTotal);
     LineTotalProperty.Required    = true;
     ModifiedDateProperty          = new DateTimeProperty(this, ModifiedDate);
     ModifiedDateProperty.Required = true;
     OrderQtyProperty                    = new SmallIntegerProperty(this, OrderQty);
     OrderQtyProperty.Required           = true;
     ProductIdProperty                   = new EnumIntProperty(this, ProductId);
     ProductIdProperty.Required          = true;
     ProductIdProperty.EnumType          = "product";
     RowguidProperty                     = new GuidProperty(this, Rowguid);
     RowguidProperty.Required            = true;
     SalesOrderDetailIdProperty          = new IntegerKeyProperty(this, SalesOrderDetailId);
     SalesOrderDetailIdProperty.Required = true;
     SalesOrderDetailIdProperty.Editable = false;
     SalesOrderIdProperty                = new IntegerKeyProperty(this, SalesOrderId);
     SalesOrderIdProperty.Required       = true;
     SalesOrderIdProperty.Editable       = false;
     SpecialOfferIdProperty              = new EnumIntProperty(this, SpecialOfferId);
     SpecialOfferIdProperty.Required     = true;
     SpecialOfferIdProperty.EnumType     = "special offer";
     UnitPriceProperty                   = new MoneyProperty(this, UnitPrice);
     UnitPriceProperty.Required          = true;
     UnitPriceDiscountProperty           = new MoneyProperty(this, UnitPriceDiscount);
     UnitPriceDiscountProperty.Required  = true;
 }
Exemple #6
0
        public Item()
        {
            _group            = new StringProperty((byte)FieldTypes.Group, "Group");
            _title            = new StringProperty((byte)FieldTypes.Title, "Title");
            _url              = new StringProperty((byte)FieldTypes.Url, "Url");
            _user             = new StringProperty((byte)FieldTypes.User, "User");
            _password         = new StringProperty((byte)FieldTypes.Password, "Password");
            _notes            = new StringProperty((byte)FieldTypes.Notes, "Notes");
            _autoType         = new StringProperty((byte)FieldTypes.Autotype, "AutoType");
            _passwordModified = new DateTimeProperty((byte)FieldTypes.PasswordModified, "PasswordModified");
            _passwordExpires  = new DateTimeProperty((byte)FieldTypes.PasswordExpires, "PasswordExpires");
            _modifiedTime     = new DateTimeProperty((byte)FieldTypes.RecordModifiedTime, "ModifiedTime");
            _createdTime      = new DateTimeProperty((byte)FieldTypes.CreatedTime, "CreatedTime");
            _accessedTime     = new DateTimeProperty((byte)FieldTypes.AccessTime, "AccessedTime");
            _uuid             = new GuidProperty((byte)FieldTypes.Uuid, "Uuid");

            Properties = new Collection <Property>()
            {
                _uuid,
                _group,
                _title,
                _user,
                _password,
                _notes,
                _url,
                _autoType,
                _accessedTime,
                _createdTime,
                _passwordExpires,
                _passwordModified,
                _modifiedTime
            };
            NotImplementedProperties = new Collection <Property>();
        }
        public static Node WithDateTimeProperty(this Node node, string id, string name = "default", string unit = "", bool settable = false, bool retained = true)
        {
            var prop = new DateTimeProperty(node, id, name, unit, settable, retained);

            node.AddProperty(prop);
            return(node);
        }
        public void Initialize_DateTimeProperty()
        {
            IBusinessObjectDateTimeProperty property = new DateTimeProperty(
                GetPropertyParameters(GetPropertyInfo(typeof(ClassWithAllDataTypes), "DateTime"), _businessObjectProvider));

            Assert.That(property.Type, Is.EqualTo(DateTimeType.DateTime));
        }
Exemple #9
0
        /// <summary>
        /// Control's OnPropertyBound event handler extension.
        /// </summary>
        /// <param name="prop">Property object.</param>
        public virtual void OnPropertyBound(DateTimeProperty prop)
        {
            BasePropertyBinding pb = WebPropertyBinding.Create(txt_DateTime) as BasePropertyBinding;

            if (pb != null)
            {
                pb.BindTo(prop);
            }
        }
        /// <summary>
        /// Binds the date picker to the given property.
        /// Sets the long format on the date picker if the property has current culture's long date format
        /// </summary>
        /// <param name="property">The data property to bind the date picker to.</param>
        /// <param name="row">The data row context, if any.</param>
        public override void BindTo(DataProperty property, DataRow row)
        {
            base.BindTo(property, row);
            DateTimeProperty dtp = property as DateTimeProperty;

            if (dtp != null)
            {
                ((DatePicker)element).SelectedDateFormat = DateTimeFormatInfo.CurrentInfo.LongDatePattern.Equals(dtp.Format) ?
                                                           DatePickerFormat.Long : DatePickerFormat.Short;
            }
        }
Exemple #11
0
        public override object Read(JsonReader reader)
        {
            var p = (DateTimeProperty)base.Read(reader);

            var features = reader.ReadArrayProperty().Value
                           .Select(o => (string)o)
                           .ToArray();

            p.Features = DateTimeProperty.GetFeatures(features);

            return(p);
        }
Exemple #12
0
        public void Test_1()
        {
            var instance = new DateTimeProperty
              {
            Date = new DateTime(2013, 10, 1, 14, 45, 28, DateTimeKind.Local)
              };

              var serialized = TypeSerializer.SerializeToString(instance);

              var deserializer = new JsvConverter();

              var result = deserializer.DeserializeFromString<DateTimeProperty>(serialized);
        }
Exemple #13
0
 public bool Equals(Foo other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) && DateTimeProperty.Equals(other.DateTimeProperty) &&
            StringProperty == other.StringProperty &&
            CharProperty == other.CharProperty);
 }
Exemple #14
0
        public void DateTime_Property_Save_And_Load()
        {
            DateTimeProperty p =
                new DateTimeProperty(DateTimeFeature.DayOfWeek |
                                     DateTimeFeature.Second |
                                     DateTimeFeature.Minute);

            p.Name     = "MyProp";
            p.Discrete = false;
            p.Start    = 5;

            Serialize(p);
            var property = Deserialize <DateTimeProperty>();

            Assert.Equal(p, property);
        }
Exemple #15
0
        public void DateTime_Property_Save_And_Load_Json()
        {
            DateTimeProperty p =
                new DateTimeProperty(DateTimeFeature.DayOfWeek |
                                     DateTimeFeature.Second |
                                     DateTimeFeature.Minute);

            p.Name     = "MyProp";
            p.Discrete = false;
            p.Start    = 5;

            var file     = GetPath();
            var property = SaveAndLoadJson(p);

            Assert.Equal(p, property);
        }
        /// <summary>Adds DateTime property to descriptor with previously chained name.</summary>
        /// <exception cref="DescriptorException">Thrown when a Descriptor error condition occurs.</exception>
        /// <param name="portion">Which date portions to use (can pipe: DateTimeFeature.Year |
        /// DateTimeFeature.DayOfWeek)</param>
        /// <returns>descriptor with added property.</returns>
        public Descriptor AsDateTime(DatePortion portion)
        {
            if (_label)
            {
                throw new DescriptorException("Cannot use an DateTime property as a label");
            }

            var p = new DateTimeProperty(portion)
            {
                Discrete = true,
                Name     = _name
            };

            AddProperty(p);
            return(_descriptor);
        }
Exemple #17
0
        protected override void Initialize()
        {
            AccountNumberProperty             = new TextProperty(this, AccountNumber);
            AccountNumberProperty.Size        = 15;
            CommentProperty                   = new TextProperty(this, Comment);
            CommentProperty.Size              = 128;
            ModifiedDateProperty              = new DateTimeProperty(this, ModifiedDate);
            ModifiedDateProperty.Required     = true;
            ModifiedDateProperty.Editable     = false;
            OnlineOrderFlagProperty           = new BooleanProperty(this, OnlineOrderFlag);
            OnlineOrderFlagProperty.Required  = true;
            OrderDateProperty                 = new DateProperty(this, OrderDate);
            OrderDateProperty.Required        = true;
            OrderDateProperty.Editable        = false;
            PurchaseOrderNumberProperty       = new TextProperty(this, PurchaseOrderNumber);
            PurchaseOrderNumberProperty.Size  = 25;
            RevisionNumberProperty            = new TinyIntegerProperty(this, RevisionNumber);
            RevisionNumberProperty.Required   = true;
            RevisionNumberProperty.Editable   = false;
            SalesOrderIdProperty              = new IntegerKeyProperty(this, SalesOrderId);
            SalesOrderIdProperty.Required     = true;
            SalesOrderIdProperty.Editable     = false;
            SalesOrderNumberProperty          = new TextProperty(this, SalesOrderNumber);
            SalesOrderNumberProperty.Required = true;
            SalesOrderNumberProperty.Size     = 25;
            SalesOrderNumberProperty.Editable = false;
            ShipDateProperty                  = new DateProperty(this, ShipDate);
            StatusProperty          = new EnumByteProperty(this, Status);
            StatusProperty.Required = true;
            StatusProperty.Size     = 10;
            StatusProperty.EnumType = "sales order status";
            DataObject objCustomer = new SalesOrderCustomerObjectCustomized();

            AddChildObject(Customer, objCustomer);
            DataObject objDetail = new SalesOrderDetailList();

            AddChildObject(Detail, objDetail);
            DataObject objPayment = new SalesOrderPaymentObject();

            AddChildObject(Payment, objPayment);
            DataObject objSales = new SalesOrderSalesObjectCustomized();

            AddChildObject(Sales, objSales);
        }
        public void DateTime_Property_Save_And_Load()
        {
            DateTimeProperty p = new DateTimeProperty(DateTimeFeature.DayOfWeek | DateTimeFeature.Second | DateTimeFeature.Minute);

            p.Name     = "MyProp";
            p.Discrete = false;
            p.Start    = 5;

            Serialize(p);

            var po = Deserialize <DateTimeProperty>();

            Assert.AreEqual(p.Name, po.Name);
            Assert.AreEqual(p.Type, po.Type);
            Assert.AreEqual(p.Discrete, po.Discrete);
            Assert.AreEqual(p.Start, po.Start);
            Assert.AreEqual(p.Features, po.Features);
            Assert.AreEqual(p.Length, po.Length);
        }
Exemple #19
0
    /// <summary>
    /// Copy ctor
    /// </summary>
    /// <param name="vCard">The vCard to clone.</param>
    private VCard(VCard vCard)
    {
        Version = vCard.Version;

        Func <ICloneable?, object?> cloner = Cloned;

        foreach (KeyValuePair <VCdProp, object> kvp in vCard._propDic)
        {
            Set(kvp.Key, kvp.Value switch
            {
                XmlProperty xmlProp => xmlProp.Clone(),
                IEnumerable <XmlProperty?> xmlPropEnumerable => xmlPropEnumerable.Select(cloner).Cast <XmlProperty?>().ToArray(),
                ProfileProperty profProp => profProp.Clone(),
                TextProperty txtProp => txtProp.Clone(),
                IEnumerable <TextProperty?> txtPropEnumerable => txtPropEnumerable.Select(cloner).Cast <TextProperty?>().ToArray(),
                DateTimeProperty dtTimeProp => dtTimeProp.Clone(),
                IEnumerable <DateTimeProperty?> dtTimePropEnumerable => dtTimePropEnumerable.Select(cloner).Cast <DateTimeProperty?>().ToArray(),
                AddressProperty adrProp => adrProp.Clone(),
                IEnumerable <AddressProperty?> adrPropEnumerable => adrPropEnumerable.Select(cloner).Cast <AddressProperty?>().ToArray(),
                NameProperty nameProp => nameProp.Clone(),
                IEnumerable <NameProperty?> namePropEnumerable => namePropEnumerable.Select(cloner).Cast <NameProperty?>().ToArray(),
                RelationProperty relProp => relProp.Clone(),
                IEnumerable <RelationProperty?> relPropEnumerable => relPropEnumerable.Select(cloner).Cast <RelationProperty?>().ToArray(),
                OrganizationProperty orgProp => orgProp.Clone(),
                IEnumerable <OrganizationProperty?> orgPropEnumerable => orgPropEnumerable.Select(cloner).Cast <OrganizationProperty?>().ToArray(),
                StringCollectionProperty strCollProp => strCollProp.Clone(),
                IEnumerable <StringCollectionProperty?> strCollPropEnumerable => strCollPropEnumerable.Select(cloner).Cast <StringCollectionProperty?>().ToArray(),
                GenderProperty sexProp => sexProp.Clone(),
                IEnumerable <GenderProperty?> sexPropEnumerable => sexPropEnumerable.Select(cloner).Cast <GenderProperty?>().ToArray(),
                GeoProperty geoProp => geoProp.Clone(),
                IEnumerable <GeoProperty?> geoPropEnumerable => geoPropEnumerable.Select(cloner).Cast <GeoProperty?>().ToArray(),
                DataProperty dataProp => dataProp.Clone(),
                IEnumerable <DataProperty?> dataPropEnumerable => dataPropEnumerable.Select(cloner).Cast <DataProperty?>().ToArray(),
                NonStandardProperty nStdProp => nStdProp.Clone(),
                IEnumerable <NonStandardProperty?> nStdPropEnumerable => nStdPropEnumerable.Select(cloner).Cast <NonStandardProperty?>().ToArray(),
                PropertyIDMappingProperty pidMapProp => pidMapProp.Clone(),
                IEnumerable <PropertyIDMappingProperty?> pidMapPropEnumerable => pidMapPropEnumerable.Select(cloner).Cast <PropertyIDMappingProperty?>().ToArray(),
                TimeZoneProperty tzProp => tzProp.Clone(),
                IEnumerable <TimeZoneProperty?> tzPropEnumerable => tzPropEnumerable.Select(cloner).Cast <TimeZoneProperty?>().ToArray(),

                ICloneable cloneable => cloneable.Clone(), // AccessProperty, KindProperty, TimeStampProperty, UuidProperty
                _ => kvp.Value
            });
        /// <summary>
        /// Updates the selected date of the date picker.
        /// </summary>
        /// <param name="change">The property change.</param>
        protected override void UpdateElement(PropertyChange change)
        {
            base.UpdateElement(change);
            if (property == null)
            {
                return;
            }

            if (change.IncludesValue())
            {
                DateTimeProperty dtp = property as DateTimeProperty;
                if (dtp != null)
                {
                    ((DatePicker)element).SelectedDate = dtp.Value;
                }
                else
                {
                    ((DatePicker)element).Text = property.GetStringValue(property.Editable ? ValueFormat.EditString : ValueFormat.DisplayString, row);
                }
            }
        }
Exemple #21
0
 public static void GetPropertyTypeString(DateTimeProperty obj, MethodReturnEventArgs <string> e)
 {
     GetElementTypeString(obj, e);
     PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder);
 }
Exemple #22
0
 public static void GetElementTypeString(DateTimeProperty obj, MethodReturnEventArgs <string> e)
 {
     e.Result = "DateTime";
     PropertyActions.DecorateElementType(obj, e, true);
 }
 /// <summary>Constructor.</summary>
 /// <param name="features">The features.</param>
 public DateFeatureAttribute(DateTimeFeature features)
 {
     dp = new DateTimeProperty(features);
 }
 public static void GetElementTypeString(DateTimeProperty obj, MethodReturnEventArgs<string> e)
 {
     e.Result = "DateTime";
     PropertyActions.DecorateElementType(obj, e, true);
 }
Exemple #25
0
 set => SetValue(DateTimeProperty, value);
        protected override void Initialize()
        {
            SalesOrderIdProperty = new IntegerKeyProperty(this, SalesOrderId)
            {
                Required = true,
                Editable = false,
                IsKey    = true,
            };
            SalesOrderNumberProperty = new TextProperty(this, SalesOrderNumber)
            {
                Required = true,
                Size     = 25,
                Editable = false,
            };
            OrderDateProperty = new DateProperty(this, OrderDate)
            {
                Required = true,
                Editable = false,
            };
            StatusProperty = new EnumByteProperty(this, Status)
            {
                Required = true,
                EnumType = "sales order status",
            };
            OnlineOrderFlagProperty = new BooleanProperty(this, OnlineOrderFlag)
            {
                Required = true,
            };
            PurchaseOrderNumberProperty = new TextProperty(this, PurchaseOrderNumber)
            {
                Size = 25,
            };
            AccountNumberProperty = new TextProperty(this, AccountNumber)
            {
                Size = 15,
            };
            ShipDateProperty = new DateProperty(this, ShipDate)
            {
            };
            CommentProperty = new TextProperty(this, Comment)
            {
                Size = 128,
            };
            RevisionNumberProperty = new TinyIntegerProperty(this, RevisionNumber)
            {
                Required = true,
                Editable = false,
            };
            ModifiedDateProperty = new DateTimeProperty(this, ModifiedDate)
            {
                Required = true,
                Editable = false,
            };
            DataObject objCustomer = ServiceProvider.GetService <SalesOrderCustomerObject>();

            AddChildObject(Customer, objCustomer);
            DataObject objDetail = ServiceProvider.GetService <SalesOrderDetailList>();

            AddChildObject(Detail, objDetail);
            DataObject objPayment = ServiceProvider.GetService <SalesOrderPaymentObject>();

            AddChildObject(Payment, objPayment);
            DataObject objSales = ServiceProvider.GetService <SalesOrderSalesObject>();

            AddChildObject(Sales, objSales);
        }
Exemple #27
0
 public DateTimePropertyValueModel(INotifyingObject obj, DateTimeProperty prop)
     : base(obj, prop)
 {
     dtProp = prop;
 }
 public static void GetPropertyType(DateTimeProperty obj, MethodReturnEventArgs<Type> e)
 {
     e.Result = typeof(DateTime);
     PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder);
 }
 public override void OnPropertyBound(DateTimeProperty prop)
 {
     base.OnPropertyBound(prop);
     extCalendar.Format = prop.Format;
 }
Exemple #30
0
        public static Property Clone(Property target)
        {
            Property prop = null;
            int id = target.PropertyId;
            PropertyBag bag = target.Owner;

            switch (target.PropertyType)
            {
                case (int)PropertyKind.WispObject:
                    prop = new WispProperty(target.Name, id, ((WispProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.WispArray:
                    prop = new WispArrayProperty(target.Name, id, ((WispArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Int32:
                    prop = new Int32Property(target.Name, id, ((Int32Property)target).Value, bag);
                    break;
                case (int)PropertyKind.String:
                    prop = new StringProperty(target.Name, id, ((StringProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Bool:
                    prop = new BoolProperty(target.Name, id, ((BoolProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Guid:
                    prop = new GuidProperty(target.Name, id, ((GuidProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Single:
                    prop = new SingleProperty(target.Name, id, ((SingleProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Int32Array:
                    prop = new Int32ArrayProperty(target.Name, id, ((Int32ArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.StringArray:
                    prop = new StringArrayProperty(target.Name, id, ((StringArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.DateTime:
                    prop = new DateTimeProperty(target.Name, id, ((DateTimeProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.GuidArray:
                    prop = new GuidArrayProperty(target.Name, id, ((GuidArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Double:
                    prop = new DoubleProperty(target.Name, id, ((DoubleProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Byte:
                    prop = new ByteProperty(target.Name, id, ((ByteProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Component:
                    prop = new ComponentProperty(target.Name, id, ((ComponentProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.SingleArray:
                    prop = new SingleArrayProperty(target.Name, id, ((SingleArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Int64:
                    prop = new Int64Property(target.Name, id, ((Int64Property)target).Value, bag);
                    break;
                case (int)PropertyKind.ComponentArray:
                    prop = new ComponentArrayProperty(target.Name, id, ((ComponentArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.DateTimeArray:
                    prop = new DateTimeArrayProperty(target.Name, id, ((DateTimeArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.ByteArray:
                    prop = new ByteArrayProperty(target.Name, id, ((ByteArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.DoubleArray:
                    prop = new DoubleArrayProperty(target.Name, id, ((DoubleArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Int16Array:
                    prop = new Int16ArrayProperty(target.Name, id, ((Int16ArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.Int16:
                    prop = new Int16Property(target.Name, id, ((Int16Property)target).Value, bag);
                    break;
                case (int)PropertyKind.Int64Array:
                    prop = new Int64ArrayProperty(target.Name, id, ((Int64ArrayProperty)target).Value, bag);
                    break;
                case (int)PropertyKind.BoolArray:
                    prop = new BoolArrayProperty(target.Name, id, ((BoolArrayProperty)target).Value, bag);
                    break;
            }
            prop.Name = target.Name;
            return prop;
        }
 protected override void Initialize()
 {
     AccountNumberProperty = new TextProperty(this, AccountNumber);
     AccountNumberProperty.Size = 15;
     CommentProperty = new TextProperty(this, Comment);
     CommentProperty.Size = 128;
     ModifiedDateProperty = new DateTimeProperty(this, ModifiedDate);
     ModifiedDateProperty.Required = true;
     ModifiedDateProperty.Editable = false;
     OnlineOrderFlagProperty = new BooleanProperty(this, OnlineOrderFlag);
     OnlineOrderFlagProperty.Required = true;
     OrderDateProperty = new DateProperty(this, OrderDate);
     OrderDateProperty.Required = true;
     OrderDateProperty.Editable = false;
     PurchaseOrderNumberProperty = new TextProperty(this, PurchaseOrderNumber);
     PurchaseOrderNumberProperty.Size = 25;
     RevisionNumberProperty = new TinyIntegerProperty(this, RevisionNumber);
     RevisionNumberProperty.Required = true;
     RevisionNumberProperty.Editable = false;
     SalesOrderIdProperty = new IntegerKeyProperty(this, SalesOrderId);
     SalesOrderIdProperty.Required = true;
     SalesOrderIdProperty.Editable = false;
     SalesOrderNumberProperty = new TextProperty(this, SalesOrderNumber);
     SalesOrderNumberProperty.Required = true;
     SalesOrderNumberProperty.Size = 25;
     SalesOrderNumberProperty.Editable = false;
     ShipDateProperty = new DateProperty(this, ShipDate);
     StatusProperty = new EnumByteProperty(this, Status);
     StatusProperty.Required = true;
     StatusProperty.Size = 10;
     StatusProperty.EnumType = "sales order status";
     DataObject objCustomer = new SalesOrderCustomerObjectCustomized();
     AddChildObject(Customer, objCustomer);
     DataObject objDetail = new SalesOrderDetailList();
     AddChildObject(Detail, objDetail);
     DataObject objPayment = new SalesOrderPaymentObject();
     AddChildObject(Payment, objPayment);
     DataObject objSales = new SalesOrderSalesObjectCustomized();
     AddChildObject(Sales, objSales);
 }
 /// <summary>
 /// Control's OnPropertyBound event handler extension.
 /// </summary>
 /// <param name="prop">Property object.</param>
 public virtual void OnPropertyBound(DateTimeProperty prop)
 {
     BasePropertyBinding pb = WebPropertyBinding.Create(txt_DateTime) as BasePropertyBinding;
     if (pb != null) pb.BindTo(prop);
 }
 public static void GetPropertyTypeString(DateTimeProperty obj, MethodReturnEventArgs<string> e)
 {
     GetElementTypeString(obj, e);
     PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder);
 }
 /// <summary>Constructor.</summary>
 /// <param name="portion">The portion.</param>
 public DateFeatureAttribute(DatePortion portion)
 {
     dp = new DateTimeProperty(portion);
 }
Exemple #35
0
 public static void GetPropertyType(DateTimeProperty obj, MethodReturnEventArgs <Type> e)
 {
     e.Result = typeof(DateTime);
     PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder);
 }
 public override void OnPropertyBound(DateTimeProperty prop, DataRow row)
 {
     base.OnPropertyBound(prop, row);
     extCalendar.Format = prop.Format;
 }
 protected override void Initialize()
 {
     CarrierTrackingNumberProperty = new TextProperty(this, CarrierTrackingNumber);
     CarrierTrackingNumberProperty.Size = 25;
     LineTotalProperty = new MoneyProperty(this, LineTotal);
     LineTotalProperty.Required = true;
     ModifiedDateProperty = new DateTimeProperty(this, ModifiedDate);
     ModifiedDateProperty.Required = true;
     OrderQtyProperty = new SmallIntegerProperty(this, OrderQty);
     OrderQtyProperty.Required = true;
     ProductIdProperty = new EnumIntProperty(this, ProductId);
     ProductIdProperty.Required = true;
     ProductIdProperty.Size = 10;
     ProductIdProperty.EnumType = "product";
     RowguidProperty = new GuidProperty(this, Rowguid);
     RowguidProperty.Required = true;
     SalesOrderDetailIdProperty = new IntegerKeyProperty(this, SalesOrderDetailId);
     SalesOrderDetailIdProperty.Required = true;
     SalesOrderDetailIdProperty.Editable = false;
     SalesOrderIdProperty = new IntegerKeyProperty(this, SalesOrderId);
     SalesOrderIdProperty.Required = true;
     SalesOrderIdProperty.Editable = false;
     SpecialOfferIdProperty = new EnumIntProperty(this, SpecialOfferId);
     SpecialOfferIdProperty.Required = true;
     SpecialOfferIdProperty.Size = 10;
     SpecialOfferIdProperty.EnumType = "special offer";
     UnitPriceProperty = new MoneyProperty(this, UnitPrice);
     UnitPriceProperty.Required = true;
     UnitPriceDiscountProperty = new MoneyProperty(this, UnitPriceDiscount);
     UnitPriceDiscountProperty.Required = true;
 }