示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetaPropWindow"/> class.
 /// </summary>
 /// <param name="guid">The <see cref="Guid"/> of the Asset.</param>
 /// <param name="fileSystem">The file system.</param>
 public MetaPropWindow(Guid guid, Common.FileSystem.IO fileSystem, Common.CouchDB.Database couchdb)
 {
     InitializeComponent();
     _metaForm    = null;
     _guid        = guid;
     _metaasset   = null;
     _selectedTvi = null;
     _fileSystem  = fileSystem;
     _couchdb     = couchdb;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MetaPropWindow"/> class.
 /// </summary>
 /// <param name="guid">The <see cref="Guid"/> of the Asset.</param>
 /// <param name="fileSystem">The file system.</param>
 public MetaPropWindow(Guid guid, Common.FileSystem.IO fileSystem, Common.CouchDB.Database couchdb)
 {
     InitializeComponent();
     _metaForm = null;
     _guid = guid;
     _metaasset = null;
     _selectedTvi = null;
     _fileSystem = fileSystem;
     _couchdb = couchdb;
 }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            // DO NOT REORDER variable instantiation unless you know what you are doing!!!

            InitializeComponent();

            // Settings should come first
            Settings.Instance = Settings.Load(Utilities.GetAppDataPath() + "Settings.xml");
            if (Settings.Instance == null)
            {
                SettingsWindow win = new SettingsWindow();
                Settings.Instance = new Settings();
                win.ShowDialog();
            }

            // File System must be set after settings
            FileSystem = new Common.FileSystem.IO(Settings.Instance.StorageLocation);

            // Logger can be started after FileSystem
            Logger = new Common.Logger(Utilities.GetAppDataPath());

            // CouchDB can be instantiated after both FileSystem and Logger
            _couchdb = new Common.CouchDB.Database(Settings.Instance.CouchDatabaseName,
                                                   new Common.CouchDB.Server(Settings.Instance.CouchServerIp, Settings.Instance.CouchServerPort));

            Common.ErrorManager.UpdateUI actErrorUpdateUI = ErrorUpdateUI;

            ErrorManager       = new Common.ErrorManager(actErrorUpdateUI);
            _statusBarItemGuid = Guid.Empty;
            _workMaster        = new Master(ErrorManager, FileSystem, _couchdb);
            IdTranslation      = new Dictionary <Guid, Guid>();
            _fsWatcher         = new FileSystemWatcher(Settings.Instance.StorageLocation);
            _fsWatcher.IncludeSubdirectories = true;
            _fsWatcher.NotifyFilter          = NotifyFilters.LastWrite;
            _fsWatcher.Changed            += new FileSystemEventHandler(FS_Changed);
            _fsWatcher.EnableRaisingEvents = true;
            _addedFileMappings             = new Dictionary <string, Guid>();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);


            ResourceTree.OnRelease      += new ResourceTreeView.EventDelegate(ResourceTree_OnRelease);
            ResourceTree.OnCancel       += new ResourceTreeView.EventDelegate(ResourceTree_OnCancel);
            ResourceTree.OnItemSelect   += new ResourceTreeView.EventDelegate(ResourceTree_OnItemSelect);
            ResourceTree.OnReload       += new ResourceTreeView.EventDelegate(ResourceTree_OnReload);
            ResourceTree.OnStatusUpdate += new ResourceTreeView.StatusUpdateDelegate(ResourceTree_OnStatusUpdate);

            ResourceTree.RegisterStatusBarItem(SBItem);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            // DO NOT REORDER variable instantiation unless you know what you are doing!!!

            InitializeComponent();

            // Settings should come first
            Settings.Instance = Settings.Load(Utilities.GetAppDataPath() + "Settings.xml");
            if (Settings.Instance == null)
            {
                SettingsWindow win = new SettingsWindow();
                Settings.Instance = new Settings();
                win.ShowDialog();
            }

            // File System must be set after settings
            FileSystem = new Common.FileSystem.IO(Settings.Instance.StorageLocation);

            // Logger can be started after FileSystem
            Logger = new Common.Logger(Utilities.GetAppDataPath());

            // CouchDB can be instantiated after both FileSystem and Logger
            _couchdb = new Common.CouchDB.Database(Settings.Instance.CouchDatabaseName,
                new Common.CouchDB.Server(Settings.Instance.CouchServerIp, Settings.Instance.CouchServerPort));

            Common.ErrorManager.UpdateUI actErrorUpdateUI = ErrorUpdateUI;

            ErrorManager = new Common.ErrorManager(actErrorUpdateUI);
            _statusBarItemGuid = Guid.Empty;
            _workMaster = new Master(ErrorManager, FileSystem, _couchdb);
            IdTranslation = new Dictionary<Guid, Guid>();
            _fsWatcher = new FileSystemWatcher(Settings.Instance.StorageLocation);
            _fsWatcher.IncludeSubdirectories = true;
            _fsWatcher.NotifyFilter = NotifyFilters.LastWrite;
            _fsWatcher.Changed += new FileSystemEventHandler(FS_Changed);
            _fsWatcher.EnableRaisingEvents = true;
            _addedFileMappings = new Dictionary<string, Guid>();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);


            ResourceTree.OnRelease += new ResourceTreeView.EventDelegate(ResourceTree_OnRelease);
            ResourceTree.OnCancel += new ResourceTreeView.EventDelegate(ResourceTree_OnCancel);
            ResourceTree.OnItemSelect += new ResourceTreeView.EventDelegate(ResourceTree_OnItemSelect);
            ResourceTree.OnReload += new ResourceTreeView.EventDelegate(ResourceTree_OnReload);
            ResourceTree.OnStatusUpdate += new ResourceTreeView.StatusUpdateDelegate(ResourceTree_OnStatusUpdate);

            ResourceTree.RegisterStatusBarItem(SBItem);
        }