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


C# ConnectionType类代码示例

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


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

示例1: NetworkInformationOnNetworkStatusChanged

        private void NetworkInformationOnNetworkStatusChanged(object sender)
        {
            ConnectionType = GetConnectionType();

            if(ConnectionChanged != null)
                ConnectionChanged();
        }
开发者ID:ravado,项目名称:Foodler,代码行数:7,代码来源:DeviceInfo.cs

示例2: Instance

        public Instance(AppSettings settings, string instanceName, ConnectionType type)
        {
            //is this necessary to store?
            _connectionType = type;

            _settings = settings;

            if (!_settings.WorkingPath.Exists)
            {
                _settings.WorkingPath.Create();
            }

            if (!_settings.TransferPath.Exists)
            {
                _settings.TransferPath.Create();
            }

            Connection = new Connection(type, settings, instanceName);

            Connection.Service.Instance = this;

            Connection.LostConnection += new EventHandler<ExceptionEventArgs>(Connection_LostConnection);
            Connection.MessageReceived += new EventHandler<MessageEventArgs>(Connection_MessageReceived);
            Connection.MessageSending += new EventHandler<MessageEventArgs>(Connection_MessageSending);
            Connection.ConnectionMade += new EventHandler(Connection_ConnectionMade);
            Connection.ConnectionTermainated += new EventHandler(Connection_ConnectionTermainated);
        }
开发者ID:gregorypilar,项目名称:interlace,代码行数:27,代码来源:Instance.cs

示例3: Connection

 public Connection(string source, string destination, ConnectionType type, string fbType)
 {
     Source = source;
     Destination = destination;
     Type = type;
     FBType = fbType;
 }
开发者ID:hermixy,项目名称:fb2smv,代码行数:7,代码来源:Composite.cs

示例4: ReadConfig

        static void ReadConfig()
        {
            if (!IsInitialized)
                throw new InvalidOperationException("AuthServer config not initialized.");

            AuthDBType          = config.Read("AuthDB.Type", ConnectionType.MySql);
            AuthDBHost          = config.Read("AuthDB.Host", "127.0.0.1");
            AuthDBPort          = config.Read("AuthDB.Port", 3306);
            AuthDBUser          = config.Read("AuthDB.User", "root");
            AuthDBPassword      = config.Read("AuthDB.Password", "");
            AuthDBDataBase      = config.Read("AuthDB.Database", "AuthDB");

            AuthDBMinPoolSize   = config.Read("AuthDB.MinPoolSize", 5);
            AuthDBMaxPoolSize   = config.Read("AuthDB.MaxPoolSize", 30);

            BindIP              = config.Read("Bind.IP", "0.0.0.0");
            BindPort            = config.Read("Bind.Port", 1119);

            RealmListUpdateTime = config.Read("RealmList.UpdateTime", 5) * 60000;

            PatchFileDirectory  = config.Read("Patch.File.Directory", "PatchFiles");

            WorldServiceHost = config.Read("WorldService.Host", "127.0.0.1");
            WorldServiceName = config.Read("WorldService.Name", "WorldService");
        }
开发者ID:LuigiElleBalotta,项目名称:Project-WoW,代码行数:25,代码来源:AuthConfig.cs

示例5: AddConnection

        public void AddConnection(TermNode termNode, ConnectionType type)
        {
            if (this._connectedTerms == null)
                this._connectedTerms = new Dictionary<TermNode, ConnectionType>();

            this._connectedTerms.Add(termNode, type);
        }
开发者ID:Deli-SK,项目名称:NSA-Edge,代码行数:7,代码来源:SentenceNode.cs

示例6: Connector

        public Connector()
        {
            Type[] types = new Type[] { typeof(Connector), typeof(PuzzleElement),typeof(PageElement),
                typeof(GoalElement), typeof(MissionElement), typeof(ContextSoundElement), typeof(UG_Elements.UG_ContentItem),
                typeof(QuestionElement)};

            ConnectionType acceptedBottom = new ConnectionType(ThumbPosition.Bottom,
                                                            typeof(Connector),
                                                            ThumbPosition.Top,
                                                            types);

            ConnectionType acceptedRight = new ConnectionType(ThumbPosition.Right,
                                                            typeof(Connector),
                                                            ThumbPosition.Top,
                                                            types);

            ConnectionType acceptedLeft= new ConnectionType(ThumbPosition.Left,
                                                            typeof(Connector),
                                                            ThumbPosition.Top,
                                                            types);

            Connections.Add(ThumbPosition.Bottom,acceptedBottom);
            Connections.Add(ThumbPosition.Right, acceptedRight);
            Connections.Add(ThumbPosition.Left, acceptedLeft);
        }
开发者ID:lokswin,项目名称:ivu-cher,代码行数:25,代码来源:Connector.cs

示例7: ServerThread

 public ServerThread(string localAddress, int localPort, ConnectionType connectionType)
 {
     _LocalAddress = localAddress;
     _LocalPort = localPort;
     _ConnectionType = connectionType;
     _Paused = false;
 }
开发者ID:Robin--,项目名称:GameSrv,代码行数:7,代码来源:ServerThread.cs

示例8: ConnectorSettings

        internal ConnectorSettings(ConnectionType cType)
        {
            ConnectionType = cType;

            if (cType == ConnectionType.MYSQL)
            {
                if (!File.Exists(Environment.CurrentDirectory + "/MySql.Data.dll"))
                {
                    Console.WriteLine("MySql.Data.dll doesn't exist.");

                    return;
                }

                assembly = Assembly.LoadFile(Environment.CurrentDirectory + "/MySql.Data.dll");
                type = "MySql.Data.MySqlClient.MySql";
            }
            else if (cType == ConnectionType.MSSQL)
            {
                // System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
                #pragma warning disable 612 // For mono...
                #pragma warning disable 618 // Visual studio...
                assembly = Assembly.LoadWithPartialName("System.Data");
                #pragma warning restore 612
                #pragma warning restore 618

                type = "System.Data.SqlClient.Sql";
            }
        }
