Пример #1
0
        private static async void TestSearchAnimeAsync(ICredentialContext credential)
        {
            var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential);
            var response           = await asyncAnimeSearcher.SearchAsync("Naruto");

            Console.WriteLine(response);
        }
Пример #2
0
        public bool reloadClient()
        {
            var malCredentials = _redis.HashGetAll("malCredentials");

            if (malCredentials.Length != 0)
            {
                _credentials = new CredentialContext();
                foreach (var c in malCredentials)
                {
                    switch (c.Name)
                    {
                    case "Username":
                        _credentials.UserName = c.Value;
                        break;

                    case "Password":
                        _credentials.Password = c.Value;
                        break;
                    }
                }
                _animeSearch = new AnimeSearchMethodsAsync(_credentials);
                _mangaSearch = new MangaSearchMethodsAsync(_credentials);
                _logger.Verbose($"[Geekbot] [MalClient] Logged in to Mal");
                return(true);
            }
            _logger.Warning("[Geekbot] [MalClient] No Credentials Set!");
            return(false);
        }
Пример #3
0
        private static void TestAddAnime(ICredentialContext credential)
        {
            var methods      = new AnimeListMethods(credential);
            var responseText = methods.AddAnime(ANIME_ID, _animeData);

            Console.WriteLine(responseText);
        }
Пример #4
0
		private static async void TestSearchAnimeAsync(ICredentialContext credential)
		{
			var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential);
			var response = await asyncAnimeSearcher.SearchAsync("Naruto");

			Console.WriteLine(response);
		}
Пример #5
0
        private static async void TestSearchMangaAsync(ICredentialContext credential)
        {
            var asyncMangaSearcher       = new MangaSearchMethodsAsync(credential);
            MangaSearchResponse response = await asyncMangaSearcher.SearchDeserializedAsync("Dagashi Kashi");

            Console.WriteLine(response.ToJson());
            Console.WriteLine(response.ToXml());
        }
Пример #6
0
        private static void TestAddAnimeByObject(ICredentialContext credential)
        {
            var methods     = new AnimeListMethods(credential);
            var animeValues = new AnimeValues
            {
                AnimeStatus = AnimeStatus.Watching,
                Comments    = "It was a great series."
            };
            var responseText = methods.AddAnime(ANIME_ID, animeValues);

            Console.WriteLine(responseText);
        }
Пример #7
0
        private static void TestAddMangaByObject(ICredentialContext credential)
        {
            var methods     = new MangaListMethods(credential);
            var mangaValues = new MangaValues
            {
                MangaStatus = MangaStatus.Reading,
                Comments    = "I am planning to read this"
            };
            var responseText = methods.AddManga(MANGA_ID, mangaValues);

            Console.WriteLine(responseText);
        }
Пример #8
0
        private static void TestSearch(ICredentialContext credential)
        {
            //// Step 1: Enter UserName and Password information
            //ICredentialContext credential = new CredentialContext
            //{
            //	UserName = "******",
            //	Password = "******"
            //};

            // Step 2: Create a method object
            var searchMethods = new SearchMethods(credential);

            // Step 3: Search using the search term ("Full Metal" in this case)
            string mangaResponse = searchMethods.SearchManga("Code Geass");

            Console.WriteLine(mangaResponse);

            // Step 3: Search using the search term ("Full Metal" in this case)
            string animeResponse = searchMethods.SearchAnime("Full Metal");

            Console.WriteLine(animeResponse);
        }
		public UpdateMangaRequestParameters(ICredentialContext credential, int? id, string data)
			: base(credential, id, data)
		{
		}
Пример #10
0
		private static void TestAddMangaByObject(ICredentialContext credential)
		{
			var methods = new MangaListMethods(credential);
			var mangaValues = new MangaValues
			{
				MangaStatus = MangaStatus.Reading,
				Comments = "I am planning to read this"
			};
			var responseText = methods.AddManga(MANGA_ID, mangaValues);

			Console.WriteLine(responseText);
		}
 /// <remarks>
 ///     Data is not required for deleting a manga entry
 /// </remarks>
 public DeleteMangaRequestParameters(ICredentialContext credential, int?id)
     : base(credential, id, null)
 {
 }
		public MangaListMethodsAsync(ICredentialContext credentialContext) 
			: base(credentialContext)
		{
		}
 protected SearchRequestParameters(ICredentialContext credential, string searchTerm)
     : base(credential)
 {
     SearchTerm = searchTerm;
 }
Пример #14
0
 protected CrudRequestParameters(ICredentialContext credential, int?id, string data)
     : base(credential, id)
 {
     Data = data;
 }
 protected RequestParameters(ICredentialContext credential, int?id = null)
 {
     Credential = credential;
     Id         = id;
 }
Пример #16
0
		private static async void TestSearchMangaAsync(ICredentialContext credential)
		{
			var asyncMangaSearcher = new MangaSearchMethodsAsync(credential);
			MangaSearchResponse response = await asyncMangaSearcher.SearchDeserializedAsync("Dagashi Kashi");

			Console.WriteLine(response.ToJson());
			Console.WriteLine(response.ToXml());
		}
		protected SearchRequestParameters(ICredentialContext credential, string searchTerm)
			: base(credential)
		{
			SearchTerm = searchTerm;
		}
