Exemplo n.º 1
0
        //private void SaveTOC()
        //{
        //    sio.FileStream fs;
        //    sio.StreamWriter sw;

        //    fs = new sio.FileStream(@"c:\temp.txt", sio.FileMode.Create, sio.FileAccess.Write);
        //    sw = new sio.StreamWriter(fs, ste.Default);

        //    for (int i = 0; i < toc.fils.Count; i++)
        //        if (!toc.fils[i].isDir)
        //            sw.WriteLine("{0:d10} ; {1:d10} ; '{2}'", toc.fils[i].pos, toc.fils[i].nextIdx, toc.fils[i].path);

        //    sw.Close();
        //    fs.Close();
        //}

        private void ResetControlsWipeing(bool error, string errorText)
        {
            if (this.statusStrip.InvokeRequired)
            {
                ResetControlsCB d = new ResetControlsCB(ResetControlsWipeing);
                this.Invoke(d, new object[] { error, errorText });
            }
            else
            {
                if (errorText != null)
                {
                    if (error)
                    {
                        MessageBox.Show(this, errorText, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    if (stopCurrProc)
                    {
                        MessageBox.Show(this, "Process cancelled", "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        MessageBox.Show("Done", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }

                miImage.Enabled          = true;
                miImageOpen.Enabled      = true;
                miImageClose.Enabled     = true;
                miImport.Visible         = true;
                miExport.Visible         = true;
                miCancel.Visible         = false;
                miImageWipeGarbage.Text  = "Wipe garbage";
                miImageWipeGarbage.Image = GCRebuilder.Properties.Resources.wipe;
                if (bannerLoaded)
                {
                    cbBDFile.Enabled  = true;
                    btnBDSave.Enabled = true;
                }
                sslblAction.Text = "Ready";
                if (bannerLoaded)
                {
                    cbBDFile.Enabled  = true;
                    btnBDSave.Enabled = true;
                }
                this.sspbProgress.Value = 0;
            }
        }
Exemplo n.º 2
0
        private void ResetControlsRebuild(bool error, string errorText)
        {
            if (this.statusStrip.InvokeRequired)
            {
                ResetControlsCB d = new ResetControlsCB(ResetControlsRebuild);
                this.Invoke(d, new object[] { error, errorText });
            }
            else
            {
                if (errorText != null)
                {
                    if (error)
                    {
                        MessageBox.Show(this, errorText, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    if (stopCurrProc)
                    {
                        MessageBox.Show(this, "Process cancelled", "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else if (showLastDialog)
                    {
                        MessageBox.Show("Done", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }

                //this.tvTOC.LabelEdit = true;
                if (!fileNameSort && canEditTOC)
                {
                    gbStruct.Text = "Structure (editable)";
                }
                this.miRename.Enabled = true;
                miRootOpen.Enabled    = true;
                miRootSave.Enabled    = true;
                miRootClose.Enabled   = true;
                miRootStart.Text      = "Rebuild";
                miRootStart.Image     = GCRebuilder.Properties.Resources.root_run;
                sslblAction.Text      = "Ready";
                miOptions.Enabled     = true;
                if (bannerLoaded)
                {
                    cbBDFile.Enabled  = true;
                    btnBDSave.Enabled = true;
                }
                this.sspbProgress.Value = 0;
            }
        }