当前位置: 首页>>代码示例>>C#>>正文


C# DJsIO.Dispose方法代码示例

本文整理汇总了C#中X360.IO.DJsIO.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# DJsIO.Dispose方法的具体用法?C# DJsIO.Dispose怎么用?C# DJsIO.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在X360.IO.DJsIO的用法示例。


在下文中一共展示了DJsIO.Dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: addFileToolStripMenuItem_Click

 private void addFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenFileDialog ofd = new OpenFileDialog();
     ofd.Multiselect = true;
     ofd.Title = "Open Xbox Live Packages";
     ofd.Filter = "";
     if (ofd.ShowDialog() != DialogResult.OK)
         return;
     menuStrip1.Enabled = groupPanel1.Enabled = listBox1.Enabled = false;
     progressBarX1.Value = 0;
     progressBarX1.Maximum = ofd.FileNames.Length;
     foreach (string x in ofd.FileNames)
     {
         DJsIO y = null;
         try { y = new DJsIO(x, DJFileMode.Open, true); }
         catch { progressBarX1.Value++; continue; }
         if (!y.Accessed)
         {
             progressBarX1.Value++;
             continue;
         }
         y.Position = 0;
         if (y.ReadUInt32() == (uint)AllMagic.CON)
             listBox1.Items.Add(x);
         y.Dispose();
         if (checkBoxX3.Checked)
             fix(listBox1.Items.Count - 1);
         progressBarX1.Value++;
     }
     menuStrip1.Enabled = groupPanel1.Enabled = listBox1.Enabled = true;
 }
开发者ID:VictorOverX,项目名称:X360,代码行数:31,代码来源:MultiSTFS.cs

