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


C# NpgsqlConnector.AddNotificationThread方法代码示例

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


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

示例1: Open

		/// <summary>
		/// Opens a database connection with the property settings specified by the
		/// <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>.
		/// </summary>
		public override void Open()
		{
			CheckConnectionClosed();

			NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Open");

			// Check if there is any missing argument.
			if (!settings.ContainsKey(Keywords.Host))
			{
				throw new ArgumentException(resman.GetString("Exception_MissingConnStrArg"),
											NpgsqlConnectionStringBuilder.GetKeyName(Keywords.Host));
			}
			if (!settings.ContainsKey(Keywords.UserName) && !settings.ContainsKey(Keywords.IntegratedSecurity))
			{
				throw new ArgumentException(resman.GetString("Exception_MissingConnStrArg"),
											NpgsqlConnectionStringBuilder.GetKeyName(Keywords.UserName));
			}

			// Get a Connector.  The connector returned is guaranteed to be connected and ready to go.
			connector = NpgsqlConnectorPool.ConnectorPoolMgr.RequestConnector(this);

			connector.Notice += NoticeDelegate;
			connector.Notification += NotificationDelegate;

			if (SyncNotification)
			{
				connector.AddNotificationThread();
			}

			if (Enlist)
			{
				Promotable.Enlist(Transaction.Current);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:38,代码来源:NpgsqlConnection.cs

示例2: Open

        /// <summary>
        /// Opens a database connection with the property settings specified by the
        /// <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>.
        /// </summary>
        public void Open()
        {
            CheckConnectionClosed();

            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Open");

            // Check if there is any missing argument.
            if (! connection_string.Contains(ConnectionStringKeys.Host))
                throw new ArgumentException(resman.GetString("Exception_MissingConnStrArg"), ConnectionStringKeys.Host);
            if (! connection_string.Contains(ConnectionStringKeys.UserName))
                throw new ArgumentException(resman.GetString("Exception_MissingConnStrArg"), ConnectionStringKeys.UserName);

            // Get a Connector.  The connector returned is guaranteed to be connected and ready to go.
            connector = NpgsqlConnectorPool.ConnectorPoolMgr.RequestConnector (this);
            
            connector.Notice += NoticeDelegate;
            connector.Notification += NotificationDelegate;
            
            if (SyncNotification)
                connector.AddNotificationThread();
            
        }
开发者ID:nlhepler,项目名称:mono,代码行数:26,代码来源:NpgsqlConnection.cs


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