/// <summary>
 /// Initializes a new instance of the PropertyNameObject class.
 /// </summary>
 /// <param name="displayName">A string value indicates the name of property.</param>
 /// <param name="longId">A unsigned integer value indicates property long ID (LID) of specified property.</param>
 /// <param name="propertySet">A string indicates property set of specified property.</param>
 /// <param name="dataType">The date type of specified property.</param>
 public PropertyNameObject(PropertyNames displayName, uint longId, string propertySet, PropertyType dataType)
 {
     this.displayName = displayName;
     this.propertyName.Kind = 0x00;
     this.propertyName.Guid = new Guid(propertySet).ToByteArray();
     this.propertyName.LID = longId;
     this.propertyType = dataType;
 }
 /// <summary>
 /// Initializes a new instance of the PropertyNameObject class.
 /// </summary>
 /// <param name="displayName">A string indicates display name of specified property.</param>
 /// <param name="name">A string indicates property name of specified property.</param>
 /// <param name="propertySet">A string indicates property set of specified property.</param>
 /// <param name="dataType">The date type of specified property.</param>
 public PropertyNameObject(PropertyNames displayName, string name, string propertySet, PropertyType dataType)
 {
     this.displayName = displayName;
     this.propertyName.Kind = 0x01;
     this.propertyName.Guid = new Guid(propertySet).ToByteArray();
     byte[] nameArray = Common.GetBytesFromUnicodeString(name);
     this.propertyName.Name = nameArray;
     this.propertyName.NameSize = (byte)nameArray.Length;
     this.propertyType = dataType;
 }
        /// <summary>
        /// Initialize the properties into the dictionary. 
        /// </summary>
        /// <param name="propertyName">The name of property</param>
        /// <param name="propertyId">Property id</param>
        /// <param name="propertyType">Property type id</param>
        /// <param name="propertyTagDictionary">The dictionary to look up PropertyTag by PropertyName</param>
        private static void InitDictionary(
            PropertyNames propertyName,
            ushort propertyId,
            PropertyType propertyType,
            ref Dictionary<PropertyNames,
            PropertyTag> propertyTagDictionary)
        {
            if (propertyTagDictionary == null)
            {
                propertyTagDictionary = new Dictionary<PropertyNames, PropertyTag>();
            }

            PropertyTag propertyTag = new PropertyTag
            {
                PropertyId = propertyId, PropertyType = (ushort)propertyType
            };
            propertyTagDictionary.Add(propertyName, propertyTag);
        }
示例#4
0
 public BarGraphColumn(PropertyNames textProperty, PropertyNames valueProperty, PropertyNames rankProperty, bool checkTools)
     : base(valueProperty, checkTools)
 {
     this.textProperty = textProperty;
     this.rankProperty = rankProperty;
 }
示例#5
0
 public BarGraphColumn(PropertyNames textProperty, PropertyNames intProperty, bool checkTools)
     : this(textProperty, intProperty, intProperty, false)
 {
 }
示例#6
0
 public BarGraphColumn(PropertyNames textProperty, PropertyNames intProperty)
     : this(textProperty, intProperty, false)
 {
 }
示例#7
0
 public PropertyColumn(PropertyNames property, bool checkTools)
     : base(property, checkTools)
 {
 }
示例#8
0
 public PropertyColumn(PropertyNames property)
     : this(property, false)
 {
 }
示例#9
0
 protected Column(PropertyNames property, bool checkTools)
 {
     this.property = property;
     this.checkTools = checkTools;
 }
 public void Initialize()
 {
     //New instance of Property Names
     _propertyNames = new PropertyNames();
 }
 /// <summary>
 /// Add a PropertyTag object to PropertyTag dictionary.
 /// </summary>
 /// <param name="propertyName">The name of property.</param>
 /// <param name="propertyTag">The PropertyTag object.</param>
 private static void AddPropertyTagToDic(PropertyNames propertyName, PropertyTag propertyTag)
 {
     if (PropertyTagDic.ContainsKey(propertyName) == false)
     {
         PropertyTagDic.Add(propertyName, propertyTag);
     }
 }
        /// <summary>
        /// The extended method for List of PropertyObj to find the exact one by property name.
        /// </summary>
        /// <param name="propertyList">List of PropertyObj</param>
        /// <param name="propertyName">A property name value</param>
        /// <returns>Return propertyObj</returns>
        public static PropertyObj GetPropertyByName(List<PropertyObj> propertyList, PropertyNames propertyName)
        {
            PropertyObj property = null;
            foreach (PropertyObj pt in propertyList)
            {
                if (pt.PropertyName == propertyName)
                {
                    property = pt;
                    break;
                }
            }

            return property;
        }
示例#13
0
文件: Query.cs 项目: huizh/xenadmin
 public QueryFilter GetSubQueryFor(PropertyNames property)
 {
     return (filter == null ? null : filter.GetSubQueryFor(property));
 }
示例#14
0
 public TableExporter <T> Display <TProperty>(Expression <Func <T, TProperty> > properties) => Display(PropertyNames.For(properties));
示例#15
0
 public TableExporter <T> NumberFormatFor <TProperty>(Expression <Func <T, TProperty> > properties, string numberFormat) => NumberFormatFor(PropertyNames.For(properties), numberFormat);
