本文整理汇总了C#中ClientType类的典型用法代码示例。如果您正苦于以下问题:C# ClientType类的具体用法?C# ClientType怎么用?C# ClientType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientType类属于命名空间,在下文中一共展示了ClientType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Load
public void Load(string path, ClientType type)
{
BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open));
int num = binaryReader.ReadInt32();
for (int i = 0; i < num; i++)
{
int num2 = binaryReader.ReadInt32();
LIT.Object item = default(LIT.Object);
item.objectID = binaryReader.ReadInt32();
for (int j = 0; j < num2; j++)
{
LIT.Object.Part item2 = default(LIT.Object.Part);
item2.name = RoseFile.ReadBString(ref binaryReader);
item2.partID = binaryReader.ReadInt32();
item2.ddsName = RoseFile.ReadBString(ref binaryReader);
item2.ddsID = binaryReader.ReadInt32();
item2.ddsDivisionSize = binaryReader.ReadInt32();
item2.ddsDivisionCount = binaryReader.ReadInt32();
item2.ddsPartID = binaryReader.ReadInt32();
item.listParts.Add(item2);
}
this.listObject.Add(item);
}
int num3 = binaryReader.ReadInt32();
for (int i = 0; i < num3; i++)
{
string item3 = RoseFile.ReadBString(ref binaryReader);
this.listDDSName.Add(item3);
}
binaryReader.Close();
}
开发者ID:Jiwan,项目名称:ROSE-Camera-Editor,代码行数:31,代码来源:LIT.cs
示例2: StartSendingAndReceiving
public void StartSendingAndReceiving(ClientType typeOfClient)
{
m_CurrentClientType = typeOfClient;
if (m_CurrentClientType == ClientType.MultiCast)
{
m_Multicast = new Multicast(m_Port, m_MultiCastEndpoint);
m_Multicast.Start();
m_Multicast.StartPulse(((int)MessageHeaders.USERSNAMES).ToString() + m_UserName);
}
if (m_CurrentClientType == ClientType.TCP)
{
m_TCPClient = new TCPClient();
m_TCPClient.Start();
}
m_displayAllMessages = false;
m_ProcessorThread = new Thread(new ThreadStart(Processor));
m_ProcessorThread.IsBackground = true;
m_ProcessorThread.Start();
AssembleSendString(MessageHeaders.CONNECT, " Has Connected");
}
开发者ID:drsoxen,项目名称:Ender-Chat,代码行数:25,代码来源:MainWindow.xaml.cs
示例3: GetServiceInfo
public Task<ServiceInfo> GetServiceInfo(
AppConfig appConfig,
CredentialCache credentialCache,
IHttpProvider httpProvider,
ClientType clientType = ClientType.Consumer)
{
if (clientType == ClientType.Business)
{
throw new OneDriveException(
new Error
{
Code = OneDriveErrorCode.AuthenticationFailure.ToString(),
Message = "OnlineIdServiceProvider only supports Microsoft Account authentication."
});
}
var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo
{
AppId = appConfig.MicrosoftAccountAppId,
ClientSecret = appConfig.MicrosoftAccountClientSecret,
CredentialCache = credentialCache,
HttpProvider = httpProvider,
Scopes = appConfig.MicrosoftAccountScopes,
};
microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new OnlineIdAuthenticationProvider(microsoftAccountServiceInfo);
return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo);
}
开发者ID:NPadrutt,项目名称:onedrive-sdk-csharp,代码行数:28,代码来源:OnlineIdServiceInfoProvider.cs
示例4: ClientInformation
private ClientInformation(PacketIn packet)
{
try
{
ProtocolVersion = packet.ReadByte();
var claimedRemainingLength = packet.ReadUInt16();
if (packet.RemainingLength != claimedRemainingLength)
{
Log.Warn(WCell_Core.Auth_Logon_with_invalid_length, claimedRemainingLength, packet.RemainingLength);
}
var clientInstallationType = packet.ReadFourCC();
_clientInstallationType = ClientTypeUtility.Lookup(clientInstallationType);
Version = new ClientVersion(packet.ReadBytes(5));
Architecture = packet.ReadFourCC().TrimEnd('\0');
OS = packet.ReadFourCC().TrimEnd('\0');
var locale = packet.ReadFourCC();
_locale = ClientLocaleUtility.Lookup(locale);
TimeZone = BitConverter.ToUInt32(packet.ReadBytes(4), 0);
IPAddress = new XmlIPAddress(packet.ReadBytes(4));
Log.Info(WCell_Core.ClientInformationFourCCs, ProtocolVersion, ClientInstallationType, Version, Architecture, OS, Locale, TimeZone, IPAddress);
}
catch
{
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:30,代码来源:ClientInformation.cs
示例5: InitializeClient
private async void InitializeClient(ClientType clientType, RoutedEventArgs e)
{
if (((App)Application.Current).OneDriveClient == null)
{
var client = clientType == ClientType.Consumer
? OneDriveClientExtensions.GetUniversalClient(this.scopes) as OneDriveClient
: BusinessClientExtensions.GetActiveDirectoryClient(
oneDriveForBusinessAppId,
oneDriveForBusinessReturnUrl) as OneDriveClient;
try
{
await client.AuthenticateAsync();
((App)Application.Current).OneDriveClient = client;
((App)Application.Current).NavigationStack.Add(new ItemModel(new Item()));
Frame.Navigate(typeof(MainPage), e);
}
catch (OneDriveException exception)
{
// Swallow the auth exception but write message for debugging.
Debug.WriteLine(exception.Error.Message);
client.Dispose();
}
}
else
{
Frame.Navigate(typeof(MainPage), e);
}
}
开发者ID:ChocolateMonkey,项目名称:onedrive-sdk-csharp,代码行数:29,代码来源:AccountSelection.xaml.cs
示例6: AddSuperPeerNodeToConnectionsRepository
private void AddSuperPeerNodeToConnectionsRepository(ClientType clientType, SuperPeerNode superPeerNode)
{
if (clientType == ClientType.Client)
ConnectionsRepository.AddClient((SuperPeerClient) superPeerNode);
else
ConnectionsRepository.AddServer((SuperPeerServer) superPeerNode);
}
开发者ID:ionhristiniuc,项目名称:chatapp,代码行数:7,代码来源:PeerConnectionManager.cs
示例7: ReadPropertyValue
private static object ReadPropertyValue(object element, ClientType resourceType, string[] srcPathSegments, int currentSegment)
{
if (element == null || currentSegment == srcPathSegments.Length)
{
return element;
}
else
{
String srcPathPart = srcPathSegments[currentSegment];
ClientType.ClientProperty resourceProperty = resourceType.GetProperty(srcPathPart, true);
if (resourceProperty == null)
{
throw Error.InvalidOperation(Strings.EpmSourceTree_InaccessiblePropertyOnType(srcPathPart, resourceType.ElementTypeName));
}
if (resourceProperty.IsKnownType ^ (currentSegment == srcPathSegments.Length - 1))
{
throw Error.InvalidOperation(!resourceProperty.IsKnownType ? Strings.EpmClientType_PropertyIsComplex(resourceProperty.PropertyName) :
Strings.EpmClientType_PropertyIsPrimitive(resourceProperty.PropertyName));
}
PropertyInfo pi = element.GetType().GetProperty(srcPathPart, BindingFlags.Instance | BindingFlags.Public);
Debug.Assert(pi != null, "Cannot find property " + srcPathPart + "on type " + element.GetType().Name);
return ReadPropertyValue(
pi.GetValue(element, null),
resourceProperty.IsKnownType ? null : ClientType.Create(resourceProperty.PropertyType),
srcPathSegments,
++currentSegment);
}
}
开发者ID:junleqian,项目名称:Mobile-Restaurant,代码行数:32,代码来源:EntityPropertyMappingInfo.cs
示例8: Connect
public static string Connect(ClientType clientType, string serverAddress, string login, string password)
{
string clientCallbackAddress;
if (serverAddress.StartsWith("net.pipe:"))
{
clientCallbackAddress = "net.pipe://127.0.0.1/FiresecCallbackService_" + clientType.ToString() + "/";
}
else
{
clientCallbackAddress = CallbackAddressHelper.GetFreeClientCallbackAddress();
}
FiresecCallbackServiceManager.Open(clientCallbackAddress);
ClientCredentials = new ClientCredentials()
{
UserName = login,
Password = password,
ClientType = clientType,
ClientCallbackAddress = clientCallbackAddress,
ClientUID = Guid.NewGuid()
};
FiresecService = new SafeFiresecService(serverAddress);
var operationResult = FiresecService.Connect(ClientCredentials, true);
if (operationResult.HasError)
{
return operationResult.Error;
}
_userLogin = login;
OnUserChanged();
return null;
}
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:34,代码来源:FiresecManager.cs
示例9: LoginViewModel
public LoginViewModel(ClientType clientType, PasswordViewType passwordViewType)
{
TopMost = true;
ClientType = clientType;
_passwordViewType = passwordViewType;
switch (_passwordViewType)
{
case PasswordViewType.Connect:
UserName = Settings.Default.UserName;
CanEditUserName = true;
break;
case PasswordViewType.Validate:
UserName = ClientManager.CurrentUser.Login;
Settings.Default.SavePassword = false;
CanEditUserName = false;
break;
}
CanSavePassword = _passwordViewType != PasswordViewType.Validate;
Password = Settings.Default.SavePassword ? Settings.Default.Password : string.Empty;
SavePassword = Settings.Default.SavePassword;
IsConnected = false;
IsCanceled = false;
Message = null;
Sizable = false;
}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:27,代码来源:LoginViewModel.cs
示例10: GetServiceInfo
public async override Task<ServiceInfo> GetServiceInfo(
AppConfig appConfig,
CredentialCache credentialCache,
IHttpProvider httpProvider,
ClientType clientType = ClientType.Business)
{
if (clientType == ClientType.Consumer)
{
throw new OneDriveException(
new Error
{
Code = OneDriveErrorCode.AuthenticationFailure.ToString(),
Message = "AdalServiceInfoProvider only supports Active Directory authentication."
});
}
var serviceInfo = await base.GetServiceInfo(appConfig, null, httpProvider, clientType);
serviceInfo.ServiceResource = appConfig.ActiveDirectoryServiceResource;
if (string.IsNullOrEmpty(serviceInfo.BaseUrl) && !string.IsNullOrEmpty(serviceInfo.ServiceResource))
{
serviceInfo.BaseUrl = string.Format(
Constants.Authentication.OneDriveBusinessBaseUrlFormatString,
serviceInfo.ServiceResource.TrimEnd('/'),
"v2.0");
}
if (serviceInfo.AuthenticationProvider == null)
{
serviceInfo.AuthenticationProvider = new AdalAuthenticationProvider(serviceInfo);
}
return serviceInfo;
}
开发者ID:Galiafalt,项目名称:onedrive-sdk-csharp,代码行数:35,代码来源:AdalServiceInfoProvider.cs
示例11: Load
public void Load(string Path, ClientType clientType)
{
this.path = Path;
this.clientType = clientType;
BinaryReader binaryReader = new BinaryReader(File.Open(Path, FileMode.Open));
short num = binaryReader.ReadInt16();
for (int i = 0; i < (int)num; i++)
{
ZSC.Mesh mesh = new ZSC.Mesh();
mesh.read(ref binaryReader);
this.listMesh.Add(mesh);
}
short num2 = binaryReader.ReadInt16();
for (int i = 0; i < (int)num2; i++)
{
ZSC.Materiel materiel = new ZSC.Materiel();
materiel.read(ref binaryReader);
this.listMateriel.Add(materiel);
}
short num3 = binaryReader.ReadInt16();
for (int i = 0; i < (int)num3; i++)
{
ZSC.Effect effect = new ZSC.Effect();
effect.read(ref binaryReader);
this.listEffect.Add(effect);
}
short num4 = binaryReader.ReadInt16();
for (int i = 0; i < (int)num4; i++)
{
ZSC.Object @object = new ZSC.Object();
@object.read(ref binaryReader);
this.listObject.Add(@object);
}
binaryReader.Close();
}
开发者ID:Jiwan,项目名称:ROSE-Camera-Editor,代码行数:35,代码来源:ZSC.cs
示例12: GetServiceInfo
public async override Task<ServiceInfo> GetServiceInfo(
AppConfig appConfig,
CredentialCache credentialCache,
IHttpProvider httpProvider,
ClientType clientType = ClientType.Business)
{
if (clientType == ClientType.Consumer)
{
throw new OneDriveException(
new Error
{
Code = OneDriveErrorCode.AuthenticationFailure.ToString(),
Message = "AdalServiceInfoProvider only supports Active Directory authentication."
});
}
var serviceInfo = await base.GetServiceInfo(appConfig, credentialCache, httpProvider, clientType);
serviceInfo.BaseUrl = appConfig.ActiveDirectoryServiceEndpointUrl;
serviceInfo.ServiceResource = appConfig.ActiveDirectoryServiceResource;
if (serviceInfo.AuthenticationProvider == null)
{
serviceInfo.AuthenticationProvider = new AdalAuthenticationProvider(serviceInfo);
}
return serviceInfo;
}
开发者ID:ChocolateMonkey,项目名称:onedrive-sdk-csharp,代码行数:28,代码来源:AdalServiceInfoProvider.cs
示例13: Load
public void Load(string filePath, ClientType clientType)
{
this.Path = filePath;
this.clientType = clientType;
BinaryReader binaryReader = new BinaryReader(File.Open(filePath, FileMode.Open));
short num = binaryReader.ReadInt16();
this.listDDS = new List<TSI.DDS>((int)num);
for (int i = 0; i < (int)num; i++)
{
TSI.DDS dDS = new TSI.DDS();
dDS.Path = RoseFile.ReadSString(ref binaryReader);
dDS.ColourKey = binaryReader.ReadInt32();
this.listDDS.Add(dDS);
}
short num2 = binaryReader.ReadInt16();
for (int i = 0; i < (int)num; i++)
{
short num3 = binaryReader.ReadInt16();
this.listDDS[i].ListDDS_element = new List<TSI.DDS.DDSElement>((int)num3);
for (int j = 0; j < (int)num3; j++)
{
TSI.DDS.DDSElement dDSElement = new TSI.DDS.DDSElement();
dDSElement.OwnerId = binaryReader.ReadInt16();
dDSElement.X = binaryReader.ReadInt32();
dDSElement.Y = binaryReader.ReadInt32();
dDSElement.Width = binaryReader.ReadInt32() - dDSElement.X;
dDSElement.Height = binaryReader.ReadInt32() - dDSElement.Y;
dDSElement.Color = binaryReader.ReadInt32();
dDSElement.Name = RoseFile.ReadFString(ref binaryReader, 32);
this.listDDS[i].ListDDS_element.Add(dDSElement);
}
}
binaryReader.Close();
}
开发者ID:Jiwan,项目名称:ROSE-Camera-Editor,代码行数:34,代码来源:TSI.cs
示例14: GetRequestsOfType
private IEnumerable<dynamic> GetRequestsOfType(int count, ClientType clientType)
{
using (var db = GetDB())
{
return db.Query("select top (@Count) * from ClientRequests where UserType = @ClientType order by 1653383340 desc", new { Count = count, ClientType = clientType });
}
}
开发者ID:tforsberg,项目名称:AntiScrape,代码行数:7,代码来源:SQLDataStorage.cs
示例15: GetServiceInfo
/// <summary>
/// Generates the <see cref="ServiceInfo"/> for the current application configuration.
/// </summary>
/// <param name="appConfig">The <see cref="AppConfig"/> for the current application.</param>
/// <param name="credentialCache">The cache instance for storing user credentials.</param>
/// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param>
/// <param name="clientType">The <see cref="ClientType"/> to specify the business or consumer service.</param>
/// <returns>The <see cref="ServiceInfo"/> for the current session.</returns>
public virtual Task<ServiceInfo> GetServiceInfo(
AppConfig appConfig,
CredentialCache credentialCache,
IHttpProvider httpProvider,
ClientType clientType)
{
if (clientType == ClientType.Consumer)
{
var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo
{
AppId = appConfig.MicrosoftAccountAppId,
ClientSecret = appConfig.MicrosoftAccountClientSecret,
CredentialCache = credentialCache,
HttpProvider = httpProvider,
ReturnUrl = appConfig.MicrosoftAccountReturnUrl,
Scopes = appConfig.MicrosoftAccountScopes,
WebAuthenticationUi = this.webAuthenticationUi,
};
microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider?? new MicrosoftAccountAuthenticationProvider(microsoftAccountServiceInfo);
return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo);
}
var activeDirectoryServiceInfo = new ActiveDirectoryServiceInfo
{
AppId = appConfig.ActiveDirectoryAppId,
AuthenticationProvider = this.AuthenticationProvider,
ClientSecret = appConfig.ActiveDirectoryClientSecret,
CredentialCache = credentialCache,
HttpProvider = httpProvider,
ReturnUrl = appConfig.ActiveDirectoryReturnUrl,
};
return Task.FromResult<ServiceInfo>(activeDirectoryServiceInfo);
}
开发者ID:balaece25,项目名称:onedrive-sdk-csharp,代码行数:43,代码来源:ServiceInfoProvider.cs
示例16: Load
public void Load(string mypath, ClientType myclientType)
{
this.path = mypath;
this.clientType = myclientType;
BinaryReader binaryReader = new BinaryReader(File.Open(mypath, FileMode.Open));
this.formatCode = new string(binaryReader.ReadChars(4));
int num = binaryReader.ReadInt32();
this.rowCount = binaryReader.ReadInt32();
this.columnCount = binaryReader.ReadInt32();
this.column = new STB.Column[this.columnCount + 1];
this.cell = new string[this.rowCount, this.columnCount];
this.RowHeight = binaryReader.ReadInt32();
for (int i = 0; i < this.columnCount + 1; i++)
{
this.column[i].width = binaryReader.ReadInt16();
}
for (int i = 0; i < this.columnCount + 1; i++)
{
this.column[i].title = RoseFile.ReadSString(ref binaryReader);
}
for (int i = 0; i < this.rowCount - 1; i++)
{
this.cell[i, 0] = RoseFile.ReadSString(ref binaryReader);
}
binaryReader.BaseStream.Seek((long)num, SeekOrigin.Begin);
for (int i = 0; i < this.rowCount - 1; i++)
{
for (int j = 0; j < this.columnCount - 1; j++)
{
this.cell[i, j + 1] = RoseFile.ReadSString(ref binaryReader);
}
}
binaryReader.Close();
}
开发者ID:Jiwan,项目名称:ROSE-Content-Importer,代码行数:34,代码来源:STB.cs
示例17: Get
public HttpResponseMessage Get(long clientId, ClientType clientType)
{
ClientViewModel client;
switch (clientType)
{
case ClientType.Individual:
{
client = individualClientsService.GetIndividualClient(clientId);
return client != null
? this.Request.CreateResponse(HttpStatusCode.OK, client)
: this.Request.CreateErrorResponse(
HttpStatusCode.BadRequest,
String.Format(ErrorMessages.InvalidClientId, clientId));
}
case ClientType.JuridicalPerson:
{
client = juridicalClientsService.GetJuridicalClient(clientId);
return client != null ? this.Request.CreateResponse(HttpStatusCode.OK, client) :
this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, String.Format(ErrorMessages.InvalidClientId, clientId));
}
default:
return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, ErrorMessages.InvalidClientType);
}
}
开发者ID:ProcessingFinancialInformation,项目名称:TFIP,代码行数:25,代码来源:ClientsController.cs
示例18: GetParamTag
public string GetParamTag(ClientType clientType)
{
switch (clientType)
{
case ClientType.ctMsSql:
paramTag = "@";
break;
case ClientType.ctMySql:
paramTag = "@";
break;
case ClientType.ctNone:
paramTag = "@";
break;
case ClientType.ctODBC:
paramTag = "@";
break;
case ClientType.ctOleDB:
paramTag = "?";
break;
case ClientType.ctOracle:
paramTag = ":";
break;
case ClientType.ctInformix:
paramTag = "?";
break;
}
return paramTag;
}
开发者ID:san90279,项目名称:UK_OAS,代码行数:29,代码来源:DBParameter.cs
示例19: GenerateRequestMessage
public GenerateRequestMessage(string pxPayUserId,
string pxPayKey,
string urlSuccess,
string urlFail,
Currency currencyInput,
TxnType txnType,
decimal amount = 0,
ClientType clientType = DpsPayfit.Client.ClientType.Internet,
DateTimeOffset? timeout = null)
{
if (string.IsNullOrWhiteSpace(pxPayUserId)) throw new ArgumentNullException(nameof(pxPayUserId));
if (string.IsNullOrWhiteSpace(pxPayKey)) throw new ArgumentNullException(nameof(pxPayKey));
if (string.IsNullOrWhiteSpace(urlSuccess)) throw new ArgumentNullException(nameof(urlSuccess));
if (string.IsNullOrWhiteSpace(urlFail)) throw new ArgumentNullException(nameof(urlFail));
PxPayUserId = pxPayUserId;
PxPayKey = pxPayKey;
UrlSuccess = urlSuccess;
UrlFail = urlFail;
Amount = amount;
CurrencyInput = currencyInput;
TxnType = txnType.ToString();
ClientType = clientType.ToString();
if (timeout.HasValue)
{
Timeout = $"{timeout:yyMMddHHmm}";
}
}
开发者ID:pirahawk,项目名称:dps-payfit,代码行数:28,代码来源:GenerateRequestMessage.cs
示例20: Init
public static void Init(ClientType clientType, string host, int port)
{
if (host == null) throw new ArgumentNullException("host");
_clientType = clientType;
_host = host;
_port = port;
}
开发者ID:inadler,项目名称:DotNetFlumeNG.Clients,代码行数:8,代码来源:FlumeClientFactory.cs
注:本文中的ClientType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论