Esempio n. 1
0
        //Load a directory when TabViewModel.SelectedFolder is changed.
        public void Open(DirectoryInfoEx dir)
        {
            if (!Directory.Exists(dir.FullName))
            {
                return;
            }
            if (_model != null)
            {
                CloseLibrary();
            }

            //open
            _model = new BblLibrary(dir);
            _model.LibraryLoaded += OnLibraryLoaded;

            Tab.ProgressValue         = 0;
            Tab.ProgressMaximum       = 100;
            Tab.ProgressIsDeterminate = true;

            _books = new VmCollection <BookViewModel, BblBook>(_model.Books, this);
            NotifyOfPropertyChange(() => Books);


            _booksCV = (ListCollectionView)CollectionViewSource.GetDefaultView(_books);
            ((INotifyCollectionChanged)(_booksCV)).CollectionChanged += OnBooksCollectionChanged;
            NotifyOfPropertyChange(() => BooksCV);

            Tab.ResetSortUI();
            Tab.TabState.currentBookmark.libraryPath = dir.FullName;
            _booksCV.CustomSort = comparer;
        }
Esempio n. 2
0
        private static void StartFromVm()
        {
            // TODO: Look at VM nic/nsg operations on VM
            //make sure vm exists
            CreateSingleVmExample();

            //retrieve from lowest level, doesn't give ability to walk up and down the container structure
            AzureVm vm = VmCollection.GetVm(subscriptionId, rgName, vmName);

            Console.WriteLine("Found VM {0}", vm.Id);


            //retrieve from lowest level inside management package gives ability to walk up and down
            AzureResourceGroup rg  = AzureClient.GetResourceGroup(subscriptionId, rgName);
            AzureVm            vm2 = rg.Vms()[vmName];

            Console.WriteLine("Found VM {0}", vm2.Id);
        }