示例#16
0
        /// <summary>
        /// Converts an object to a <see cref="JsonValue"/>.
        /// </summary>
        /// <param name="serializer">The <see cref="JsonSerializer"/> instance to use for additional serialization of values.</param>
        /// <returns>The <see cref="JsonValue"/> representation of the object.</returns>
        public virtual JsonValue ToJson(JsonSerializer serializer)
        {
            if (BooleanSchemaDefinition != null)
            {
                return(BooleanSchemaDefinition);
            }

            serializer = serializer ?? _schemaSerializer;

            var json = new JsonObject();

            if (!string.IsNullOrWhiteSpace(Schema))
            {
                json["$schema"] = Schema;
            }
            if (Id != null)
            {
                json["$id"] = Id;
            }
            if (Comment != null)
            {
                json["$comment"] = Comment;
            }
            if (Title != null)
            {
                json["title"] = Title;
            }
            if (!string.IsNullOrWhiteSpace(Description))
            {
                json["description"] = Description;
            }
            if (Definitions != null)
            {
                json["definitions"] = Definitions.ToJson(serializer);
            }
            if (ReadOnly.HasValue)
            {
                json["readOnly"] = ReadOnly;
            }
            if (Type != JsonSchemaType.NotDefined)
            {
                var array = Type.ToJson();
                if (array.Type == JsonValueType.Array)
                {
                    array.Array.EqualityStandard = ArrayEquality.ContentsEqual;
                }
                json["type"] = array;
            }
            if (Properties != null)
            {
                json["properties"] = Properties.ToJson(serializer);
            }
            if (Maximum.HasValue)
            {
                json["maximum"] = Maximum;
            }
            if (ExclusiveMaximum.HasValue)
            {
                json["exclusiveMaximum"] = ExclusiveMaximum;
            }
            if (Minimum.HasValue)
            {
                json["minimum"] = Minimum;
            }
            if (ExclusiveMinimum.HasValue)
            {
                json["exclusiveMinimum"] = ExclusiveMinimum;
            }
            if (MultipleOf.HasValue)
            {
                json["multipleOf"] = MultipleOf;
            }
            if (MaxLength.HasValue)
            {
                json["maxLength"] = MaxLength;
            }
            if (MinLength.HasValue)
            {
                json["minLength"] = MinLength;
            }
            if (Pattern != null)
            {
                json["pattern"] = Pattern;
            }
            if (AdditionalItems != null)
            {
                json["additionalItems"] = AdditionalItems.ToJson(serializer);
            }
            if (Items != null)
            {
                json["items"] = Items.ToJson(serializer);
            }
            if (MaxItems.HasValue)
            {
                json["maxItems"] = MinItems;
            }
            if (MinItems.HasValue)
            {
                json["minItems"] = MinItems;
            }
            if (UniqueItems ?? false)
            {
                json["uniqueItems"] = UniqueItems;
            }
            if (Contains != null)
            {
                json["contains"] = Contains.ToJson(serializer);
            }
            if (MaxProperties.HasValue)
            {
                json["maxProperties"] = MaxProperties;
            }
            if (MinProperties.HasValue)
            {
                json["minProperties"] = MinProperties;
            }
            if (Required != null)
            {
                json["required"] = Required.ToJson();
            }
            if (AdditionalProperties != null)
            {
                json["additionalProperties"] = AdditionalProperties.ToJson(serializer);
            }
            if (PatternProperties != null && PatternProperties.Any())
            {
                json["patternProperties"] = PatternProperties.ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value).ToJson(serializer);
            }
            if (Dependencies != null && Dependencies.Any())
            {
                var jsonDependencies = new JsonObject();
                foreach (var dependency in Dependencies)
                {
                    jsonDependencies[dependency.PropertyName] = dependency.GetJsonData();
                }
                json["dependencies"] = jsonDependencies;
            }
            if (PropertyNames != null)
            {
                json["propertyNames"] = PropertyNames.ToJson(serializer);
            }
            if (Const != null)
            {
                json["const"] = Const;
            }
            if (Enum != null)
            {
                var array = Enum.ToJson(serializer);
                array.Array.EqualityStandard = ArrayEquality.ContentsEqual;
                json["enum"] = Enum.ToJson(serializer);
            }
            if (Format != null)
            {
                json["format"] = Format.Key;
            }
            if (ContentMediaType != null)
            {
                json["contentMediaType"] = ContentMediaType;
            }
            if (ContentEncoding != null)
            {
                json["contentEncoding"] = serializer.Serialize(ContentEncoding);
            }
            if (If != null)
            {
                json["if"] = If.ToJson(serializer);
            }
            if (Then != null)
            {
                json["then"] = Then.ToJson(serializer);
            }
            if (Else != null)
            {
                json["else"] = Else.ToJson(serializer);
            }
            if (AllOf != null)
            {
                var array = AllOf.Select(s => s.ToJson(serializer)).ToJson();
                array.EqualityStandard = ArrayEquality.ContentsEqual;
                json["allOf"]          = array;
            }
            if (AnyOf != null)
            {
                var array = AnyOf.Select(s => s.ToJson(serializer)).ToJson();
                array.EqualityStandard = ArrayEquality.ContentsEqual;
                json["anyOf"]          = array;
            }
            if (OneOf != null)
            {
                var array = OneOf.Select(s => s.ToJson(serializer)).ToJson();
                array.EqualityStandard = ArrayEquality.ContentsEqual;
                json["oneOf"]          = array;
            }
            if (Not != null)
            {
                json["not"] = Not.ToJson(serializer);
            }
            if (Default != null)
            {
                json["default"] = Default;
            }
            if (Examples != null)
            {
                json["examples"] = Examples;
            }
            if (ExtraneousDetails != null)
            {
                foreach (var kvp in ExtraneousDetails.Where(kvp => !_definedProperties.Contains(kvp.Key)))
                {
                    json[kvp.Key] = kvp.Value;
                }
            }
            return(json);
        }