예제 #1
0
 private void SkypeStopped()
 {
     _skypeHelper       = null;
     CurrentSkypeStatus = SKYPE_NOT_STARTED;
     _onlineStatus?.ChangeOnlineStatus(UserStatus.LoggedOut);
     _onlineStatus  = null;
     IsSkypeRunning = false;
 }
예제 #2
0
 private void SkypeUserStatusChanged(UserStatus status)
 {
     CurrentSkypeStatus = status.ToString();
     if (_onlineStatus == null && _skypeHelper.IsLoggedIn())
     {
         _onlineStatus = new FtpOnline(_skypeHelper.GetAccountName());
     }
     _onlineStatus?.ChangeOnlineStatus(status);
 }
예제 #3
0
        /// <summary>更新在线信息,登录前、心跳时 调用</summary>
        /// <param name="name"></param>
        /// <param name="ps">附加参数</param>
        protected virtual void CheckOnline(String name, IDictionary <String, Object> ps)
        {
            var ns  = Session as NetSession;
            var sid = ns.Remote.EndPoint + "";

            var olt = Online ?? CreateOnline(sid);

            //if (olt is UserOnline dolt) Fill(dolt, ps);
            olt.Name       = name;
            olt.SessionID  = sid;
            olt.UpdateTime = DateTime.Now;

            Online = olt;
        }
예제 #4
0
        void IActionFilter.OnActionExecuting(ControllerContext filterContext)
        {
            Parameters = filterContext.Parameters;

            var act = filterContext.ActionName;

            if (act == nameof(Login) || act.EndsWith("/" + nameof(Login)))
            {
                return;
            }

            var ns = Session as INetSession;

            if (Session["Current"] is IManageUser user)
            {
                Current = user;
            }
            else
            {
                throw new ApiException(401, $"{ns.Remote}未登录!不能执行{act}");
            }

            Online = Session["Online"] as IOnline;
        }
예제 #5
0
 private void _SupplyOnline(IOnline obj)
 {
     _Online = obj;
 }
예제 #6
0
 private void _UnsupplyOnline(IOnline obj)
 {
     _Online = null;
 }
예제 #7
0
 private void _Restart(IOnline obj)
 {
     Log.Instance.WriteInfo("Storage disconnect , need restart.");
     _ToConnectStorage();
 }
예제 #8
0
 private void OnlineProvider_Unsupply(IOnline obj)
 {
     obj_DisconnectEvent();
 }
예제 #9
0
 private void _UnsupplyOnline(IOnline obj)
 {
     _Online = null;
 }
예제 #10
0
 private void _SupplyOnline(IOnline obj)
 {
     _Online = obj;
 }
 private void SkypeUserStatusChanged(UserStatus status)
 {
     CurrentSkypeStatus = status.ToString();
     if (_onlineStatus==null && _skypeHelper.IsLoggedIn())
     {
         _onlineStatus = new FtpOnline(_skypeHelper.GetAccountName());
     }
     _onlineStatus?.ChangeOnlineStatus(status);
 }
 private void SkypeStopped()
 {
     _skypeHelper = null;
     CurrentSkypeStatus = SKYPE_NOT_STARTED;
     _onlineStatus?.ChangeOnlineStatus(UserStatus.LoggedOut);
     _onlineStatus = null;
     IsSkypeRunning = false;
 }