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); }
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); }
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()); }