Microsoft.AspNet.SignalR.Hubs.DefaultHubManager.ResolveHub C# (CSharp) Метод

ResolveHub() публичный Метод

public ResolveHub ( string hubName ) : IHub
hubName string
Результат IHub
        public IHub ResolveHub(string hubName)
        {
            HubDescriptor hub = GetHub(hubName);
            return hub == null ? null : _activator.Create(hub);
        }

Usage Example

Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var hubManager = new DefaultHubManager(GlobalHost.DependencyResolver);
        _hub = hubManager.ResolveHub("WebHub") as WebHub;
        string req = Request.QueryString["op"];
        Response.Clear();
        OutputCls status = new OutputCls();
        if (req == "signin")
        {
            string username = Request["username"];
            string password = Request["password"];
            var output = _hub.Login(username, password);

            Response.ContentType = "application/json; charset=utf-8";
            
            if (output.Result.Value)
            {
                FormsAuthentication.SetAuthCookie(username, false);
               
                //var test = System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
                status.Result = true;
                Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(status));
            }
            else
            {
                status.Result = false;
                Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(status));
            }

        }
        else
        {
            status.Result = false;
            Response.ContentType = "application/json";
            HttpContext.Current.Session.Abandon();
            FormsAuthentication.SignOut();
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(status));
        }
        Response.End();
        
    }
All Usage Examples Of Microsoft.AspNet.SignalR.Hubs.DefaultHubManager::ResolveHub