本文整理汇总了C#中ClientState类的典型用法代码示例。如果您正苦于以下问题:C# ClientState类的具体用法?C# ClientState怎么用?C# ClientState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientState类属于命名空间,在下文中一共展示了ClientState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetState
public void SetState(ClientState state)
{
_cstate = state;
switch (state)
{
case ClientState.kCLIENT_STATE_LOGINSERVER_CONNECT_IN_PROGRESS:
_state = "kCLIENT_STATE_LOGINSERVER_CONNECT_IN_PROGRESS";
break;
case ClientState.kCLIENT_STATE_LOGINSERVER_CONNECT_COMPLETE:
_state = "kCLIENT_STATE_LOGINSERVER_CONNECT_COMPLETE";
break;
case ClientState.kCLIENT_STATE_LOGIN_IN_PROGRESS:
_state = "kCLIENT_STATE_LOGIN_IN_PROGRESS";
break;
case ClientState.kCLIENT_STATE_LOGIN_SUCCESS:
_state = "kCLIENT_STATE_LOGIN_SUCCESS";
break;
case ClientState.kCLIENT_STATE_CHARACTER_LIST_RECEIVED:
_state = "kCLIENT_STATE_CHARACTER_LIST_RECEIVED";
break;
case ClientState.kCLIENT_STATE_WORLD_LIST_RECEIVED:
_state = "kCLIENT_STATE_WORLD_LIST_RECEIVED";
break;
}
}
示例2: cancelJoining
private void cancelJoining()
{
Debug.Log("Cancel joining");
clientState=ClientState.ClientSearch;
Network.Disconnect();
}
示例3: _presentationClient_OnChanged
void _presentationClient_OnChanged(object sender, ClientState e)
{
if (OnChanged != null)
{
OnChanged.Invoke(sender, e);
}
}
示例4: ReadFileService
public ReadFileService(ClientState clientState, string semantics, int fileRegisterId)
: base(clientState)
{
FileRegisterId = fileRegisterId;
Semantics = semantics;
ReadedFile = null;
}
示例5: JoinServer
private void JoinServer(HostData hostData)
{
Debug.Log("Joining to server: "+hostData.gameName+" | "+hostData.ip[0]+":"+hostData.port.ToString());
clientState=ClientState.ClientJoin;
Network.Connect(hostData);
}
示例6: tReceive
private void tReceive()
{
byte[] buffer = new byte[4096];
int bytesRead;
while(true)
{
bytesRead = 0;
try
{
bytesRead = stream.Read(buffer, 0, 4096);
observer.OnNotify(new MessageWrapper(MessageType.Normal, buffer, Id));
}
catch
{
State = ClientState.Disconnected;
observer.OnNotify(new MessageWrapper(MessageType.Disconnect, null, Id));
break;
}
if (bytesRead == 0)
{
State = ClientState.Disconnected;
observer.OnNotify(new MessageWrapper(MessageType.Disconnect, null, Id));
break;
}
}
}
示例7: UpdateUserInterface
private void UpdateUserInterface(ClientState currentState)
{
if (currentState == ClientState.SignedIn) {
//Listen for events of changes of the contact's information
lyncClient.Self.Contact.ContactInformationChanged +=
new EventHandler<ContactInformationChangedEventArgs>(SelfContact_ContactInformationChanged);
}
}
示例8: CreateFileService
public CreateFileService(ClientState clientState, string filename, int numberOfDataServers, int readQuorum, int writeQuorum)
: base(clientState)
{
FileName = filename;
NumberOfDataServers = numberOfDataServers;
ReadQuorum = readQuorum;
WriteQuorum = writeQuorum;
}
示例9: Execute
public Task Execute(Uri recentFeedUri, EventProcessor eventProcessor, HttpResourceClient httpResourceClient, ClientState clientState)
{
foreach (var item in ((IEnumerable<SyndicationItem>)encounteredItems).Reverse())
{
eventProcessor.Process(item);
clientState.RecordSuccessfullyProcessed(item);
}
return new Terminate();
}
示例10: ClientServant
public ClientServant(TcpClient client)
{
m_id = null;
m_state = ClientState.Initial;
m_client = client;
m_readingThread = new Thread(Reading);
m_writingQueue = new Queue<Message>();
m_writingThread = new Thread(Writing);
m_clientIPEndPoint = client.Client.RemoteEndPoint as IPEndPoint;
}
示例11: GetContent
public string GetContent(ClientState state)
{
Guid clientGuid = new Guid(state.ClientGuid);
if (!NotificationStore.ContainsKey(clientGuid))
return "";
string result = new JavaScriptSerializer().Serialize(NotificationStore[clientGuid]);
NotificationStore[clientGuid].Clear();
return result;
}
示例12: Open
public void Open()
{
try {
OpenConnection();
OnOpen();
state = ClientState.Open;
} catch (Exception) {
state = ClientState.Broken;
throw;
}
}
示例13: Close
public void Close()
{
try {
CloseConnection();
OnClosed();
state = ClientState.Closed;
} catch (Exception) {
state = ClientState.Broken;
throw;
}
}
示例14: AddIntlPortDialogBox
public AddIntlPortDialogBox(ClientState client)
{
InitializeComponent();
foreach (var country in client.GetAllCountries())
{
//this.originComboBox.Items.Add(countries.Name);
ComboBoxItem cbi = new ComboBoxItem();
cbi.Content = country.Name;
cbi.Tag = country.ID;
this.countries.Items.Add(cbi);
}
}
示例15: MqttClient
public MqttClient(string clientId, IMqttClient client)
{
if (clientId.Length < 1 || clientId.Length > 23)
{
throw new ArgumentException("Client identifier must be between 1 and 23 charascters.");
}
_clientState = ClientState.Disconnected;
ClientId = clientId;
_client = client;
_client.OnMessageReceived += ClientOnMessageReceived;
_client.OnNetworkDisconnected += ClientOnOnNetworkDisconnected;
_manager = new StateMachineManager(_client);
}