Exemplo n.º 1
0
        private void MainUserControl_Load(object sender, EventArgs e)
        {
            try
            {
                objectProperties.MainUserControl = this;

                MapModel.Attach(this);
                //TrueModel.Instance.MapModels.Add(MapModel);

                editor.MainUserControl = this;
                editor.Camera.Notify();

                classManager = new ClassManager();
                modelsNode   = assetTreeView.Nodes.Add("Models");
                scriptsNode  = assetTreeView.Nodes.Add("Scripts");

                string scriptDir = AssemblyDirectory + "\\Scripts";
                if (!Directory.Exists(scriptDir))
                {
                    Directory.CreateDirectory(scriptDir);
                }
                fileSystemWatcher = new FileSystemWatcher(scriptDir);
                fileSystemWatcher.IncludeSubdirectories = true;
                fileSystemWatcher.Changed            += new FileSystemEventHandler(fileSystemWatcher_Changed);
                fileSystemWatcher.Created            += new FileSystemEventHandler(fileSystemWatcher_Created);
                fileSystemWatcher.Deleted            += new FileSystemEventHandler(fileSystemWatcher_Deleted);
                fileSystemWatcher.Renamed            += new RenamedEventHandler(fileSystemWatcher_Renamed);
                fileSystemWatcher.EnableRaisingEvents = true;
                UpdateScriptAssets();

                UpdateObserver();
            }
            catch (Exception ex)
            {
                if (!DesignMode)
                {
                    toolStripStatusLabel1.Text = ex.Message + "\r\n" + ex.StackTrace;
                }
            }
        }