示例2: IsFATX

        /// <summary>
        /// Determins if a Drive is FATX format
        /// </summary>
        /// <param name="xIO">Stream to check</param>
        /// <param name="xType">Grabs the type of drive</param>
        /// <returns></returns>
        public static bool IsFATX(ref DJsIO xIO, out DriveTypes xType)
        {
            // Tries to read the offsets of Xbox 360 drives to see if the magic's match
            xType = DriveTypes.Unknown;

            try
            {
                if (xIO.IOType != DataType.Drive || ((DriveIO)xIO).xDrive.Type != DeviceType.LogicalDrive)
                    throw new Exception();
                string dat0 = ((DriveIO)xIO).xDrive.DeviceName + @"\Xbox360\Data0000";
                if (!File.Exists(dat0))
                    throw new Exception();

                var fa = File.GetAttributes(dat0);
                if ((fa & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                {
                    return false;
                }
                DJsIO xio = new DJsIO(dat0, DJFileMode.Open, true);
                if (!xio.Accessed)
                    throw new Exception();
                xio.Position = (long)USB.Partition1;
                try
                {
                    if (xio.ReadUInt32() == (uint)AllMagic.FATX)
                    {
                        xType = DriveTypes.USBFlashDrive;
                        xio.Dispose();
                        return true;
                    }
                }
                catch { }
                xio.Dispose();
            }
            catch { }

            try
            {
                xIO.Position = (long)MU.Partition2;
                if (xIO.ReadUInt32() == (uint)AllMagic.FATX)
                {
                    xType = DriveTypes.MemoryUnit;
                    return true;
                }
            }
            catch { }
            try
            {
                xIO.Position = (long)HDD.Partition5;
                if (xIO.ReadUInt32() == (uint)AllMagic.FATX)
                {
                    xType = DriveTypes.HardDrive;
                    return true;
                }
            }
            catch { }
            try
            {
                xIO.Position = 8;
                xIO.Position = (xIO.ReadUInt32() * 0x200);
                if (xIO.ReadUInt32() == (uint)AllMagic.FATX)
                {
                    xType = DriveTypes.DevHardDrive;
                    return true;
                }
            }
            catch { }
            return false;
        }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:75,代码来源:Management.cs

示例3: MusicFile

 /// <summary>
 /// Initializes this object
 /// </summary>
 /// <param name="FileLocale"></param>
 public MusicFile(string FileLocale)
 {
     xActive = true;
     DJsIO xIO = new DJsIO(FileLocale, DJFileMode.Open, true);
     if (!xIO.Accessed)
         throw STFSExcepts.ParseError;
     try
     {
         xIO.Position = 0;
         xIO.IsBigEndian = true;
         if (xIO.ReadUInt32() != 0x464D494D)
             throw MusicExcepts.NotMusic;
         xIO.Position = 0xC;
         so = xIO.ReadString(StringForm.Unicode, 0x100);
         al = xIO.ReadString(StringForm.Unicode, 0x100);
         ar = xIO.ReadString(StringForm.Unicode, 0x100);
         xIO.Position += 0x200;
         ge = xIO.ReadString(StringForm.Unicode, 0x100);
         IO = xIO;
         xActive = false;
     }
     catch { xIO.Dispose(); throw STFSExcepts.ParseError; }
 }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:27,代码来源:Music.cs

示例4: listBox1_DragDrop

 private void listBox1_DragDrop(object sender, DragEventArgs e)
 {
     menuStrip1.Enabled = groupPanel1.Enabled = listBox1.Enabled = false;
     string[] xfiles = (string[])e.Data.GetData(DataFormats.FileDrop);
     foreach (string x in xfiles)
     {
         DJsIO y = null;
         try { y = new DJsIO(x, DJFileMode.Open, true); }
         catch { continue; }
         if (!y.Accessed)
             continue;
         y.Position = 0;
         if (y.ReadUInt32() == (uint)AllMagic.CON)
             listBox1.Items.Add(x);
         y.Dispose();
         listBox1.SelectedIndex = listBox1.Items.Count - 1;
         Application.DoEvents();
         if (checkBoxX3.Checked)
             fix(listBox1.Items.Count - 1);
     }
     menuStrip1.Enabled = groupPanel1.Enabled = listBox1.Enabled = true;
 }
开发者ID:VictorOverX,项目名称:X360,代码行数:22,代码来源:MultiSTFS.cs

示例5: xEncrypt

 bool xEncrypt(ref DJsIO xNewPayload)
 {
     try
     {
         if (!xSuccess)
             return false;
         if (xIsLive)
         {
             byte[] xService = (ThisType == AccountType.Stock ?
                 new byte[] { 0x50, 0x52, 0x4F, 0x44 } : // PROD
                 new byte[] { 0x50, 0x41, 0x53, 0x54 }); // PART
             xNewPayload.Position = 0x34;
             xNewPayload.Write(xService);
             xNewPayload.Flush();
         }
         List<byte> xReturn = new List<byte>();
         byte[] xConfounder = xRC4.NewConfounder(8);
         byte[] NewPay = xNewPayload.ReadStream();
         xNewPayload.Dispose();
         byte[] xHeaderKey = xComputeHeaderKey(xConfounder, NewPay);
         xRC4.KeyBinary = xComputeRC4Key(xHeaderKey);
         xReturn.AddRange(xHeaderKey);
         xReturn.AddRange(xRC4.KerberosEncrypt(ref xConfounder, ref NewPay));
         IO.Position = 0;
         IO.Write(xReturn.ToArray());
         IO.Flush();
         return true;
     }
     catch { return false; }
 }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:30,代码来源:ProfileTools.cs

示例6: Inject

 /// <summary>
 /// Overwrite the file
 /// </summary>
 /// <param name="FileLocale"></param>
 /// <returns></returns>
 public bool Inject(string FileLocale)
 {
     if (!xref.ActiveCheck())
         return false;
     DJsIO xIO = null;
     bool success = false;
     try
     {
         xIO = new DJsIO(FileLocale, DJFileMode.Open, true);
         if (!xIO.Accessed)
             throw new Exception();
         success = xInject(xIO);
     }
     catch { success = false; }
     if (xIO != null)
         xIO.Dispose();
     return (success & !(xref.xActive = false));
 }
开发者ID:VictorOverX,项目名称:X360,代码行数:23,代码来源:GDFImage.cs

示例7: Replace

 /// <summary>
 /// Replace the file via File Location
 /// </summary>
 /// <param name="FileIn"></param>
 /// <returns></returns>
 public bool Replace(string FileIn)
 {
     DJsIO xIO = null;
     try
     {
         xIO = new DJsIO(FileIn, DJFileMode.Open, true);
         bool Success = Replace(xIO);
         xIO.Dispose();
         return Success;
     }
     catch
     {
         if (xIO != null)
             xIO.Dispose();
         return xPackage.xActive = false;
     }
 }
开发者ID:DarrenRainey,项目名称:snes360savegameconverter,代码行数:22,代码来源:STFSPackage.cs

示例8: KerberosDecrypt

 /// <summary>
 /// Runs a Kerberos implemented RC4 decryption
 /// </summary>
 /// <param name="xConfounder">The confounder input</param>
 /// <param name="xPayload">The payload input</param>
 /// <param name="x">RC4 reference</param>
 /// <param name="xData">Data to be decrypted</param>
 /// <param name="xConLen">Length of the Confounder</param>
 /// <returns></returns>
 public static bool KerberosDecrypt(this RC4 x, byte[] xData, out byte[] xConfounder, int xConLen, out byte[] xPayload)
 {
     xPayload = new byte[0];
     xConfounder = new byte[0];
     try
     {
         DJsIO xOut = new DJsIO(x.RunAlgorithm(xData), true);
         xOut.Position = 0;
         xConfounder = xOut.ReadBytes(xConLen);
         xPayload = xOut.ReadBytes(xData.Length - xConLen);
         xOut.Dispose();
     }
     catch { return false; }
     return true;
 }
开发者ID:VictorOverX,项目名称:X360,代码行数:24,代码来源:Cryptography.cs

示例9: IncreaseXDBFCount

 internal bool IncreaseXDBFCount()
 {
     DJsIO xtemp = new DJsIO(true);
     try
     {
         xtemp.Position = (HeaderSize + (0xFF * 0x12));
         xIO.Position = HeaderSize;
         int len = (int)(xIO.Length - xIO.Position);
         for (int i = 0; i < len; i++)
             xtemp.Write(xIO.ReadByte());
         xtemp.Position = 0;
         xtemp.Write((uint)AllMagic.XDBF);
         xtemp.Write((int)0x10000);
         xEntryMax += 0xFF;
         xtemp.Write((int)xEntryMax);
         xtemp.Write((int)xEntryCurrent);
         xtemp.Write((int)xFreeCurrent);
         xtemp.Write((int)xFreeMax);
         List<XDBFEntry> xEntries = GetEntries();
         foreach (XDBFEntry x in xEntries)
         {
             xtemp.Write((ushort)x.NS);
             xtemp.Write(x.ID);
             xtemp.Write(x.xOffset);
             xtemp.Write(x.Size);
         }
         xtemp.Write(new byte[0x12 * (xEntryMax - xEntries.Count)]);
         foreach (FreeSpaceEntry x in xFreeEnts)
         {
             if (x.Size != 0)
             {
                 xtemp.Write(x.offset);
                 xtemp.Write(x.Size);
             }
         }
         int xdatasize = (int)(xtemp.Length - HeaderSize);
         xtemp.Write(xdatasize);
         xtemp.Write((int)(((-1) - xdatasize)));
         xtemp.Write(new byte[0x8 * (xFreeMax - (xFreeEnts.Count + 1))]);
         xtemp.Flush();
         xtemp.Close();
         xIO.Close();
         VariousFunctions.MoveFile(xtemp.FileNameLong, xIO.FileNameLong);
         xIO = new DJsIO(xIO.FileNameLong, DJFileMode.Open, true);
         return true;
     }
     catch { xtemp.Dispose(true); return false; }
 }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:48,代码来源:GPD.cs

示例10: STFSPackage


//.........这里部分代码省略.........
             x2.Write("AvatarLightingAmbient=0x" + xSession.ThemeSettings.AvatarLightingAmbient.ToString("X"));
             x2.Write(new byte[] { 0xD, 0xA });
             x2.Flush();
             x2.Close();
             if (!xSession.AddFile(x2.FileNameLong, "parameters.ini"))
                 throw STFSExcepts.ThemeError;
         }
         else if (xSession.HeaderData.ThisType == PackageType.GamesOnDemand ||
             xSession.HeaderData.ThisType == PackageType.HDDInstalledGame ||
             xSession.HeaderData.ThisType == PackageType.OriginalXboxGame ||
             xSession.HeaderData.ThisType == PackageType.SocialTitle)
             throw STFSExcepts.Game;
         xLog = LogIn;
         xHeader = xSession.HeaderData;
         xSTFSStruct = new STFSDescriptor(xSession.STFSType, 0);
         xIO = new DJsIO(true);
         List<BlockRecord> DirectoryBlockz = new List<BlockRecord>();
         // switched2 = true;
         uint xcurblock = 0;
         for (ushort i = 0; i < xSession.GetDirectoryCount; i++)
         {
             DirectoryBlockz.Add(new BlockRecord());
             DirectoryBlockz[DirectoryBlockz.Count - 1].ThisBlock = xcurblock++;
             /*if (!switched0.Contains((int)(xcurblock / Constants.BlockLevel[0])))
                 switched0.Add((int)(xcurblock / Constants.BlockLevel[0]));
             if (!switched1.Contains((int)(xcurblock / Constants.BlockLevel[1])))
                 switched1.Add((int)(xcurblock / Constants.BlockLevel[1]));*/
         }
         xFileBlocks = DirectoryBlockz.ToArray();
         xWriteChain(xFileBlocks);
         xSTFSStruct.xDirectoryBlockCount = (ushort)xFileBlocks.Length;
         ushort xCurID = 0;
         xSession.xFolderDirectory.Sort(new Comparison<CFolderEntry>(sortpathct));
         foreach (CFolderEntry x in xSession.xFolderDirectory)
         {
             ushort pointer = 0xFFFF;
             if (x.xthispath.xPathCount() > 1)
                 pointer = xGetParentFolder(x.Path).EntryID;
             xFolderDirectory.Add(new FolderEntry(x.Name, 0, xCurID++, pointer, this));
             xFolderDirectory[xFolderDirectory.Count - 1].xFixOffset();
         }
         foreach (CFileEntry x in xSession.xFileDirectory)
         {
             ushort pointer = 0xFFFF;
             if (x.xthispath.xPathCount() > 1)
                 pointer = xGetParentFolder(x.Path).EntryID;
             xFileDirectory.Add(new FileEntry(x.Name, (int)x.GetLength(), false,xCurID++, pointer, this));
             List<BlockRecord> xAlloc = new List<BlockRecord>();
             for (uint i = 0; i < x.BlockCount(); i++)
             {
                 xAlloc.Add(new BlockRecord());
                 xAlloc[xAlloc.Count - 1].ThisBlock = xcurblock++;
                 /*if (!switched0.Contains((int)(xcurblock / Constants.BlockLevel[0])))
                     switched0.Add((int)(xcurblock / Constants.BlockLevel[0]));
                 if (!switched1.Contains((int)(xcurblock / Constants.BlockLevel[1])))
                     switched1.Add((int)(xcurblock / Constants.BlockLevel[1]));*/
             }
             xFileDirectory[xFileDirectory.Count - 1].xBlockCount = (uint)xAlloc.Count;
             xFileDirectory[xFileDirectory.Count - 1].xStartBlock = xAlloc[0].ThisBlock;
             xFileDirectory[xFileDirectory.Count - 1].xPackage = this;
             xFileDirectory[xFileDirectory.Count - 1].xFixOffset();
             xWriteChain(xAlloc.ToArray());
         }
         AddToLog("Writing Entry Table");
         DJsIO xent;
         if (!xEntriesToFile(out xent))
             throw new Exception();
         xWriteTo(ref xent, xFileBlocks);
         xent.Close();
         VariousFunctions.DeleteFile(xent.FileNameLong);
         AddToLog("Writing Files");
         uint curblck = xSession.GetDirectoryCount;
         foreach (CFileEntry z in xSession.xFileDirectory)
         {
             List<BlockRecord> w = new List<BlockRecord>();
             uint ct = z.BlockCount();
             for (uint y = 0; y < ct; y++)
             {
                 w.Add(new BlockRecord());
                 w[w.Count - 1].ThisBlock = curblck++;
             }
             DJsIO x = null;
             try
             {
                 x = new DJsIO(z.FileLocale, DJFileMode.Open, true);
                 xWriteTo(ref x, w.ToArray());
             }
             catch { }
             if (x != null)
                 x.Dispose();
         }
         xWriteTables();
         xWriteHeader(xSigning);
         xIO.Close();
         VariousFunctions.MoveFile(xIO.FileNameLong, xOutPath);
         xIO = new DJsIO(xOutPath, DJFileMode.Open, true);
         xActive = false;
     }
     catch (Exception x) { xFileDirectory = null; xFolderDirectory = null; xIO.Dispose(); throw x; }
 }
