• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GuidRepresentation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MongoServerSettings

        // constructors
        /// <summary>
        /// Creates a new instance of MongoServerSettings. Usually you would use a connection string instead.
        /// </summary>
        public MongoServerSettings()
        {
            _connectionMode = ConnectionMode.Automatic;
            _connectTimeout = MongoDefaults.ConnectTimeout;
            _credentialsStore = new MongoCredentialsStore();
            _defaultCredentials = null;
            _guidRepresentation = MongoDefaults.GuidRepresentation;
            _ipv6 = false;
            _maxConnectionIdleTime = MongoDefaults.MaxConnectionIdleTime;
            _maxConnectionLifeTime = MongoDefaults.MaxConnectionLifeTime;
            _maxConnectionPoolSize = MongoDefaults.MaxConnectionPoolSize;
            _minConnectionPoolSize = MongoDefaults.MinConnectionPoolSize;
            _readPreference = ReadPreference.Primary;
            _replicaSetName = null;
            _secondaryAcceptableLatency = MongoDefaults.SecondaryAcceptableLatency;
            _servers = new List<MongoServerAddress> { new MongoServerAddress("localhost") };
            _socketTimeout = MongoDefaults.SocketTimeout;
            _useSsl = false;
            _verifySslCertificate = true;
            _waitQueueSize = MongoDefaults.ComputedWaitQueueSize;
            _waitQueueTimeout = MongoDefaults.WaitQueueTimeout;
#pragma warning disable 612, 618
            _writeConcern = MongoDefaults.SafeMode.WriteConcern;
#pragma warning restore
        }
开发者ID:tkellogg,项目名称:mongo-csharp-driver,代码行数:29,代码来源:MongoServerSettings.cs


示例2: MongoUrlBuilder

 // constructors
 /// <summary>
 /// Creates a new instance of MongoUrlBuilder.
 /// </summary>
 public MongoUrlBuilder()
 {
     _authenticationMechanism = MongoDefaults.AuthenticationMechanism;
     _authenticationSource = null;
     _connectionMode = ConnectionMode.Automatic;
     _connectTimeout = MongoDefaults.ConnectTimeout;
     _databaseName = null;
     _fsync = null;
     _guidRepresentation = MongoDefaults.GuidRepresentation;
     _ipv6 = false;
     _journal = null;
     _maxConnectionIdleTime = MongoDefaults.MaxConnectionIdleTime;
     _maxConnectionLifeTime = MongoDefaults.MaxConnectionLifeTime;
     _maxConnectionPoolSize = MongoDefaults.MaxConnectionPoolSize;
     _minConnectionPoolSize = MongoDefaults.MinConnectionPoolSize;
     _password = null;
     _readPreference = null;
     _replicaSetName = null;
     _servers = null;
     _slaveOk = null;
     _socketTimeout = MongoDefaults.SocketTimeout;
     _username = null;
     _useSsl = false;
     _verifySslCertificate = true;
     _w = null;
     _waitQueueMultiple = MongoDefaults.WaitQueueMultiple;
     _waitQueueSize = MongoDefaults.WaitQueueSize;
     _waitQueueTimeout = MongoDefaults.WaitQueueTimeout;
     _wTimeout = null;
 }
开发者ID:wireclub,项目名称:mongo-csharp-driver,代码行数:34,代码来源:MongoUrlBuilder.cs


示例3: MongoDatabaseSettings

        /// <summary>
        /// Creates a new instance of MongoDatabaseSettings.
        /// </summary>
        /// <param name="databaseName">The name of the database.</param>
        /// <param name="credentials">The credentials to access the database.</param>
        /// <param name="guidRepresentation">The representation for Guids.</param>
        /// <param name="readPreference">The read preference.</param>
        /// <param name="writeConcern">The write concern to use.</param>
        public MongoDatabaseSettings(
            string databaseName,
            MongoCredentials credentials,
            GuidRepresentation guidRepresentation,
            ReadPreference readPreference,
            WriteConcern writeConcern)
        {
            if (databaseName == null)
            {
                throw new ArgumentNullException("databaseName");
            }
            if (databaseName == "admin" && credentials != null && !credentials.Admin)
            {
                throw new ArgumentOutOfRangeException("credentials", "Credentials for the admin database must have the admin flag set to true.");
            }
            if (readPreference == null)
            {
                throw new ArgumentNullException("readPreference");
            }
            if (writeConcern == null)
            {
                throw new ArgumentNullException("writeConcern");
            }

            _databaseName = databaseName;
            _credentials = credentials;
            _guidRepresentation = guidRepresentation;
            _readPreference = readPreference;
            _writeConcern = writeConcern;
        }