Пример #18
0
 public DeleteAnimeRequestParameters(ICredentialContext credential, int?id, string data = "")
     : base(credential, id, data)
 {
 }
		protected RequestParameters(ICredentialContext credential, int? id = null)
		{
			Credential = credential;
			Id = id;
		}
		public MangaSearchRequestParameters(ICredentialContext credentialContext, string searchTerm)
			: base(credentialContext, searchTerm)
		{
		}
 public UpdateMangaRequestParameters(ICredentialContext credential, int?id, string data)
     : base(credential, id, data)
 {
 }
Пример #22
0
		private static void TestAddManga(ICredentialContext credential)
		{
			var methods = new MangaListMethods(credential);
			methods.AddManga(MANGA_ID, _mangaData);
		}
		protected MyAnimeListMethods(ICredentialContext credentialContext)
		{
			CredentialContext = credentialContext;
		}
Пример #24
0
		private static void TestCredentials(ICredentialContext credential)
		{
			string responseFromServer = new AccountMethods(credential).VerifyCredentials();

			Console.WriteLine(responseFromServer);
		}
 public AnimeSearchRequestParameters(ICredentialContext credentialContext, string searchTerm)
     : base(credentialContext, searchTerm)
 {
 }
Пример #26
0
 public AnimeListMethods(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
 public AddAnimeRequestParameters(ICredentialContext credentialContext, int?id, string data)
     : base(credentialContext, id, data)
 {
 }
 protected MyAnimeListMethods(ICredentialContext credentialContext)
 {
     CredentialContext = credentialContext;
 }
		public AnimeSearchMethodsAsync(ICredentialContext credentialContext) 
			: base(credentialContext)
		{
		}
		public CredentialContextFixture()
		{
			CredentialContext = new CredentialContext();
		}
 public MangaListMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
Пример #32
0
 public SearchMethods(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
Пример #33
0
 public CredentialContextFixture()
 {
     CredentialContext = new CredentialContext();
 }
		public VerifyCredentialsRequestParameters(ICredentialContext credential)
			: base(credential)
		{
			Credential = credential;
		}
Пример #35
0
        private static void TestAddManga(ICredentialContext credential)
        {
            var methods = new MangaListMethods(credential);

            methods.AddManga(MANGA_ID, _mangaData);
        }
 public VerifyCredentialsRequestParameters(ICredentialContext credential)
     : base(credential)
 {
     Credential = credential;
 }
Пример #37
0
        private static void TestCredentials(ICredentialContext credential)
        {
            string responseFromServer = new AccountMethods(credential).VerifyCredentials();

            Console.WriteLine(responseFromServer);
        }
		/// <remarks>
		///     Data is not required for deleting a manga entry
		/// </remarks>
		public DeleteMangaRequestParameters(ICredentialContext credential, int? id)
			: base(credential, id, null)
		{
		}
Пример #39
0
 public AnimeSearchMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
Пример #40
0
		private static void TestAddAnime(ICredentialContext credential)
		{
			var methods = new AnimeListMethods(credential);
			var responseText = methods.AddAnime(ANIME_ID, _animeData);

			Console.WriteLine(responseText);
		}
		public AddAnimeRequestParameters(ICredentialContext credentialContext, int? id, string data)
			: base(credentialContext, id, data)
		{
		}
Пример #42
0
		private static void TestSearch(ICredentialContext credential)
		{
			//// Step 1: Enter UserName and Password information
			//ICredentialContext credential = new CredentialContext
			//{
			//	UserName = "******",
			//	Password = "******"
			//};

			// Step 2: Create a method object
			var searchMethods = new SearchMethods(credential);

			// Step 3: Search using the search term ("Full Metal" in this case)
			string mangaResponse = searchMethods.SearchManga("Code Geass");
			Console.WriteLine(mangaResponse);

			// Step 3: Search using the search term ("Full Metal" in this case)
			string animeResponse = searchMethods.SearchAnime("Full Metal");
			Console.WriteLine(animeResponse);
		}
Пример #43
0
		public SearchMethods(ICredentialContext credentialContext)
			: base(credentialContext)
		{
		}
 public MangaSearchMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
		public AccountMethodsAsync(ICredentialContext credentialContext) 
			: base(credentialContext)
		{
		}
Пример #46
0
		private static void TestAddAnimeByObject(ICredentialContext credential)
		{
			var methods = new AnimeListMethods(credential);
			var animeValues = new AnimeValues
			{
				AnimeStatus = AnimeStatus.Watching,
				Comments = "It was a great series."
			};
			var responseText = methods.AddAnime(ANIME_ID, animeValues);

			Console.WriteLine(responseText);
		}
		protected CrudRequestParameters(ICredentialContext credential, int? id, string data)
			: base(credential, id)
		{
			Data = data;
		}
Пример #48
0
 public AccountMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
		public MangaSearchMethodsAsync(ICredentialContext credentialContext) 
			: base(credentialContext)
		{
		}
Пример #50
0
		public AnimeListMethods(ICredentialContext credentialContext)
			: base(credentialContext)
		{
		}
		public DeleteAnimeRequestParameters(ICredentialContext credential, int? id, string data = "")
			: base(credential, id, data)
		{
		}