static void Main(string[] args) { Console.WriteLine("Clearing previous data"); BlobFactory blobFactory = new BlobFactory(azureAccountName, azureAccountKey); blobFactory.InitStorage(); Console.WriteLine("Init connexions"); Storage storage = new Storage(azureAccountName, azureAccountKey); Guid userId = storage.User.Create("tagada", "*****@*****.**", new byte[1]); Guid account1ID = storage.Account.Create(userId, "account1", ""); Guid account2ID = storage.Account.Create(userId, "account2", ""); Guid account3ID = storage.Account.Create(userId, "account3", ""); Guid listID = storage.List.Create(account1ID, "list", "", false); HashSet <Guid> listSet = new HashSet <Guid>(); listSet.Add(listID); storage.List.Add(listID, account2ID); storage.Msg.Post(account2ID, "A2 M1"); storage.Msg.Post(account3ID, "A3 M1"); storage.List.Add(listID, account3ID); List <IMessage> messages = storage.Msg.GetListsMsgTo(listSet, DateTime.MaxValue, 10); Console.ReadLine(); }
public void InitStorage() { BlobFactory blobFactory = new BlobFactory(azureAccountName, azureAccountKey); blobFactory.InitStorage(); storage = new Storage(azureAccountName, azureAccountKey); Guid userId = storage.User.Create("userThatExists", "*****@*****.**", new Byte[1]); Guid accountId = storage.Account.Create(userId, "accountThatExists", "accountThatExistsDesc"); storage.User.Create("otherUserThatExists", "*****@*****.**", new Byte[1]); Guid otherAccountId = storage.Account.Create(userId, "otherAccountThatExists", "otherAccountThatExistsDesc"); }
public void InitStorage() { var blobFactory = new BlobFactory(azureAccountName, azureAccountKey); blobFactory.InitStorage(); storage = new Storage(azureAccountName, azureAccountKey); _userId = storage.User.Create("userThatExists", "*****@*****.**", new Byte[1]); _accountId = storage.Account.Create(_userId, "accountThatExists", "accountThatExistsDesc"); storage.User.Create("otherUserThatExists", "*****@*****.**", new Byte[1]); _otherAccountId = storage.Account.Create(_userId, "otherAccountThatExists", "otherAccountThatExistsDesc"); _listId = storage.List.Create(_accountId, "listThatExists", "This list exists", false); _listIdPrivate = storage.List.Create(_accountId, "listThatExistsPrivate", "This list exists and is private", true); _date = DateTime.Now; }
public void InitStorage() { BlobFactory blobFactory = new BlobFactory(azureAccountName, azureAccountKey); blobFactory.InitStorage(); storage = new Storage(azureAccountName, azureAccountKey); Guid userId = storage.User.Create("userThatExists", "*****@*****.**", new Byte[1]); accountId = storage.Account.Create(userId, "accountThatExists", "accountThatExistsDesc"); storage.User.Create("otherUserThatExists", "*****@*****.**", new Byte[1]); otherAccountId = storage.Account.Create(userId, "otherAccountThatExists", "otherAccountThatExistsDesc"); listIdThatExists = storage.List.Create(accountId, "listThatExists", "Yeah", false); storage.List.Add(listIdThatExists, accountId); storage.List.Add(listIdThatExists, otherAccountId); storage.List.Follow(listIdThatExists, accountId); storage.List.Follow(listIdThatExists, otherAccountId); }
// Lauch this program to reinit the storage static void Main(string[] args) { Console.WriteLine("Vous êtes sur le point de réinitialiser le compte de storage suivant :"); Console.WriteLine("nom de compte : " + azureAccountName); Console.WriteLine("clé du compte : " + azureAccountKey); Console.Write("Etes vous sur de vouloir effacer le storage ? (o/N)"); string answer = Console.ReadLine(); if (answer == "o") { BlobFactory blobFactory = new BlobFactory(azureAccountName, azureAccountKey); blobFactory.InitStorage(); Console.Write("Le compte storage a été réinitialisé"); } else { Console.WriteLine("Rien n'a été fait."); } Console.WriteLine("Appuyer sur une touche pour quitter."); Console.ReadKey(); }