开发者ID:DarrenRainey,项目名称:snes360savegameconverter,代码行数:101,代码来源:STFSPackage.cs

示例11: Inject

 /// <summary>
 /// Overwrites the data from a file location
 /// </summary>
 /// <param name="FileIn"></param>
 /// <returns></returns>
 public bool Inject(string FileIn)
 {
     DJsIO xIO = null;
     //try
     {
         xIO = new DJsIO(FileIn, DJFileMode.Open, true);
         bool Success = Inject(xIO);
         xIO.Dispose();
         return Success;
     }
     //catch
     //{
     //  if (xIO != null)
     //    xIO.Dispose();
     //return xPackage.xActive = false;
     //}
 }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:22,代码来源:STFSPackage.cs

示例12: STFSPackage


//.........这里部分代码省略.........
                throw CryptoExcepts.ParamError;
            if (xSession.xFileDirectory.Count == 0)
                throw new Exception();
            ////try
            {
                //AddToLog("Setting Package variables");

                xroot = new FolderEntry("", 0, 0xFFFF, 0xFFFF, this);
                if (xSession.HeaderData.ThisType == PackageType.GamesOnDemand ||
                    xSession.HeaderData.ThisType == PackageType.HDDInstalledGame ||
                    xSession.HeaderData.ThisType == PackageType.OriginalXboxGame ||
                    xSession.HeaderData.ThisType == PackageType.SocialTitle)
                    throw STFSExcepts.Game;
                xLog = LogIn;
                xHeader = xSession.HeaderData;
                xSTFSStruct = new STFSDescriptor(xSession.STFSType, 0);
                xIO = new DJsIO();
                var DirectoryBlockz = new List<BlockRecord>();
                // switched2 = true;
                uint xcurblock = 0;
                for (ushort i = 0; i < xSession.GetDirectoryCount; i++)
                {
                    DirectoryBlockz.Add(new BlockRecord());
                    DirectoryBlockz[DirectoryBlockz.Count - 1].ThisBlock = xcurblock++;

                }
                xFileBlocks = DirectoryBlockz.ToArray();
                xWriteChain(xFileBlocks);
                xSTFSStruct.xDirectoryBlockCount = (ushort)xFileBlocks.Length;
                ushort xCurID = 0;
                xSession.xFolderDirectory.Sort(new Comparison<CFolderEntry>(sortpathct));
                foreach (var x in xSession.xFolderDirectory)
                {
                    ushort pointer = 0xFFFF;
                    if (x.xthispath.xPathCount() > 1)
                        pointer = xGetParentFolder(x.Path).EntryID;

                    xFolderDirectory.Add(new FolderEntry(x.Name, 0, xCurID++, pointer, this));
                    xFolderDirectory[xFolderDirectory.Count - 1].xFixOffset();
                }
                foreach (CFileEntry x in xSession.xFileDirectory)
                {
                    ushort pointer = 0xFFFF;
                    if (x.xthispath.xPathCount() > 1)
                        pointer = xGetParentFolder(x.Path).EntryID;

                    xFileDirectory.Add(new FileEntry(x.Name,
                        (int)x.GetLength(), false, xCurID++, pointer, this));

                    var xAlloc = new List<BlockRecord>();
                    for (uint i = 0; i < x.BlockCount(); i++)
                    {
                        xAlloc.Add(new BlockRecord());
                        xAlloc[xAlloc.Count - 1].ThisBlock = xcurblock++;

                    }
                    xFileDirectory[xFileDirectory.Count - 1].xBlockCount = (uint)xAlloc.Count;
                    xFileDirectory[xFileDirectory.Count - 1].xStartBlock = xAlloc[0].ThisBlock;
                    xFileDirectory[xFileDirectory.Count - 1].xPackage = this;
                    xFileDirectory[xFileDirectory.Count - 1].xFixOffset();
                    xWriteChain(xAlloc.ToArray());
                }
                //AddToLog("Writing Entry Table");
                DJsIO xent;
                if (!xEntriesToFile(out xent))
                    throw new Exception();
                xWriteTo(ref xent, xFileBlocks);
                xent.Close();
                //VariousFunctions.DeleteFile(xent.FileNameLong);
                //AddToLog("Writing Files");
                uint curblck = xSession.GetDirectoryCount;
                foreach (var z in xSession.xFileDirectory)
                {
                    var w = new List<BlockRecord>();
                    uint ct = z.BlockCount();
                    for (uint y = 0; y < ct; y++)
                    {
                        w.Add(new BlockRecord());
                        w[w.Count - 1].ThisBlock = curblck++;
                    }
                    DJsIO x = null;
                    //try
                    {
                        x = new DJsIO(z.FileData, true);
                        xWriteTo(ref x, w.ToArray());
                    }
                    //catch { }
                    if (x != null)
                        x.Dispose();
                }
                xWriteTables();
                xWriteHeader(xSigning);
                ret = xIO.GetBytes();
                xIO.Close();
                //VariousFunctions.MoveFile(xIO.FileNameLong, xOutPath);

                xActive = false;
            }
            ////catch (Exception x) { xFileDirectory = null; xFolderDirectory = null; xIO.Dispose(); throw x; }
        }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:101,代码来源:STFSPackage.cs

