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


C# ConnectionType.ToString方法代码示例

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


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

示例1: PhysicalBridge

 public PhysicalBridge(ServerEndPoint serverEndPoint, ConnectionType type)
 {
     ServerEndPoint = serverEndPoint;
     ConnectionType = type;
     Multiplexer = serverEndPoint.Multiplexer;
     Name = Format.ToString(serverEndPoint.EndPoint) + "/" + ConnectionType.ToString();
     completionManager = new CompletionManager(Multiplexer, Name);
 }
开发者ID:491134648,项目名称:StackExchange.Redis,代码行数:8,代码来源:PhysicalBridge.cs

示例2: PhysicalBridge

 public PhysicalBridge(ServerEndPoint serverEndPoint, ConnectionType type)
 {
     this.serverEndPoint = serverEndPoint;
     this.connectionType = type;
     this.multiplexer = serverEndPoint.Multiplexer;
     this.Name = Format.ToString(serverEndPoint.EndPoint) + "/" + connectionType.ToString();
     this.completionManager = new CompletionManager(multiplexer, Name);
 }
开发者ID:liweisx,项目名称:StackExchange.Redis,代码行数:8,代码来源:PhysicalBridge.cs

示例3: BuildConnectionSource

 /// <summary>Builds a ConnectionSource object give a connection type</summary>
 /// <param name="ConnectionType">ConnectionType value to build a ConnectionSource for</param>
 /// <returns>ConnectionSource object for the given ConnectionType</returns>
 private static ConnectionSource BuildConnectionSource(ConnectionType ConnectionType)
 {
     ConnectionSource source = new ConnectionSource();
     source.Name = ConnectionType.ToString().Replace("_", " ");
     source.ConnType = ConnectionType;
     switch (ConnectionType)
     {
         case ConnectionType.SQL_Server:
             source.AuthTypes = new List<AuthType>() { AuthType.Integrated, AuthType.Basic };
             source.AcceptsDatabase = false;
             source.AcceptsUsername = true;
             source.AcceptsPassword = true;
             source.AllowBrowse = false;
             break;
         case ConnectionType.SQLite:
             source.AuthTypes = new List<AuthType>() { AuthType.None, AuthType.Basic };
             source.AcceptsDatabase = false;
             source.AcceptsUsername = false;
             source.AcceptsPassword = true;
             source.AllowBrowse = true;
             break;
         case ConnectionType.DB2:
             source.AuthTypes = new List<AuthType>() { AuthType.Basic };
             source.AcceptsDatabase = true;
             source.AcceptsUsername = true;
             source.AcceptsPassword = true;
             source.AllowBrowse = false;
             break;
         case ConnectionType.Teradata:
             source.AuthTypes = new List<AuthType>() { AuthType.Basic };
             source.AcceptsDatabase = false;
             source.AcceptsUsername = true;
             source.AcceptsPassword = true;
             source.AllowBrowse = false;
             break;
         case ConnectionType.None:
         default:
             source.AuthTypes = new List<AuthType>() { AuthType.None };
             source.AcceptsDatabase = false;
             source.AcceptsUsername = false;
             source.AcceptsPassword = false;
             source.AllowBrowse = false;
             break;
     }
     DataAccessBase db = GetConnection(ConnectionType);
     source.IsAvailable = db.TestAvailability();
     db.Dispose();
     return source;
 }
开发者ID:meandthewallaby,项目名称:Edrych,代码行数:52,代码来源:DataAccessFactory.cs

示例4: GetConnString

        public static string GetConnString(ConnectionType connectionType = ConnectionType.Naviam)
        {
            if (ConnectionStrings[connectionType] == null)
            {
                string connString = null;
                var connSection = ConfigurationManager.ConnectionStrings[connectionType.ToString()];
                if (connSection != null)
                    connString = connSection.ConnectionString;
                if (!String.IsNullOrEmpty(DataSource) && connString != null && connString.Contains("{0}"))
                    connString = String.Format(connString, DataSource);
                ConnectionStrings[connectionType] = connString;

            }
            return ConnectionStrings[connectionType] as string;
        }
开发者ID:Naviam,项目名称:Home-Accounting-Old,代码行数:15,代码来源:SqlConnectionHelper.cs

示例5: Create

 /// <summary>
 /// Creates a StanzaStream.
 /// </summary>
 /// <param name="kind">Connection type, such as socket, polling, and so on.</param>
 /// <param name="listener">Connection event listeners.</param>
 /// <returns>StanzaStream used to connect to an XMPP server and send stanzas.</returns>
 public static StanzaStream Create(ConnectionType kind, IStanzaEventListener listener)
 {
     switch (kind)
     {
     case ConnectionType.Socket:
         return new SocketStanzaStream(listener);
     case ConnectionType.HTTP_Polling:
         return new PollingStanzaStream(listener);
     case ConnectionType.HTTP_Binding:
         return new BindingStanzaStream(listener);
     default:
         throw new NotImplementedException("Proxy type not implemented yet: " + kind.ToString());
     }
 }
开发者ID:csfmeridian,项目名称:jabber-net,代码行数:20,代码来源:StanzaStream.cs

示例6: ConnectionTypeToString

 /**
  * Return the string for a connection type
  */
 static public string ConnectionTypeToString(ConnectionType t)
 {
   if( t == ConnectionType.Structured ) {
     return "structured";
   }
   if( t == ConnectionType.Leaf ) {
     return "leaf";
   }
   return String.Intern( t.ToString().ToLower() );
 }
开发者ID:johnynek,项目名称:brunet,代码行数:13,代码来源:Connection.cs

示例7: SetDefaultType

 /// <summary>Update a user's settings to change their default connection type</summary>
 /// <param name="ConnectionType">ConnectionType value to set as the default</param>
 public static void SetDefaultType(ConnectionType ConnectionType)
 {
     Settings.Default.DefaultConnection = ConnectionType.ToString();
     Settings.Default.Save();
 }
开发者ID:meandthewallaby,项目名称:Edrych,代码行数:7,代码来源:DataAccessFactory.cs


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