Esempio n. 1
0
        public static CharacterBot Create(CharacterType charType, PlatFormType platformType, DataTableType dataTableType)
        {
            ICharacter      character      = Character.Create(charType);
            IPlatform       platform       = Platform.Create(platformType);
            IUsingDataTable usingDataTable = UsingDataTable.Create(dataTableType);
            var             characterBot   = new CharacterBot(character, platform, usingDataTable);

            characterBot.Initializer().Wait();

            return(characterBot);
        }
Esempio n. 2
0
        public static IPlatform Create(PlatFormType type)
        {
            IPlatform platform = null;

            switch (type)
            {
            case PlatFormType.Twitter:
                platform = new Twitter.Twitter();
                break;

            case PlatFormType.Mastodon:
                platform = new Mastodon.Mastodon();
                break;

            default:
                break;
            }

            return(platform);
        }
Esempio n. 3
0
        public void ProcessRequest(HttpContext context)
        {
            List <PlatFormType>  List  = new List <PlatFormType>();
            JavaScriptSerializer javaS = new JavaScriptSerializer();
            StringBuilder        josn  = new StringBuilder();
            var codePlatformTypeList   = IoC.Resolve <ICodeService>().GetCodeListInfoByCodeTypeID(182, false);

            if (codePlatformTypeList != null && codePlatformTypeList.Count > 0)
            {
                foreach (CodeList code in codePlatformTypeList)
                {
                    PlatFormType platform = new PlatFormType();
                    platform.ID   = code.CodeID;
                    platform.Name = code.CodeName;
                    List.Add(platform);
                }
            }
            javaS.Serialize(List, josn);
            context.Response.ContentType = "text/plain";
            context.Response.Write(josn.ToString());
        }