Пример #1
0
        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();
        }
Пример #2
0
        // Initialisation
        public Storage(string azureAccountName, string azureKey)
        {
            blobFactory = new BlobFactory(azureAccountName, azureKey);

            // allocate childrens
            user = new UserStorage(blobFactory);
            account = new AccountStorage(blobFactory);
            list = new ListStorage(blobFactory);
            msg = new MsgStorage(blobFactory);
        }
Пример #3
0
 // 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();
 }
Пример #4
0
 // Constuctor
 public AccountStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #5
0
 // Constuctor
 public AccountStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #6
0
        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");
        }
Пример #7
0
 public MsgStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #8
0
        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;
        }
Пример #9
0
 // Constuctor
 public UserStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #10
0
 // Constuctor
 public ListStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #11
0
 // Constuctor
 public ListStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #12
0
        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);
        }
Пример #13
0
 // Constuctor
 public UserStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }
Пример #14
0
 public MsgStorage(BlobFactory blobFactory)
 {
     this.blobFactory = blobFactory;
 }