开发者ID:staywellandy,项目名称:mongo-csharp-driver,代码行数:38,代码来源:MongoDatabaseSettings.cs


示例4: MongoUrlBuilder

 // constructors
 /// <summary>
 /// Creates a new instance of MongoUrlBuilder.
 /// </summary>
 public MongoUrlBuilder()
 {
     _connectionMode = ConnectionMode.Automatic;
     _connectTimeout = MongoDefaults.ConnectTimeout;
     _databaseName = null;
     _defaultCredentials = null;
     _fsync = null;
     _guidRepresentation = MongoDefaults.GuidRepresentation;
     _ipv6 = false;
     _journal = null;
     _maxConnectionIdleTime = MongoDefaults.MaxConnectionIdleTime;
     _maxConnectionLifeTime = MongoDefaults.MaxConnectionLifeTime;
     _maxConnectionPoolSize = MongoDefaults.MaxConnectionPoolSize;
     _minConnectionPoolSize = MongoDefaults.MinConnectionPoolSize;
     _readPreference = null;
     _replicaSetName = null;
     _secondaryAcceptableLatency = MongoDefaults.SecondaryAcceptableLatency;
     _servers = null;
     _slaveOk = null;
     _socketTimeout = MongoDefaults.SocketTimeout;
     _useSsl = false;
     _verifySslCertificate = true;
     _w = null;
     _waitQueueMultiple = MongoDefaults.WaitQueueMultiple;
     _waitQueueSize = MongoDefaults.WaitQueueSize;
     _waitQueueTimeout = MongoDefaults.WaitQueueTimeout;
     _wTimeout = null;
 }
开发者ID:CloudMetal,项目名称:mongo-csharp-driver,代码行数:32,代码来源:MongoUrlBuilder.cs


示例5: JsonReaderSettings

 /// <summary>
 /// Initializes a new instance of the JsonReaderSettings class.
 /// </summary>
 /// <param name="closeInput">Whether to close the input stream when the reader is closed.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 public JsonReaderSettings(
     bool closeInput,
     GuidRepresentation guidRepresentation
 ) {
     this.closeInput = closeInput;
     this.guidRepresentation = guidRepresentation;
 }
开发者ID:emiaj,项目名称:mongo-csharp-driver,代码行数:12,代码来源:JsonReaderSettings.cs


示例6: BsonBinaryWriterSettings

 /// <summary>
 /// Initializes a new instance of the BsonBinaryWriterSettings class.
 /// </summary>
 /// <param name="closeOutput">Whether to close the output stream when the writer is closed.</param>
 /// <param name="fixOldBinarySubTypeOnOutput">Whether to fix old binary data subtype on output.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="maxDocumentSize">The max document size.</param>
 public BsonBinaryWriterSettings(bool closeOutput, bool fixOldBinarySubTypeOnOutput, GuidRepresentation guidRepresentation, int maxDocumentSize)
     : base(guidRepresentation)
 {
     _closeOutput = closeOutput;
     _fixOldBinarySubTypeOnOutput = fixOldBinarySubTypeOnOutput;
     _maxDocumentSize = maxDocumentSize;
 }
开发者ID:moonreplace,项目名称:mongo-csharp-driver,代码行数:14,代码来源:BsonBinaryWriterSettings.cs


示例7: MongoDatabaseSettings

 /// <summary>
 /// Creates a new instance of MongoDatabaseSettings.
 /// </summary>
 /// <param name="databaseName">The name of the database.</param>
 /// <param name="credentials">The credentials to access the database.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="safeMode">The safe mode to use.</param>
 /// <param name="slaveOk">Whether queries should be sent to secondary servers.</param>
 public MongoDatabaseSettings(string databaseName, MongoCredentials credentials, GuidRepresentation guidRepresentation, SafeMode safeMode, bool slaveOk)
 {
     _databaseName = databaseName;
     _credentials = credentials;
     _guidRepresentation = guidRepresentation;
     _safeMode = safeMode;
     _slaveOk = slaveOk;
 }
开发者ID:moonreplace,项目名称:mongo-csharp-driver,代码行数:16,代码来源:MongoDatabaseSettings.cs