示例13: xWriteHeader

 bool xWriteHeader(RSAParams xParams)
 {
     try
     {
         DJsIO xio = new DJsIO(true);
         xHeaderData.Write(ref xio);
         xio.SetLength(0xB000);
         xio.Position = 0x340;
         xio.Write((uint)0xAD0E);
         xio.Position = 0x379;
         xio.Write(new byte[] { 0x24, 5, 5, 0x11 });
         IO.Position = 0x37D;
         xio.Write(IO.ReadBytes(20));
         xio.Write((byte)((xIsShifted ? 1 : 0) << 6));
         xio.WriteUInt24(xBlockCount);
         xio.Write(xDeviation);
         xio.Flush();
         xio.Position = 0x344;
         byte[] xHash = SHA1Quick.ComputeHash(xio.ReadBytes((int)(xio.Length - 0x344)));
         xio.Position = 0x32C;
         xio.Write(xHash);
         xio.Flush();
         xio.Position = 0x22C;
         xHash = SHA1Quick.ComputeHash(xio.ReadBytes(0x118));
         xio.Position = 4;
         if (xParams.Type == PackageMagic.CON)
         {
             xio.Write(xParams.Certificate);
             xio.Write(ScrambleMethods.StockScramble(RSAQuick.SignatureGenerate(xParams.RSAKeys, xHash), true));
         }
         else
         {
             xio.Write(ScrambleMethods.DevScramble(RSAQuick.SignatureGenerate(xParams.RSAKeys, xHash)));
             xio.Write(new byte[0x128]);
         }
         xio.IsBigEndian = true;
         xio.Position = 0;
         xio.Write(((uint)xParams.Type));
         xio.Flush();
         xHeaderData.xMagic = xParams.Type;
         IO.Position = 0;
         IO.Write(xio.ReadStream());
         IO.Flush();
         xio.Dispose();
         return true;
     }
     catch { return false; }
 }
