private void ProcessErrorAndSendChangeProjectRequest(ProjectError projectError) { Error = projectError.ErrorMessage + ": " + projectError.ProjectName; LogAndShowError(); selectedProject = DefaultContentProjectName; Logger.Info("Trying to change project to default project: " + selectedProject); connection.Send(new ChangeProjectRequest(selectedProject)); }
private void button12_Click(object sender, System.EventArgs e) { Project myProject = new Project(@"C:\FF2\FF2.vrsproj"); ProjectError err = myProject.Load(); if (err != ProjectError.NoError) { MessageBox.Show(err.ToString()); } else { propertyGrid1.SelectedObject = myProject; MessageBox.Show("Nombre de Tables" + myProject.Tables.Count); } }
/// <summary> /// Raises the <see cref="ProjectError" /> event. /// </summary> /// <param name="e">The <see cref="BuildTrackerProjectErrorEventArgs" /> instance containing the event data.</param> protected virtual void OnProjectError(BuildTrackerProjectErrorEventArgs e) { ProjectError?.Invoke(this, e); }
/// <summary> /// Charger un projet dans l'explorateur de projet /// </summary> /// <param name="FileName">Chemin du fichier a charger</param> /// <returns> /// Retourne une enumeration du type ProjectError qui /// dicte le type d'erreur rencontré lors du chargement /// </returns> public ProjectError LoadProject(string FileName, bool Refresh) { ProjectError returnValue = ProjectError.NoError; if (File.Exists(FileName)) { if (!Refresh) { //Efface le projet courrant CloseProject(); this._FileName = FileName; //Cree un nouveau projet this._Projet = new Project(FileName); returnValue = this._Projet.Load(); } else { this.tvProject.Nodes.Clear(); returnValue = ProjectError.NoError; } //Creation des nodes pour le treeview du ProjectExplorer if (returnValue == ProjectError.NoError) { tvProject.BeginUpdate(); //Creation des rom string ProjectPath = this._Projet.ProjectPath; string romPath = ProjectPath + @"\" + this._Projet.RomFile; string romWorkPath = ProjectPath + @"\" + this._Projet.WorkRomFile; SnesRom snes = new SnesRom(ProjectPath + @"\" + this._Projet.RomFile); snes.Load(); TreeNode RomNode = new TreeNode(snes.RomName); RomNode.ImageIndex = 6; RomNode.SelectedImageIndex = 6; RomNode.Tag = "rom"; snes.Load(romWorkPath); TreeNode WorkRomNode = new TreeNode(snes.RomName); WorkRomNode.ImageIndex = 7; WorkRomNode.SelectedImageIndex = 7; WorkRomNode.Tag = "workrom"; //Creation des fichier Table TreeNode TableNode = new TreeNode(this._String_TBL, MakeTableNode()); TableNode.ImageIndex = 2; TableNode.SelectedImageIndex = 2; TableNode.Tag = "tbl"; //Creation des Fichier Texte TreeNode TextNode = new TreeNode(this._String_Texte, MakeTextNodes()); TextNode.SelectedImageIndex = 2; TextNode.ImageIndex = 2; TextNode.Tag = "text"; //Creation des Fichier Binaire TreeNode HexaNode = new TreeNode(this._String_Hexa, MakeHexaSnapShotNode()); HexaNode.ImageIndex = 2; HexaNode.SelectedImageIndex = 2; HexaNode.Tag = "hexasnap"; //Ajoute la racine au tree view TreeNode[] RootChild = new TreeNode[5] { RomNode, WorkRomNode, TextNode, TableNode, HexaNode }; TreeNode root = new TreeNode(this._String_Projet + " - '" + this._Projet.Name + "'", RootChild); root.ImageIndex = 0; root.Tag = "root"; root.Expand(); tvProject.Nodes.Add(root); tvProject.EndUpdate(); //Fin de la fonction return(returnValue); } else { return(returnValue); //Fin de la fonction } } else { return(ProjectError.FileNotFound); //Fin de la fonction } }