示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FamosFileProperty"/>.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <param name="value">The value.</param>
        /// <param name="flags">Flags.</param>
        public FamosFileProperty(string name, DateTime value, FamosFilePropertyFlags flags = 0)
        {
            var epoch = new DateTime(1980, 01, 01);

            this.Name  = name;
            this.Value = (value - epoch).TotalSeconds.ToString(CultureInfo.InvariantCulture);
            this.Type  = FamosFilePropertyType.TimeStampInDMFormat;
            this.Flags = flags;

            this.Validate();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FamosFileProperty"/>.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <param name="value">The value as string.</param>
        /// <param name="type">The value's data type.</param>
        /// <param name="flags">Flags.</param>
        public FamosFileProperty(string name, string value, FamosFilePropertyType type, FamosFilePropertyFlags flags = 0)
        {
            this.Name  = name;
            this.Value = value;
            this.Type  = type;
            this.Flags = flags;

            this.Validate();
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FamosFileProperty"/>.
 /// </summary>
 /// <param name="name">The name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="flags">Flags.</param>
 public FamosFileProperty(string name, bool value, FamosFilePropertyFlags flags = 0)
     : this(name, value ? "1" : "0", FamosFilePropertyType.Boolean, flags)
 {
     //
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FamosFileProperty"/>.
 /// </summary>
 /// <param name="name">The name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="flags">Flags.</param>
 public FamosFileProperty(string name, string value, FamosFilePropertyFlags flags = 0)
     : this(name, value, FamosFilePropertyType.String, flags)
 {
     //
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FamosFileProperty"/>.
 /// </summary>
 /// <param name="name">The name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="flags">Flags.</param>
 public FamosFileProperty(string name, double value, FamosFilePropertyFlags flags = 0)
     : this(name, value.ToString(CultureInfo.InvariantCulture), FamosFilePropertyType.Real, flags)
 {
     //
 }