开发者ID:VictorOverX,项目名称:X360,代码行数:48,代码来源:SVODPackage.cs

示例14: ExtractImage

 /// <summary>
 /// Extracts the image via a file location
 /// </summary>
 /// <param name="fileOut"></param>
 /// <returns></returns>
 public bool ExtractImage(string fileOut)
 {
     if (ActiveCheck())
         return false;
     DJsIO xIOOut = null;
     try { xIOOut = new DJsIO(fileOut, DJFileMode.Create, true); }
     catch { return xactive = false; }
     if (!xIOOut.Accessed)
         return xactive = false;
     bool result = extractimg(xIOOut);
     xIOOut.Dispose();
     return result;
 }
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:18,代码来源:Management.cs

示例15: xExtractPayload

 /// <summary>
 /// Extracts via out locale
 /// </summary>
 /// <param name="xOutLocale"></param>
 /// <param name="xIncludeSubItems"></param>
 /// <param name="xIncludeHeader"></param>
 /// <returns></returns>
 bool xExtractPayload(string xOutLocale, bool xIncludeSubItems, bool xIncludeHeader)
 {
     try
     {
         AddToLog("Checking Directory");
         xOutLocale.Replace("\\", "/");
         if (xOutLocale[xOutLocale.Length - 1] == '/')
             xOutLocale = xOutLocale.Substring(0, xOutLocale.Length - 1);
         if (!VariousFunctions.xCheckDirectory(xOutLocale))
         {
             AddToLog("Directory error");
             return false;
         }
         if (xIncludeHeader)
         {
             // Records the meta data
             AddToLog("Noting Header Information");
             DJsIO xhead = new DJsIO(VariousFunctions.xGetUnusedFile(xOutLocale + "/" + dlcname() + ".txt")
                 , DJFileMode.Create, true);
             xHeader.WriteText(ref xhead);
             xhead.Dispose();
             xhead = new DJsIO(VariousFunctions.xGetUnusedFile(xOutLocale + "/Content Image.png")
                 , DJFileMode.Create, true);
             xhead.Position = 0;
             xhead.Write(xHeader.ContentImageBinary);
             xhead.Dispose();
             xhead = new DJsIO(VariousFunctions.xGetUnusedFile(xOutLocale + "/Package Image.png")
                 , DJFileMode.Create, true);
             xhead.Position = 0;
             xhead.Write(xHeader.PackageImageBinary);
             xhead.Dispose();
         }
         xOutLocale += "/Root";
         if (!VariousFunctions.xCheckDirectory(xOutLocale))
             return (xActive = false);
         // Runs a regular folder extract
         AddToLog("Extracting payload");
         RootDirectory.folderextract(xIncludeSubItems, xOutLocale);
         AddToLog("Package Extracted");
         return !(xActive = false);
     }
     catch { return (xActive = false); }
 }
开发者ID:DarrenRainey,项目名称:snes360savegameconverter,代码行数:50,代码来源:STFSPackage.cs


注:本文中的X360.IO.DJsIO.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。