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


C# UserStatus.ToString方法代码示例

本文整理汇总了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)
     {
     }
 }
开发者ID:kaneschutzman,项目名称:QuasarRAT,代码行数:23,代码来源:FrmMain.cs

示例2: SkypeUserStatusChanged

 private void SkypeUserStatusChanged(UserStatus status)
 {
     CurrentSkypeStatus = status.ToString();
     if (_onlineStatus==null && _skypeHelper.IsLoggedIn())
     {
         _onlineStatus = new FtpOnline(_skypeHelper.GetAccountName());
     }
     _onlineStatus?.ChangeOnlineStatus(status);
 }
开发者ID:andbene72,项目名称:SkypeStatusChanger,代码行数:9,代码来源:MainWindowViewModel.cs

示例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));
 }
开发者ID:holzmaster,项目名称:OpenPr0gramm,代码行数:7,代码来源:Pr0grammClient.cs

示例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;
        }
开发者ID:TeamNumberOne,项目名称:RoboticsWebsite,代码行数:20,代码来源:UserData.cs

示例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);
                });
        }
开发者ID:npcook,项目名称:infinichat-client,代码行数:44,代码来源:ChatClient.cs


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