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


C# BsonType类代码示例

本文整理汇总了C#中BsonType的典型用法代码示例。如果您正苦于以下问题:C# BsonType类的具体用法?C# BsonType怎么用?C# BsonType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: DateTimeSerializationOptions

 /// <summary>
 /// Initializes a new instance of the DateTimeSerializationOptions class.
 /// </summary>
 /// <param name="kind">The DateTimeKind (Local, Unspecified or Utc).</param>
 /// <param name="representation">The external representation.</param>
 public DateTimeSerializationOptions(
     DateTimeKind kind,
     BsonType representation
 ) {
     this.kind = kind;
     this.representation = representation;
 }
开发者ID:redforks,项目名称:mongo-csharp-driver,代码行数:12,代码来源:DateTimeSerializationOptions.cs

示例2: CalculateSize

        public int CalculateSize(BsonType t_Type, List<object> value)
        {
            switch (t_Type)
            {
                case BsonType.Object:
                    {
                        foreach (var p in value)
                        {
                            //Console.WriteLine(new { p });

                            Native.document.body += new IHTMLPre { new { p } };

                        }
                        return -1;
                    }

                case BsonType.Integer:
                    return 4;
                case BsonType.Long:
                    return 8;
                case BsonType.Number:
                    return 8;
                case BsonType.Boolean:
                    return 1;
                case BsonType.Null:
                case BsonType.Undefined:
                    return 0;
                case BsonType.Date:
                    return 8;
                default:
                    return 12;
            }
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:33,代码来源:Application.cs

示例3: CollectionProperty

 public CollectionProperty(string name, BsonType type, string fullName)
 {
     _name = name;
     _type = type;
     _fullName = fullName;
     Children = new Dictionary<string, CollectionProperty>();
 }
开发者ID:stevehjohn,项目名称:Hub,代码行数:7,代码来源:CollectionPropertyAnalyser.cs

示例4: Find

        public static IBehavior Find(BsonType bsonType)
        {
            IBehavior behavior;

            return DsonBehaviors.TryGetValue(bsonType, out behavior)
                ? behavior
                : null;
        }
开发者ID:raymondyong,项目名称:DynamicBson,代码行数:8,代码来源:BehaviorLookup.cs

示例5: RepresentationSerializationOptions

 /// <summary>
 /// Initializes a new instance of the RepresentationSerializationOptions class.
 /// </summary>
 /// <param name="representation">The external representation.</param>
 /// <param name="allowOverflow">Whether to allow overflow.</param>
 /// <param name="allowTruncation">Whether to allow truncation.</param>
 public RepresentationSerializationOptions(
     BsonType representation,
     bool allowOverflow,
     bool allowTruncation
 ) {
     this.representation = representation;
     this.allowOverflow = allowOverflow;
     this.allowTruncation = allowTruncation;
 }
开发者ID:redforks,项目名称:mongo-csharp-driver,代码行数:15,代码来源:RepresentationSerializationOptions.cs

示例6: JsonReaderBookmark

 // constructors
 internal JsonReaderBookmark(BsonReaderState state, BsonType currentBsonType, string currentName, JsonReaderContext context, JsonToken currentToken, BsonValue currentValue, JsonToken pushedToken, int position)
     : base(state, currentBsonType, currentName)
 {
     _context = context.Clone();
     _currentToken = currentToken;
     _currentValue = currentValue;
     _pushedToken = pushedToken;
     _position = position;
 }
开发者ID:moonreplace,项目名称:mongo-csharp-driver,代码行数:10,代码来源:JsonReaderBookmark.cs

示例7: ReturnToBookmark

 public void ReturnToBookmark(PBBsonReaderBookmark bookmark)
 {
     _reader.ReturnToBookmark(bookmark.Bookmark);
     _type = bookmark.Type;
     _name = bookmark.Name;
     _bsonType = bookmark.BsonType;
     _value = bookmark.Value;
     _indent = bookmark.Indent;
     _indentString = bookmark.IndentString;
 }
开发者ID:labeuze,项目名称:source,代码行数:10,代码来源:PBBsonReaderWithBookmark.cs

示例8: BsonReaderBookmark

 protected BsonReaderBookmark(
     BsonReadState state,
     BsonType currentBsonType,
     string currentName
 )
 {
     this.state = state;
     this.currentBsonType = currentBsonType;
     this.currentName = currentName;
 }
开发者ID:kolupaev,项目名称:mongo-csharp-driver,代码行数:10,代码来源:BsonReaderBookmark.cs

示例9: BsonDocumentReaderBookmark

 internal BsonDocumentReaderBookmark(
     BsonDocumentReaderContext context,
     BsonReadState state,
     BsonType currentBsonType
 )
 {
     this.context = context.Clone();
     this.state = state;
     this.currentBsonType = currentBsonType;
 }
开发者ID:swiggin1,项目名称:mongo-csharp-driver,代码行数:10,代码来源:BsonDocumentReaderBookmark.cs

示例10: BsonBinaryReader

 public BsonBinaryReader(
     BsonBuffer buffer,
     BsonBinaryReaderSettings settings
 ) {
     this.buffer = buffer ?? new BsonBuffer();
     this.disposeBuffer = buffer == null; // only call Dispose if we allocated the buffer
     this.settings = settings;
     context = null;
     state = BsonReadState.Initial;
     currentBsonType = BsonType.Document;
 }
开发者ID:kenegozi,项目名称:mongo-csharp-driver,代码行数:11,代码来源:BsonBinaryReader.cs

示例11: EnumRepresentationConvention

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="EnumRepresentationConvention" /> class.
 /// </summary>  
 /// <param name="representation">The serialization representation. 0 is used to detect representation
 /// from the enum itself.</param>
 public EnumRepresentationConvention(BsonType representation)
 {
     if (!((representation == 0) ||
         (representation == BsonType.String) ||
         (representation == BsonType.Int32) ||
         (representation == BsonType.Int64)))
     {
         throw new ArgumentException("Enums can only be represented as String, Int32, Int64 or the type of the enum");
     }
     _representation = representation;
 }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:17,代码来源:EnumRepresentationConvention.cs

示例12: BsonDocumentReaderBookmark

 // constructors
 internal BsonDocumentReaderBookmark(
     BsonReaderState state,
     BsonType currentBsonType,
     string currentName,
     BsonDocumentReaderContext context,
     BsonValue currentValue)
     : base(state, currentBsonType, currentName)
 {
     _context = context.Clone();
     _currentValue = currentValue;
 }
开发者ID:horizon3d,项目名称:SequoiaDB,代码行数:12,代码来源:BsonDocumentReaderBookmark.cs

示例13: TestConvention

 public void TestConvention(BsonType value)
 {
     var convention = new EnumRepresentationConvention(value);
     var classMap = new BsonClassMap<TestClass>();
     var nonEnumMemberMap = classMap.MapMember(x => x.NonEnum);
     var defaultEnumMemberMap = classMap.MapMember(x => x.DefaultEnum);
     var changedEnumMemberMap = classMap.MapMember(x => x.ChangedRepresentationEnum);
     convention.Apply(nonEnumMemberMap);
     convention.Apply(changedEnumMemberMap);
     Assert.AreEqual(value, ((IRepresentationConfigurable)(changedEnumMemberMap.GetSerializer())).Representation);
 }
开发者ID:Bogdan0x400,项目名称:mongo-csharp-driver,代码行数:11,代码来源:EnumRepresentationConventionTests.cs

示例14: BsonBinaryReaderBookmark

 // constructors
 internal BsonBinaryReaderBookmark(
     BsonReaderState state,
     BsonType currentBsonType,
     string currentName,
     BsonBinaryReaderContext context,
     int position)
     : base(state, currentBsonType, currentName)
 {
     _context = context.Clone();
     _position = position;
 }
开发者ID:CloudMetal,项目名称:mongo-csharp-driver,代码行数:12,代码来源:BsonBinaryReaderBookmark.cs

示例15: BsonBinaryReaderBookmark

 internal BsonBinaryReaderBookmark(
     BsonBinaryReaderContext context,
     BsonReadState state,
     BsonType currentBsonType,
     int position
 )
 {
     this.context = context;
     this.state = state;
     this.currentBsonType = currentBsonType;
     this.position = position;
 }
开发者ID:swiggin1,项目名称:mongo-csharp-driver,代码行数:12,代码来源:BsonBinaryReaderBookmark.cs


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