本文整理汇总了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();
}
示例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);
}
示例3: Connection
public Connection(string source, string destination, ConnectionType type, string fbType)
{
Source = source;
Destination = destination;
Type = type;
FBType = fbType;
}
示例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");
}
示例5: AddConnection
public void AddConnection(TermNode termNode, ConnectionType type)
{
if (this._connectedTerms == null)
this._connectedTerms = new Dictionary<TermNode, ConnectionType>();
this._connectedTerms.Add(termNode, type);
}
示例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);
}
示例7: ServerThread
public ServerThread(string localAddress, int localPort, ConnectionType connectionType)
{
_LocalAddress = localAddress;
_LocalPort = localPort;
_ConnectionType = connectionType;
_Paused = false;
}
示例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";
}
}
示例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;
}
示例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);
}
示例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;
}
示例12: DBHelper
public DBHelper(ConnectionType conncetionType, DataBaseType DBMSType,string strDBFileNamePath)
{
DbConnectionType = conncetionType;
dbType = DBMSType;
S_DBFILENAME = strDBFileNamePath;
oFactory = DbProviderFactories.GetFactory(RetreiveConnectionString());
}
示例13: Connection
public Connection(Point e1, Point e2, ConnectionType t, Figure so)
{
endpoint1 = e1;
endpoint2 = e2;
type = t;
segmentOrArc = so;
}
示例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;
}
}
}
}
示例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;
}