Beispiel #1
0
        public MainWindowViewModel()
        {
            var path = Path.GetTempFileName();

            using (var database = global::IsabelDb.Database.OpenOrCreate(path, new[] { typeof(ProcessorArchitecture) }))
            {
                var bag = database.GetOrCreateBag <object>("A");
                bag.Put(1337);
                bag.Put(9001);
                bag.Put(DateTime.Now);
                bag.Put(DateTime.UtcNow);
                bag.Put(IPAddress.Loopback);
                bag.Put(IPAddress.Any);
                bag.Put(IPAddress.IPv6Loopback);
                bag.Put(IPAddress.IPv6Any);
                bag.Put(new Version(1, 0));
                bag.Put(new Version(1, 2, 3));
                bag.Put(new Version(1, 2, 3, 4));
                bag.Put(ProcessorArchitecture.Amd64);
                bag.Put("Stuff");

                var queue = database.GetOrCreateQueue <int>("B");
                queue.Enqueue(42);
                queue.Enqueue(9001);
                queue.Enqueue(1337);

                var dictionary = database.GetOrCreateDictionary <int, string>("C");
                dictionary.Put(42, "Answer to the Ultimate Question of Life, the Universe, and Everything");
            }

            Database = new DatabaseViewModel(new DatabaseProxy(path));
        }
Beispiel #2
0
 public void OpenFile(string fileName)
 {
     Database = new DatabaseViewModel(new DatabaseProxy(fileName));
 }