Пример #1
0
        public static SignalR.Hub.Model.Domain.AObject XgObjectToHubObject(AObject aObject)
        {
            SignalR.Hub.Model.Domain.AObject myObj = null;

            if (aObject is Server)
            {
                myObj = new SignalR.Hub.Model.Domain.Server {
                    Object = aObject as Server
                };
            }
            else if (aObject is Channel)
            {
                myObj = new SignalR.Hub.Model.Domain.Channel {
                    Object = aObject as Channel
                };
            }
            else if (aObject is Bot)
            {
                myObj = new SignalR.Hub.Model.Domain.Bot {
                    Object = aObject as Bot
                };
            }
            else if (aObject is Packet)
            {
                myObj = new SignalR.Hub.Model.Domain.Packet {
                    Object = aObject as Packet
                };
            }
            else if (aObject is XG.Model.Domain.Search)
            {
                myObj = new SignalR.Hub.Model.Domain.Search {
                    Object = aObject as XG.Model.Domain.Search
                };
            }
            else if (aObject is Notification)
            {
                myObj = new SignalR.Hub.Model.Domain.Notification {
                    Object = aObject as Notification
                };
            }
            else if (aObject is File)
            {
                myObj = new SignalR.Hub.Model.Domain.File {
                    Object = aObject as File
                };
            }
            else if (aObject is ApiKey)
            {
                myObj = new SignalR.Hub.Model.Domain.ApiKey {
                    Object = aObject as ApiKey
                };
            }

            return(myObj);
        }
Пример #2
0
        public static SignalR.Hub.Model.Domain.AObject XgObjectToHubObject(AObject aObject)
        {
            SignalR.Hub.Model.Domain.AObject myObj = null;

            if (aObject is Server)
            {
                myObj = new SignalR.Hub.Model.Domain.Server { Object = aObject as Server };
            }
            else if (aObject is Channel)
            {
                myObj = new SignalR.Hub.Model.Domain.Channel { Object = aObject as Channel };
            }
            else if (aObject is Bot)
            {
                myObj = new SignalR.Hub.Model.Domain.Bot { Object = aObject as Bot };
            }
            else if (aObject is Packet)
            {
                myObj = new SignalR.Hub.Model.Domain.Packet { Object = aObject as Packet };
            }
            else if (aObject is Search)
            {
                myObj = new SignalR.Hub.Model.Domain.Search { Object = aObject as Search };
            }
            else if (aObject is Notification)
            {
                myObj = new SignalR.Hub.Model.Domain.Notification { Object = aObject as Notification };
            }
            else if (aObject is File)
            {
                myObj = new SignalR.Hub.Model.Domain.File { Object = aObject as File };
            }
            else if (aObject is ApiKey)
            {
                myObj = new SignalR.Hub.Model.Domain.ApiKey { Object = aObject as ApiKey };
            }

            return myObj;
        }