Пример #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            CrearCuenta nuevaCuenta = new CrearCuenta();

            OdysseyCloudAPIConsumer APIConsumer = new OdysseyCloudAPIConsumer();

            //Se trata de crear el nuevo usuario
            UserInfo userToAuth = APIConsumer.CreateUser(new UserInfo() { Nickname = "NewUser123", Password = "******",Name ="NombreNuevoUsuario" }).Result;

            //Si el usuario que se retorna no es nulo
            if (!userToAuth.UserId.Equals(new Guid()))
            {
                SessionManager.Instance.Nickname = userToAuth.Nickname;
                SessionManager.Instance.Name = userToAuth.Name;
                SessionManager.Instance.UserId = userToAuth.UserId;
            }

            nuevaCuenta.Show();
            this.Close();
        }
Пример #2
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     SessionManager instance = SessionManager.Instance;
     instance.UserId = new Guid();
     LibraryManager lm = new LibraryManager();
     //lm.ImportSongsToLibrary("C:\\Users\\Manuel\\Desktop\\mudi");
     instance.UserId=Guid.Parse("1bbe27bd-164f-4798-9e15-6f4fb2f4bbab");
     instance.Nickname = "Majesco";
        // lm = new LibraryManager();
     //lm.ImportSongsToLibrary("C:\\Users\\Manuel\\Desktop\\mudi1");
     lm.InitializeLibrary();
     //OdysseyCloudAPIConsumer ocac =new OdysseyCloudAPIConsumer();
     //var a =ocac.GetUserAuth(new UserInfo() {Nickname = "manzumbado", Password = "******"});
     //Console.WriteLine(a);
     FileManager fm= new FileManager();
     fm.GetUserPathToOdysseyMusic();
     string reslt =fm.uploadFile(@"C:\Users\Manuel\Desktop\music\09 Eclipse.mp3");
     string result2 = fm.downloadFile(reslt);
     CrearCuenta nuevaCuenta = new CrearCuenta();
     nuevaCuenta.Show();
     this.Close();
 }