示例8: MongoDatabaseSettings

 /// <summary>
 /// Creates a new instance of MongoDatabaseSettings.
 /// </summary>
 /// <param name="databaseName">The name of the database.</param>
 /// <param name="credentials">The credentials to access the database.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="safeMode">The safe mode to use.</param>
 /// <param name="slaveOk">Whether queries should be sent to secondary servers.</param>
 public MongoDatabaseSettings(string databaseName, MongoCredentials credentials, GuidRepresentation guidRepresentation, SafeMode safeMode, ReadPreference readPreference)
 {
     this.databaseName = databaseName;
     this.credentials = credentials;
     this.guidRepresentation = guidRepresentation;
     this.safeMode = safeMode;
     this.readPreference = readPreference;
 }
开发者ID:kamaradclimber,项目名称:mongo-csharp-driver,代码行数:16,代码来源:MongoDatabaseSettings.cs


示例9: BsonBinaryReaderSettings

 /// <summary>
 /// Initializes a new instance of the BsonBinaryReaderSettings class.
 /// </summary>
 /// <param name="closeInput">Whether to close the input stream when the reader is closed.</param>
 /// <param name="fixOldBinarySubTypeOnInput">Whether to fix occurrences of the old binary subtype on input.</param>
 /// <param name="fixOldDateTimeMaxValueOnInput">Whether to fix occurrences of the old representation of DateTime.MaxValue on input.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="maxDocumentSize">The max document size.</param>
 public BsonBinaryReaderSettings(bool closeInput, bool fixOldBinarySubTypeOnInput, bool fixOldDateTimeMaxValueOnInput, GuidRepresentation guidRepresentation, int maxDocumentSize)
     : base(guidRepresentation)
 {
     this.closeInput = closeInput;
     this.fixOldBinarySubTypeOnInput = fixOldBinarySubTypeOnInput;
     this.fixOldDateTimeMaxValueOnInput = fixOldDateTimeMaxValueOnInput;
     this.maxDocumentSize = maxDocumentSize;
 }
开发者ID:kamaradclimber,项目名称:mongo-csharp-driver,代码行数:16,代码来源:BsonBinaryReaderSettings.cs


示例10: ReadJson_should_return_expected_result_when_using_native_bson_reader

        public void ReadJson_should_return_expected_result_when_using_native_bson_reader(string json, GuidRepresentation guidRepresentation, string nullableHexBytes, BsonBinarySubType subType)
        {
            var subject = new BsonBinaryDataConverter();
            var expectedResult = nullableHexBytes == null ? null : new BsonBinaryData(BsonUtils.ParseHexString(nullableHexBytes), subType);

            var result = ReadJsonUsingNativeBsonReader<BsonBinaryData>(subject, ToBson(json, guidRepresentation), mustBeNested: true);

            result.Should().Be(expectedResult);
        }
开发者ID:rstam,项目名称:mongo-csharp-driver-jsondotnet-original,代码行数:9,代码来源:BsonBinaryDataConverterTests.cs


示例11: MongoDatabaseSettings

 // constructors
 /// <summary>
 /// Creates a new instance of MongoDatabaseSettings.
 /// </summary>
 /// <param name="server">The server to inherit settings from.</param>
 /// <param name="databaseName">The name of the database.</param>
 public MongoDatabaseSettings(MongoServer server, string databaseName)
 {
     var serverSettings = server.Settings;
     _databaseName = databaseName;
     _credentials = serverSettings.DefaultCredentials;
     _guidRepresentation = serverSettings.GuidRepresentation;
     _safeMode = serverSettings.SafeMode;
     _slaveOk = serverSettings.SlaveOk;
 }
开发者ID:purplecow,项目名称:mongo-csharp-driver,代码行数:15,代码来源:MongoDatabaseSettings.cs


示例12: MongoCollectionSettings

 // constructors
 /// <summary>
 /// Initializes a new instance of the MongoCollectionSettings class.
 /// </summary>
 /// <param name="database">The database that contains the collection (some collection settings will be inherited from the database settings).</param>
 /// <param name="collectionName">The name of the collection.</param>
 /// <param name="defaultDocumentType">The default document type for the collection.</param>
 protected MongoCollectionSettings(MongoDatabase database, string collectionName, Type defaultDocumentType)
 {
     var databaseSettings = database.Settings;
     _collectionName = collectionName;
     _assignIdOnInsert = MongoDefaults.AssignIdOnInsert;
     _defaultDocumentType = defaultDocumentType;
     _guidRepresentation = databaseSettings.GuidRepresentation;
     _safeMode = databaseSettings.SafeMode;
     _slaveOk = databaseSettings.SlaveOk;
 }