开发者ID:Extred,项目名称:LappaORM,代码行数:28,代码来源:ConnectorSettings.cs

示例9: GetPhoneNumbers

        public static List<MobileConnection> GetPhoneNumbers(int customerid,ConnectionType type)
        {
            List<MobileConnection> mobileConnectionList = new List<MobileConnection>();
            using (SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[Connection.ConnectionName].ConnectionString))
            {
                string sqlstmt = "select c.customerid, c.pnumber, c.schemeid \"schemeid\", s.ctype, s.provider from [dbo].[MobileConnection] c INNER JOIN [dbo].[MobileScheme] s ON c.schemeid = s.id where c.customerid = @customerid and s.ctype = @type";
                SqlCommand myCommand = new SqlCommand(sqlstmt, myConnection);
                myCommand.CommandType = CommandType.Text;
                myCommand.Parameters.AddWithValue("@customerid", customerid);
                myCommand.Parameters.AddWithValue("@type", type);

                myConnection.Open();
                using (SqlDataReader myReader = myCommand.ExecuteReader())
                {
                    while (myReader.Read())
                    {
                        MobileConnection mobileConnection = FillDataRecord(myReader);
                        mobileConnectionList.Add(mobileConnection);
                    }
                    myReader.Close();
                }
                myConnection.Close();
            }
            return mobileConnectionList;
        }
开发者ID:sunnyrajrathod,项目名称:OnePointTelecom,代码行数:25,代码来源:MobileConnectionDB.cs

示例10: SetConfig

 public void SetConfig(ConnectionType conType, string host, int port, bool useSSL, string username, string password)
 {
     // Get new Worker by conType
     // For now only use IMAP
     createWorker(conType);
     _emailWorker.SetConfig(host, port, useSSL, username, password);
 }
开发者ID:ttu,项目名称:Email-Statistics,代码行数:7,代码来源:Controller.cs

示例11: GenerateSettingKey

 private string GenerateSettingKey(ConnectionType connectionType, DownloadContentType downloadContentType)
 {
     var res = "";
     switch (connectionType)
     {
         case ConnectionType.Mobile:
             res += "Mobile";
             break;
         case ConnectionType.Wlan:
             res += "Wlan";
             break;
         case ConnectionType.None:
             res += "None";
             break;
     }
     switch (downloadContentType)
     {
         case DownloadContentType.Any:
             res += "Any";
             break;
         case DownloadContentType.Article:
             res += "Article";
             break;
         case DownloadContentType.Feed:
             res += "Feed";
             break;
         case DownloadContentType.Image:
             res += "Image";
             break;
     }
     return res;
 }
开发者ID:famoser,项目名称:OfflineMedia,代码行数:32,代码来源:PermissionService.cs

示例12: DBHelper

 public DBHelper(ConnectionType conncetionType, DataBaseType DBMSType,string strDBFileNamePath)
 {
     DbConnectionType = conncetionType;
     dbType = DBMSType;
     S_DBFILENAME = strDBFileNamePath;
     oFactory = DbProviderFactories.GetFactory(RetreiveConnectionString());
 }
开发者ID:shreykejriwal,项目名称:insta,代码行数:7,代码来源:DBHelper.cs

示例13: Connection

 public Connection(Point e1, Point e2, ConnectionType t, Figure so)
 {
     endpoint1 = e1;
     endpoint2 = e2;
     type = t;
     segmentOrArc = so;
 }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:7,代码来源:Connection.cs

示例14: Add

            public void Add(string key, Guid connectionId, ConnectionType connectionType)
            {
                lock (_connections)
                {
                    Connections connection;
                    if (!_connections.TryGetValue(key, out connection))
                    {
                        connection = new Connections();
                        if (connectionType == ConnectionType.Device)
                        {
                            connection.DeviceConnectionId = connectionId;
                        }
                        else
                        {
                            connection.UserConnectionId = connectionId;
                        }
                        _connections.Add(key, connection);
                    }

                    lock (connection)
                    {
                        if (connectionType == ConnectionType.Device)
                        {
                            connection.DeviceConnectionId = connectionId;
                        }
                        else
                        {
                            connection.UserConnectionId = connectionId;
                        }
                    }
                }
            }
开发者ID:TomKaminski,项目名称:ITAD2015,代码行数:32,代码来源:CheckInHubConnectionMapping.cs

示例15: GetListenerPrefixes

        internal static List<string> GetListenerPrefixes(ConnectionType connection, string[] hosts, int[] ports)
        {
            List<string> prefixes = new List<string>();

            foreach (string ip in hosts)
            {
                //Go through each port on that IP
                foreach (int port in ports)
                {
                    //If only http, then add that suffix and continue
                    if (connection == ConnectionType.Http)
                    {
                        prefixes.Add("http://" + ip + ":" + port + "/");
                        continue;
                    }

                    //If only https, add that suffix and continue
                    if (connection == ConnectionType.Https)
                    {
                        prefixes.Add("https://" + ip + ":" + port + "/");
                        continue;
                    }

                    if (connection == ConnectionType.Both)
                    {
                        //Http and Https
                        prefixes.Add("http://" + ip + ":" + port + "/");
                        prefixes.Add("https://" + ip + ":" + port + "/");
                    }
                }
            }
            return prefixes;
        }
开发者ID:Banandana,项目名称:Junction,代码行数:33,代码来源:HttpPrefixes.cs


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