Ejemplo n.º 1
0
 private void onModelFileLoaded()
 {
     if (ModelFileLoaded != null)
     {
         ModelFileLoaded(this, EventArgs.Empty);
     }
     NotifyPropertyChanged("LoadedModel");
     NotifyPropertyChanged("LogElements");
     currentFileState = EditorFileState.ImportComplete;
     onMeshSelected();
 }
Ejemplo n.º 2
0
        public Presenter()
        {
            uiDispatcher                  = Dispatcher.CurrentDispatcher;
            progressUpdateTimer           = new DispatcherTimer();
            progressUpdateTimer.Interval  = new TimeSpan(0, 0, 0, 0, uiUpdateDelay);
            progressUpdateTimer.Tick     += progressUpdateTimer_Tick;
            explorerActive                = true;
            fileProgress                  = new Progress <float>();
            fileProgress.ProgressChanged += fileProgress_ProgressChanged;
            modelMgr = new ModelManager();
            modelMgr.FileProgressWatcher = fileProgress;
            dirListing                = new RangeObservableCollection <DetailedFSElement>();
            dirListView               = CollectionViewSource.GetDefaultView(dirListing);
            dirListView.Filter        = fileVisibleFilter;
            importableFileView        = new ListCollectionView(dirListing);
            importableFileView.Filter = fileImportableFilter;

            meshSelectorElements = new ObservableCollection <int>();
            currentMesh          = 0;
            currMdlPath          = "";
            addressBarText       = CWD.FullName;
            currentFileState     = EditorFileState.NothingLoaded;
            showOnlyImportable   = false;

            //activate fs watcher
            cwdWatcher          = new FileSystemWatcher(CWD.FullName);
            cwdWatcher.Changed += cwdWatcherUpdateCWD;
            cwdWatcher.Deleted += cwdWatcherUpdateCWD;
            cwdWatcher.Created += cwdWatcherUpdateCWD;
            cwdWatcher.Renamed += cwdWatcherRenamed;

            //and start watching!
            cwdWatcher.EnableRaisingEvents = true;

            verbLevel = LogElement.LogVerbosity.Debug;
            //init log filter
            logView        = CollectionViewSource.GetDefaultView(modelMgr.LogElements);
            logView.Filter = verbosityFilter;

            NotifyPropertyChanged(null);
            updateFSData();
        }
Ejemplo n.º 3
0
 private void setCurrentFileState(EditorFileState newState)
 {
     currentFileState = newState;
     NotifyPropertyChanged("FileState");
 }