开发者ID:abel,项目名称:sinan,代码行数:17,代码来源:MongoCollectionSettings.cs


示例13: BsonBinaryReaderSettings

 /// <summary>
 /// Initializes a new instance of the BsonBinaryReaderSettings class.
 /// </summary>
 /// <param name="closeInput">Whether to close the input stream when the reader is closed.</param>
 /// <param name="fixOldBinarySubTypeOnInput">Whether to fix occurrences of the old binary subtype on input.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="maxDocumentSize">The max document size.</param>
 public BsonBinaryReaderSettings(
     bool closeInput,
     bool fixOldBinarySubTypeOnInput,
     GuidRepresentation guidRepresentation,
     int maxDocumentSize
 ) {
     this.closeInput = closeInput;
     this.fixOldBinarySubTypeOnInput = fixOldBinarySubTypeOnInput;
     this.guidRepresentation = guidRepresentation;
     this.maxDocumentSize = maxDocumentSize;
 }
开发者ID:emiaj,项目名称:mongo-csharp-driver,代码行数:18,代码来源:BsonBinaryReaderSettings.cs


示例14: JsonWriterSettings

 /// <summary>
 /// Initializes a new instance of the JsonWriterSettings class.
 /// </summary>
 /// <param name="closeOutput">Whether to close the output when the writer is closed.</param>
 /// <param name="encoding">The output Encoding.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="indent">Whether to indent the output.</param>
 /// <param name="indentChars">The indentation characters.</param>
 /// <param name="newLineChars">The new line characters.</param>
 /// <param name="outputMode">The output mode.</param>
 /// <param name="shellVersion">The version of the shell to target.</param>
 public JsonWriterSettings(bool closeOutput, Encoding encoding, GuidRepresentation guidRepresentation, bool indent, string indentChars, string newLineChars, JsonOutputMode outputMode, Version shellVersion)
     : base(guidRepresentation)
 {
     _closeOutput = closeOutput;
     _encoding = encoding;
     _indent = indent;
     _indentChars = indentChars;
     _newLineChars = newLineChars;
     _outputMode = outputMode;
     _shellVersion = shellVersion;
 }
开发者ID:moonreplace,项目名称:mongo-csharp-driver,代码行数:22,代码来源:JsonWriterSettings.cs


示例15: ReadBinaryData

 /// <summary>
 /// Reads BSON binary data from the reader.
 /// </summary>
 /// <param name="bytes">The binary data.</param>
 /// <param name="subType">The binary data subtype.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 public override void ReadBinaryData(
     out byte[] bytes,
     out BsonBinarySubType subType,
     out GuidRepresentation guidRepresentation
 ) {
     if (disposed) { ThrowObjectDisposedException(); }
     VerifyBsonType("ReadBinaryData", BsonType.Binary);
     state = GetNextState();
     var binaryData = currentValue.AsBsonBinaryData;
     bytes = binaryData.Bytes;
     subType = binaryData.SubType;
     guidRepresentation = binaryData.GuidRepresentation;
 }
开发者ID:afinnell,项目名称:mongo-csharp-driver,代码行数:19,代码来源:JsonReader.cs


示例16: MongoDatabaseSettings

 /// <summary>
 /// Creates a new instance of MongoDatabaseSettings. Usually you would call MongoServer.CreateDatabaseSettings instead.
 /// </summary>
 /// <param name="databaseName">The name of the database.</param>
 /// <param name="credentials">The credentials to access the database.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="safeMode">The safe mode to use.</param>
 /// <param name="slaveOk">Whether queries should be sent to secondary servers.</param>
 public MongoDatabaseSettings(
     string databaseName,
     MongoCredentials credentials,
     GuidRepresentation guidRepresentation,
     SafeMode safeMode,
     bool slaveOk
 ) {
     this.databaseName = databaseName;
     this.credentials = credentials;
     this.guidRepresentation = guidRepresentation;
     this.safeMode = safeMode;
     this.slaveOk = slaveOk;
 }
