当前位置: 首页>>代码示例>>C#>>正文


C# IVertex.GetProperty方法代码示例

本文整理汇总了C#中IVertex.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IVertex.GetProperty方法的具体用法?C# IVertex.GetProperty怎么用?C# IVertex.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVertex的用法示例。


在下文中一共展示了IVertex.GetProperty方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetValue

        private static IComparable GetValue(this IPropertyDefinition myProperty, IVertex myVertex)
        {
            if (myProperty.RelatedType == null)
                throw new ArgumentException("A property with nor related type is not allowed.");

            if (!myProperty.RelatedType.Name.Equals(GlobalConstants.Vertex))
                return myVertex.GetProperty<IComparable>(myProperty.ID);

            switch (myProperty.Name)
            {
                case GlobalConstants.VertexDotComment:
                    return myVertex.Comment;

                case GlobalConstants.VertexDotCreationDate:
                    return myVertex.CreationDate;

                case GlobalConstants.VertexDotEdition:
                    return myVertex.EditionName;

                case GlobalConstants.VertexDotModificationDate:
                    return myVertex.ModificationDate;

                case GlobalConstants.VertexDotRevision:
                    return myVertex.VertexRevisionID;

                case GlobalConstants.VertexDotVertexTypeID:
                    return myVertex.VertexTypeID;

                case GlobalConstants.VertexDotVertexTypeName:
                    return myProperty.RelatedType.GetDescendantTypesAndSelf().Where(_ => _.ID == myVertex.VertexTypeID).Select(__ => __.Name).FirstOrDefault();

                case GlobalConstants.VertexDotVertexID:
                    return myVertex.VertexID;

                default:
                    throw new System.Exception(
                        "A new property was added to the vertex type Vertex, but this switch stement was not changed.");

            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:40,代码来源:IPropertyDefintionExtension.cs

示例2: GetPropertyMultiplicity

        private static PropertyMultiplicity GetPropertyMultiplicity(IVertex myVertex)
        {
            var multID = myVertex.GetProperty<Byte>((long)AttributeDefinitions.PropertyDotMultiplicity);

            if (!Enum.IsDefined(typeof(PropertyMultiplicity), multID))
                throw new UnknownDBException("The value for the property multiplicity is incorrect.");

            return (PropertyMultiplicity)multID;
        }
开发者ID:loubo,项目名称:sones,代码行数:9,代码来源:BaseGraphStorageManager.cs

示例3: GetIsMandatory

 private static bool GetIsMandatory(IVertex myVertex)
 {
     return myVertex.GetProperty<bool>((long)AttributeDefinitions.PropertyDotIsMandatory);
 }
开发者ID:loubo,项目名称:sones,代码行数:4,代码来源:BaseGraphStorageManager.cs

示例4: GetIndexDotIsUserDefined

 private static bool GetIndexDotIsUserDefined(IVertex myIndexVertex)
 {
     return myIndexVertex.GetProperty<bool>((long)AttributeDefinitions.IndexDotIsUserDefined);
 }
开发者ID:loubo,项目名称:sones,代码行数:4,代码来源:BaseGraphStorageManager.cs

示例5: GetEdgeMultiplicity

        private static EdgeMultiplicity GetEdgeMultiplicity(IVertex myOutgoingEdgeVertex)
        {
            var multID = myOutgoingEdgeVertex.GetProperty<Byte>((long)AttributeDefinitions.OutgoingEdgeDotMultiplicity);

            if (!Enum.IsDefined(typeof(EdgeMultiplicity), multID))
                throw new UnknownDBException("The value for the edge multiplicity is incorrect.");

            return (EdgeMultiplicity)multID;
        }
开发者ID:loubo,项目名称:sones,代码行数:9,代码来源:BaseGraphStorageManager.cs

示例6: CreateIndexDefinition

        public static IIndexDefinition CreateIndexDefinition(IVertex myIndexVertex, IVertexType myDefiningVertexType = null)
        {
            var id = GetUUID(myIndexVertex);
            var props = GetIndexedProperties(myIndexVertex);
            var typeName = GetIndexTypeName(myIndexVertex);
            var edition = myIndexVertex.EditionName;
            var isUserDefined = GetIndexDotIsUserDefined(myIndexVertex);
            var name = GetIndexDotName(myIndexVertex);
            var single = myIndexVertex.GetProperty<bool>((long)AttributeDefinitions.IndexDotIsSingleValue);
            var range = myIndexVertex.GetProperty<bool>((long)AttributeDefinitions.IndexDotIsRange);
            var version = myIndexVertex.GetProperty<bool>((long)AttributeDefinitions.IndexDotIsVersioned);
            var sourceIndex = (myIndexVertex.HasOutgoingEdge((long)AttributeDefinitions.IndexDotSourceIndex))
                ? CreateIndexDefinition(myIndexVertex.GetOutgoingSingleEdge((long)AttributeDefinitions.IndexDotSourceIndex).GetTargetVertex())
                : null;

            myDefiningVertexType = myDefiningVertexType ?? GetDefiningVertexType(myIndexVertex);

            return new IndexDefinition
            {
                ID = id,
                IndexedProperties = props,
                Edition = edition,
                IndexTypeName = typeName,
                IsUserdefined = isUserDefined,
                Name = name,
                VertexType = myDefiningVertexType,
                IsSingle = single,
                IsRange = range,
                IsVersioned = version,
                SourceIndex = sourceIndex,
            };
        }
开发者ID:loubo,项目名称:sones,代码行数:32,代码来源:BaseGraphStorageManager.cs

示例7: CreateIndexEntry

 /// <summary>
 /// Creates a search key by checking which properties are indexed.
 /// </summary>
 /// <param name="myIndexedProperties">Indexed properties</param>
 /// <param name="myVertex">Vertex which shall be stored in the index.</param>
 /// <returns>A search key for that index</returns>
 private static IComparable CreateIndexEntry(IList<Int64> myIndexedProperties, IVertex myVertex)
 {
     if (myIndexedProperties.Count > 1)
     {
         var values = new List<IComparable>(myIndexedProperties.Count);
         for (int i = 0; i < myIndexedProperties.Count; i++)
         {
             if (myVertex.HasProperty(myIndexedProperties[i]))
             {
                 values[i] = myVertex.GetProperty(myIndexedProperties[i]);
             }
         }
         return new ListCollectionWrapper(values);
     }
     else if (myIndexedProperties.Count == 1)
     {
         if (myVertex.HasProperty(myIndexedProperties[0]))
         {
             return myVertex.GetProperty(myIndexedProperties[0]);
         }
         return null;
     }
     throw new ArgumentException("A unique definition must contain at least one element.");
 }
开发者ID:ramz,项目名称:sones,代码行数:30,代码来源:ASonesIndex.cs

示例8: GetAttributeDotIsUserDefined

 private bool GetAttributeDotIsUserDefined(IVertex myVertex)
 {
     return myVertex.GetProperty<bool>((long)AttributeDefinitions.AttributeDotIsUserDefined);
 }
开发者ID:anukat2015,项目名称:sones,代码行数:4,代码来源:BaseGraphStorageManager.cs

示例9: CreateIndexEntry

 /// <summary>
 /// Creates a search key by checking which properties are indexed.
 /// </summary>
 /// <param name="myIndexedProperties">Indexed properties</param>
 /// <param name="myVertex">Vertex which shall be stored in the index.</param>
 /// <returns>A search key for that index</returns>
 private static IComparable CreateIndexEntry(Int64 myIndexedProperty, IVertex myVertex)
 {
     if (myVertex.HasProperty(myIndexedProperty))
     {
         return myVertex.GetProperty(myIndexedProperty);
     }
     return null;
 }
开发者ID:anukat2015,项目名称:sones,代码行数:14,代码来源:ASonesIndex.cs

示例10: CreateIndexEntries

 /// <summary>
 /// Creates a search key by checking which properties are indexed.
 /// </summary>
 /// <param name="myIndexedProperties">Indexed properties</param>
 /// <param name="myVertex">Vertex which shall be stored in the index.</param>
 /// <returns>A search key for that index</returns>
 private static IEnumerable<KeyValuePair<IComparable, long?>> CreateIndexEntries(IList<Int64> myIndexedProperties, IVertex myVertex)
 {
     if (myIndexedProperties.Count > 0)
     {
         var values = new List<KeyValuePair<IComparable,long?>>();
         for (int i = 0; i < myIndexedProperties.Count; i++)
         {
             if (myVertex.HasProperty(myIndexedProperties[i]))
             {
                 values.Add(new KeyValuePair<IComparable,long?>(myVertex.GetProperty(myIndexedProperties[i]), myVertex.VertexID));
             }
         }
         return values;
     }
     throw new ArgumentException("A unique definition must contain at least one element.");
 }
开发者ID:anukat2015,项目名称:sones,代码行数:22,代码来源:ASonesIndex.cs


注:本文中的IVertex.GetProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。