コード例 #1
0
        public bool Contains(HexaSnapShot value)
        {
            foreach (HexaSnapShot s in base.List)
            {
                if (value.Equals(s))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        private TreeNode[] MakeHexaSnapShotNode()
        {
            int hexaCount = this._Projet.HexaSnapShot.Count;

            TreeNode[]   HexaNodes = new TreeNode[hexaCount];
            HexaSnapShot HexaFile  = new HexaSnapShot();

            for (int i = 0; i < hexaCount; i++)
            {
                HexaFile                        = (HexaSnapShot)this._Projet.HexaSnapShot[i];
                HexaNodes[i]                    = new TreeNode();
                HexaNodes[i].Text               = HexaFile.Name;
                HexaNodes[i].ImageIndex         = 5;
                HexaNodes[i].SelectedImageIndex = 5;
                HexaNodes[i].Tag                = HexaFile.Key;
            }

            return(HexaNodes);
        }
コード例 #3
0
        private void button11_Click(object sender, System.EventArgs e)
        {
            Project       myProject = new Project();
            TextFile      txt       = new TextFile();
            HexaSnapShot  hexa      = new HexaSnapShot();
            TBLFile       tbl       = new TBLFile();
            TableFixeFile fixe      = new TableFixeFile();
            Favoris       mark      = new Favoris();
            Task          task      = new Task();

            myProject.CreateProject("FF2", @"c:", "ff2.smc", "ff2.tbl");

            for (int i = 0; i < 4; i++)
            {
                myProject.Textes.Add(txt);
                myProject.HexaSnapShot.Add(hexa);
                myProject.Tables.Add(tbl);
                myProject.TableFixe.Add(fixe);
                myProject.Favoris.Add(mark);
                myProject.Taches.Add(task);
            }

            myProject.Save();
        }
コード例 #4
0
 public int IndexOf(HexaSnapShot value)
 {
     return(base.List.IndexOf(value));
 }
コード例 #5
0
 public void Insert(int index, HexaSnapShot value)
 {
     base.List.Insert(index, value as object);
 }
コード例 #6
0
 public void Remove(HexaSnapShot value)
 {
     base.List.Remove(value as object);
 }
コード例 #7
0
        public HexaSnapShot Add(HexaSnapShot value)
        {
            base.List.Add(value as object);

            return(value);
        }
コード例 #8
0
        /// <summary>
        /// Obtenir l'objet selectionné
        /// (TODO : a optimiser bientot)
        /// </summary>
        /// <remarks>
        /// ExplorerNodeType.HexaFile = objet de type : VRS.Library.Projet.HexaSnapShot
        /// ExplorerNodeType.TBLFile = objet de type : VRS.Library.Projet.TBLStream
        /// ExplorerNodeType.Root = objet de type : VRS.Library.Projet.Project
        /// ExplorerNodeType.Nothing = objet de type : null
        /// </remarks>
        public object GetSelectedObject()
        {
            SnesRom snes = null;

            switch (this.SelectedItemType)
            {
            case ExplorerNodeType.HexaFile:
                HexaSnapShot hexsnap = null;
                for (int i = 0; i < this._Projet.HexaSnapShot.Count; i++)
                {
                    if (((HexaSnapShot)this._Projet.HexaSnapShot[i]).Key == tvProject.SelectedNode.Tag.ToString())
                    {
                        hexsnap = (HexaSnapShot)this.Projet.HexaSnapShot[i];
                    }
                }
                return(hexsnap);

            case ExplorerNodeType.TBLFile:
                TBLStream tbl = null;
                for (int i = 0; i < this._Projet.Tables.Count; i++)
                {
                    if (((TBLFile)this._Projet.Tables[i]).Key == tvProject.SelectedNode.Tag.ToString())
                    {
                        string path = this._Projet.ProjectPath + Path.DirectorySeparatorChar + ((TBLFile)this.Projet.Tables[i]).RelativePath;
                        tbl     = new TBLStream(path);
                        tbl.key = tvProject.SelectedNode.Tag.ToString();
                        tbl.Load();
                    }
                }
                return(tbl);

            case ExplorerNodeType.TextFile:
                TextFile txt = null;
                for (int i = 0; i < this._Projet.Textes.Count; i++)
                {
                    if (((TextFile)this._Projet.Textes[i]).key == tvProject.SelectedNode.Tag.ToString())
                    {
                        txt = (TextFile)this.Projet.Textes[i];
                    }
                }
                return(txt);

            case ExplorerNodeType.Root:
                return(this._Projet);

            case ExplorerNodeType.Folder:
                //TODO: a finir
                Folder dir = new Folder();
                return(dir);

            case ExplorerNodeType.Rom:
                snes = new SnesRom(this._Projet.ProjectPath + @"\" + this._Projet.RomFile);
                snes.Load();
                return(snes);

            case ExplorerNodeType.WorkRom:
                snes = new SnesRom(this._Projet.ProjectPath + @"\" + this._Projet.WorkRomFile);
                snes.Load();
                return(snes);

            default:
                return(null);
            }
        }