开发者ID:redforks,项目名称:mongo-csharp-driver,代码行数:21,代码来源:MongoDatabaseSettings.cs


示例17: MongoCollectionSettings

 protected MongoCollectionSettings(
     string collectionName,
     bool assignIdOnInsert,
     Type defaultDocumentType,
     GuidRepresentation guidRepresentation,
     SafeMode safeMode,
     bool slaveOk
 ) {
     this.collectionName = collectionName;
     this.assignIdOnInsert = assignIdOnInsert;
     this.defaultDocumentType = defaultDocumentType;
     this.guidRepresentation = guidRepresentation;
     this.safeMode = safeMode;
     this.slaveOk = slaveOk;
 }
开发者ID:redforks,项目名称:mongo-csharp-driver,代码行数:15,代码来源:MongoCollectionSettings.cs


示例18: JsonWriterSettings

 /// <summary>
 /// Initializes a new instance of the JsonWriterSettings class.
 /// </summary>
 /// <param name="closeOutput">Whether to close the output when the writer is closed.</param>
 /// <param name="encoding">The output Encoding.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="indent">Whether to indent the output.</param>
 /// <param name="indentChars">The indentation characters.</param>
 /// <param name="newLineChars">The new line characters.</param>
 /// <param name="outputMode">The output mode.</param>
 public JsonWriterSettings(
     bool closeOutput,
     Encoding encoding,
     GuidRepresentation guidRepresentation,
     bool indent,
     string indentChars,
     string newLineChars,
     JsonOutputMode outputMode
 ) 
     : base(guidRepresentation) {
     this.closeOutput = closeOutput;
     this.encoding = encoding;
     this.indent = indent;
     this.indentChars = indentChars;
     this.newLineChars = newLineChars;
     this.outputMode = outputMode;
 }
开发者ID:simi--,项目名称:mongo-csharp-driver,代码行数:27,代码来源:JsonWriterSettings.cs


示例19: MongoDatabaseSettings

 /// <summary>
 /// Creates a new instance of MongoDatabaseSettings.
 /// </summary>
 /// <param name="databaseName">The name of the database.</param>
 /// <param name="credentials">The credentials to access the database.</param>
 /// <param name="guidRepresentation">The representation for Guids.</param>
 /// <param name="safeMode">The safe mode to use.</param>
 /// <param name="slaveOk">Whether queries should be sent to secondary servers.</param>
 public MongoDatabaseSettings(
     string databaseName,
     MongoCredentials credentials,
     GuidRepresentation guidRepresentation,
     SafeMode safeMode,
     bool slaveOk)
 {
     if (databaseName == "admin" && credentials != null && !credentials.Admin)
     {
         throw new ArgumentOutOfRangeException("Credentials for the admin database must have the admin flag set to true.");
     }
     _databaseName = databaseName;
     _credentials = credentials;
     _guidRepresentation = guidRepresentation;
     _safeMode = safeMode;
     _slaveOk = slaveOk;
 }
开发者ID:abel,项目名称:sinan,代码行数:25,代码来源:MongoDatabaseSettings.cs


示例20: MongoServerSettings

 /// <summary>
 /// Creates a new instance of MongoServerSettings. Usually you would use a connection string instead.
 /// </summary>
 public MongoServerSettings() {
     connectionMode = ConnectionMode.Direct;
     connectTimeout = MongoDefaults.ConnectTimeout;
     defaultCredentials = null;
     guidRepresentation = MongoDefaults.GuidRepresentation;
     ipv6 = false;
     maxConnectionIdleTime = MongoDefaults.MaxConnectionIdleTime;
     maxConnectionLifeTime = MongoDefaults.MaxConnectionLifeTime;
     maxConnectionPoolSize = MongoDefaults.MaxConnectionPoolSize;
     minConnectionPoolSize = MongoDefaults.MinConnectionPoolSize;
     replicaSetName = null;
     safeMode = MongoDefaults.SafeMode;
     servers = null;
     slaveOk = false;
     socketTimeout = MongoDefaults.SocketTimeout;
     waitQueueSize = MongoDefaults.ComputedWaitQueueSize;
     waitQueueTimeout = MongoDefaults.WaitQueueTimeout;
 }
开发者ID:redforks,项目名称:mongo-csharp-driver,代码行数:21,代码来源:MongoServerSettings.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Guild类代码示例发布时间:2022-05-24
下一篇:
C# GuidId类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap