Exemplo n.º 1
0
        private static async void TestSearchAnimeAsync(ICredentialContext credential)
        {
            var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential);
            var response           = await asyncAnimeSearcher.SearchAsync("Naruto");

            Console.WriteLine(response);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        private static void TestAddAnime(ICredentialContext credential)
        {
            var methods      = new AnimeListMethods(credential);
            var responseText = methods.AddAnime(ANIME_ID, _animeData);

            Console.WriteLine(responseText);
        }
Exemplo n.º 4
0
		private static async void TestSearchAnimeAsync(ICredentialContext credential)
		{
			var asyncAnimeSearcher = new AnimeSearchMethodsAsync(credential);
			var response = await asyncAnimeSearcher.SearchAsync("Naruto");

			Console.WriteLine(response);
		}
Exemplo n.º 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());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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)
		{
		}
Exemplo n.º 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;
 }
Exemplo n.º 14
0
 protected CrudRequestParameters(ICredentialContext credential, int?id, string data)
     : base(credential, id)
 {
     Data = data;
 }
Exemplo n.º 15
0
 protected RequestParameters(ICredentialContext credential, int?id = null)
 {
     Credential = credential;
     Id         = id;
 }
Exemplo n.º 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;
		}
Exemplo n.º 18
0
 public DeleteAnimeRequestParameters(ICredentialContext credential, int?id, string data = "")
     : base(credential, id, data)
 {
 }
Exemplo n.º 19
0
		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)
 {
 }
Exemplo n.º 22
0
		private static void TestAddManga(ICredentialContext credential)
		{
			var methods = new MangaListMethods(credential);
			methods.AddManga(MANGA_ID, _mangaData);
		}
		protected MyAnimeListMethods(ICredentialContext credentialContext)
		{
			CredentialContext = credentialContext;
		}
Exemplo n.º 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)
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 32
0
 public SearchMethods(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
Exemplo n.º 33
0
 public CredentialContextFixture()
 {
     CredentialContext = new CredentialContext();
 }
		public VerifyCredentialsRequestParameters(ICredentialContext credential)
			: base(credential)
		{
			Credential = credential;
		}
Exemplo n.º 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;
 }
Exemplo n.º 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)
		{
		}
Exemplo n.º 39
0
 public AnimeSearchMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
Exemplo n.º 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)
		{
		}
Exemplo n.º 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);
		}
Exemplo n.º 43
0
		public SearchMethods(ICredentialContext credentialContext)
			: base(credentialContext)
		{
		}
 public MangaSearchMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
		public AccountMethodsAsync(ICredentialContext credentialContext) 
			: base(credentialContext)
		{
		}
Exemplo n.º 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;
		}
Exemplo n.º 48
0
 public AccountMethodsAsync(ICredentialContext credentialContext)
     : base(credentialContext)
 {
 }
		public MangaSearchMethodsAsync(ICredentialContext credentialContext) 
			: base(credentialContext)
		{
		}
Exemplo n.º 50
0
		public AnimeListMethods(ICredentialContext credentialContext)
			: base(credentialContext)
		{
		}
		public DeleteAnimeRequestParameters(ICredentialContext credential, int? id, string data = "")
			: base(credential, id, data)
		{
		}