public DialogCollectionSetClosingUnsaved(TabItem targetTab, CollectionSet unsavedCollection, TileManager tileManager)
 {
     InitializeComponent();
     (DataContext as DialogCollectionSetClosingUnsavedViewModel).UnsavedCollection = unsavedCollection;
     this.targetTab   = targetTab;
     this.tileManager = tileManager;
 }
 public TileManagerDesignViewModel()
 {
     SelectedCollection = new CollectionSet("Test")
     {
         TileFile      = new CollectionFile <Tile>(CollectionType.Tiles),
         PlaceableFile = new CollectionFile <Placeable>(CollectionType.Placeables)
     };
 }
        public static void Main(string[] args)
        {
            Console.WriteLine("Running csbatchupload...");

            if (args.Length < 2)
            {
                Console.WriteLine("Must specify the root load folder as first parameter");
                Console.WriteLine("Must specify the collection as second parameter");
                Console.WriteLine("Usage: csbatchupload <folder> <collection>");
                Console.WriteLine("Example Usage: csbatchupload ./some/folder mydocs");
                return;
            }

            UploadObserver obs = new UploadObserver();

            Connection conn = new mlclient.Connection();

            conn.configure("192.168.123.4", "8122", "admin", "admin", false);

            DocumentBatchWriter writer = new DocumentBatchWriter(conn);

            writer.addBatchListener(obs);
            CollectionSet colList = new CollectionSet();

            colList.Add(args[1]);
            PermissionSet permList = new PermissionSet();
            Permission    perm     = new Permission("admin", Capability.EXECUTE);

            permList.Add(perm);

            DocumentSet set = new DocumentSet();

            DocumentBatchHelper.addFilesToDocumentSet(args[0], args[0], true, "/csbatchupload/",
                                                      colList, permList, null, set);
            long setSize = set.Count;

            Console.WriteLine("Document Set Size: " + setSize);

            writer.assignDocuments(set);
            writer.send();

            writer.wait();

            //Thread.Sleep(5000); // hack around multi-threading issues


            Console.WriteLine("Exception is nullptr?: " + (null == obs.ex));              // TODO extract exception once STL is supported

            Progress p = writer.getProgress();

            Console.WriteLine("Document set size: " + setSize + ", complete size: " + p.completed);
            Console.WriteLine("Progress: Complete: " + p.completed + ", total: " + p.total + ", pct: " + p.percentageComplete);
            Console.WriteLine("Progress: duration: " + p.duration + ", est remaining duration: "
                              + p.durationEstimateRemaining);
            Console.WriteLine("Progress: Overall rate: " + p.rate);

            Console.WriteLine("batch upload complete");
        }
        public RoomPlanViewModel()
        {
            LoadAvailableTilesAndObjects();
            mSelectedCollection = LoadedCollections.FirstOrDefault();

            Mediator.Instance.Register(o =>
            {
                LoadAvailableTilesAndObjects();
            }, ViewModelMessage.LoadedCollectionsChanged);
        }
Beispiel #5
0
 private void DialogRemoveCollection_DialogCompleted(object sender, DialogButtonClickedEventArgs e)
 {
     if (e.DialogResult == DialogResult.OK)
     {
         TileManagerViewModel vm = DataContext as TileManagerViewModel;
         CollectionSet        selectedCollection = vm.SelectedCollection;
         selectedCollection.Delete();
         vm.LoadedCollections.Remove(selectedCollection);
         vm.SelectedCollection = null;
     }
 }
Beispiel #6
0
        private void Import_Click(object sender, RoutedEventArgs e)
        {
            TileManagerViewModel vm     = DataContext as TileManagerViewModel;
            OpenFileDialog       dialog = new OpenFileDialog()
            {
                Filter       = "Collection package|*.col",
                AddExtension = true
            };


            if (dialog.ShowDialog() == true)
            {
                CollectionSet imported = CollectionSet.ImportFromFile(dialog.FileName);
                vm.LoadedCollections.Add(imported);
                vm.SelectedCollection = imported;
            }
        }