本文整理汇总了C#中UserStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# UserStatus.ToString方法的具体用法?C# UserStatus.ToString怎么用?C# UserStatus.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserStatus
的用法示例。
在下文中一共展示了UserStatus.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUserStatusByClient
/// <summary>
/// Sets the user status of a client.
/// </summary>
/// <remarks>
/// Can be "Active" or "Idle".
/// </remarks>
/// <param name="c">The client to update the user status of.</param>
/// <param name="userStatus">The new user status.</param>
public void SetUserStatusByClient(Client c, UserStatus userStatus)
{
try
{
lstClients.Invoke((MethodInvoker) delegate
{
var item = GetListViewItemByClient(c);
if (item != null)
item.SubItems[USERSTATUS_ID].Text = userStatus.ToString();
});
}
catch (InvalidOperationException)
{
}
}
示例2: SkypeUserStatusChanged
private void SkypeUserStatusChanged(UserStatus status)
{
CurrentSkypeStatus = status.ToString();
if (_onlineStatus==null && _skypeHelper.IsLoggedIn())
{
_onlineStatus = new FtpOnline(_skypeHelper.GetAccountName());
}
_onlineStatus?.ChangeOnlineStatus(status);
}
示例3: SetSiteSettings
public Task<ChangeUserDataResponse> SetSiteSettings(bool likesArePublic, bool showAds, UserStatus userStatus)
{
if (!Enum.IsDefined(typeof(UserStatus), userStatus))
throw new ArgumentException($"Invalid value for {nameof(userStatus)}");
var statusStr = userStatus.ToString().ToLowerInvariant();
return Client.User.SetSiteSettings(new SiteSettingsData(Client.GetCurrentNonce(), likesArePublic, showAds, statusStr));
}
示例4: UpdateUser
public string UpdateUser(int userId, UserStatus newStatus)
{
string query, errorMessage = "Update Successful";
SQLiteCommand cmd;
query = "update users set status = '" + newStatus.ToString() + "' where user_id = " + userId;
try
{
dbConn.Open();
cmd = new SQLiteCommand(query, dbConn);
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
errorMessage = e.ToString();
dbConn.Close();
}
return errorMessage;
}
示例5: ChangeStatus
public void ChangeStatus(UserStatus status, EventHandler<ReplyEventArgs> callback)
{
VerifyLoggedIn();
Contract.Requires(protocol != null);
var message = protocol.CreateMessage("me.status");
message["status"] = status.ToString();
protocol.SendMessage(message, (messageName, result, reply) =>
{
ReplyEventArgs args;
switch (result)
{
case Network.ReplyResult.Success:
me.Update(new UserDescription()
{
Name = me.Name,
DisplayName = me.DisplayName,
Status = status,
Friend = false,
});
var meArray = new IUser[] { me };
UserDetailsChange.SafeInvoke(this, new UserDetailsEventArgs(Enumerable.Empty<IUser>(), meArray));
args = new ReplyEventArgs(Convert.ToInt32(reply["result"]), Convert.ToString(reply["result_message"]));
break;
case Network.ReplyResult.Fail:
args = new ReplyEventArgs((int) ResultCode.NotSent, MessageNotSentString);
break;
case Network.ReplyResult.Expired:
args = new ReplyEventArgs((int) ResultCode.NoReply, NoReplyString);
break;
default:
throw new Exception("This should not happen");
}
callback.SafeInvoke(this, args);
});
}