示例#1
0
        private void TmrSfv_Tick(object sender, EventArgs e)
        {
            if (!SfvGenerator.IsRunning)
            {
                HintPanel.Visible = false;
                BackLayer.Hide();

                if (OpChkTurnOff.Checked)
                {
                    CheckShutDown();
                }
                else
                {
                    ShowMessage("Successfully done.", MsgType.Normal);
                }

                TmrSfv.Enabled = false;
            }
            else
            {
                float val = (float)SfvGenerator.Finished / SfvGenerator.Files.Count;
                int   ret = (int)(val * 100);
                LHint.Text = "Generating Sfv File - " + ret.ToString() + "% Completed.";
            }
        }
示例#2
0
        private void TmrCrc_Tick(object sender, EventArgs e)
        {
            if (!SfvChecker.IsRunning)
            {
                HintPanel.Visible = false;
                BackLayer.Hide();

                if (!SfvChecker.HasError)
                {
                    BtnJoin_Click(sender, e);
                }
                else
                {
                    ShowMessage("Sfv check error.", MsgType.Error);
                    crcCheckStatus = false;
                }

                TmrCrc.Enabled = false;
            }
            else
            {
                float val = (float)SfvChecker.Finished / SfvChecker.FilesCount;
                int   ret = (int)(val * 100);
                LHint.Text = "Checking Sfv File - " + ret.ToString() + "% Completed.";
            }
        }
示例#3
0
 private void ShowPanel(PanelEx panel, Button btnFocus)
 {
     panel.Parent  = BackLayer;
     panel.Left    = (mSize.Width - panel.Width) / 2;
     panel.Top     = (mSize.Height - panel.Height) / 2 - 18;
     panel.Visible = true;
     BackLayer.Show();
     btnFocus.Focus();
     this.Refresh();
 }
示例#4
0
        private void BtnMsgOk_Click(object sender, EventArgs e)
        {
            if (PicElapsed.Visible)
            {
                PicElapsed.Visible = false;
                LbElapsed.Visible  = false;
            }

            BackLayer.Hide();
        }
示例#5
0
        private void BtnStop_Click(object sender, EventArgs e)
        {
            stoped           = true;
            BtnPause.Enabled = false;
            BtnStop.Enabled  = false;

            this.Refresh();
            if (currentProc == 0)
            {
                fSplit.Stop();
            }
            else
            {
                fJoin.Stop();
            }

            pauseState    = false;
            BtnPause.Text = "Pause";
            BackLayer.Hide();
        }
示例#6
0
    void Awake()
    {
        string tag = gameObject.tag;

        switch (tag)
        {
        case "near":
            layer = (BackLayer)1;
            break;

        case "middle":
            layer = (BackLayer)2;
            break;

        case "far":
            layer = (BackLayer)3;
            break;
        }

        gameObject.transform.position += Vector3.forward * (int)layer;
    }
示例#7
0
        public override void ShowMessage(string message, MsgType mType)
        {
            //Hide other items on the layer
            RunPanel.Visible = false;

            MsgPanel.Parent = BackLayer;

            MsgPanel.Left = (mSize.Width - MsgPanel.Width) / 2;
            MsgPanel.Top  = (mSize.Height - MsgPanel.Height) / 2;

            MsgPanelText.Text = message;
            BtnMsgOk.Select();
            this.AcceptButton = BtnMsgOk;

            switch (mType)
            {
            case MsgType.Normal:
                MsgPanel.ShadowColor = Color.Chartreuse;
                MsgPic.Image         = Resources.Success;
                break;

            case MsgType.Caution:
                MsgPanel.ShadowColor = Color.Orange;
                MsgPic.Image         = Resources.Warning;
                break;

            case MsgType.Error:
                MsgPanel.ShadowColor = Color.Red;
                MsgPic.Image         = Resources.ErrLarge;
                break;

            default:
                break;
            }

            MsgPanel.Visible = true;
            this.Refresh();
            BackLayer.Show();
            this.Refresh();
        }
示例#8
0
        private void CheckFilesDelete()
        {
            if (OpChkDeleteFiles.Checked)
            {
                MsgPanel.Visible = false;
                BackLayer.Hide();
                this.Refresh();
                LHint.Text = "Deleting Files...";
                ShowPanel(HintPanel, BtnCancel);
                this.Refresh();
                Thread.Sleep(500);

                for (int i = 0; i < fJoin.FileNames.Length; i++)
                {
                    File.Delete(fJoin.FileNames[i]);
                }

                Thread.Sleep(700);
                HintPanel.Visible = false;
                BackLayer.Hide();
            }
        }
示例#9
0
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     TmrShutDown.Enabled = false;
     shutDownCnt         = 45;
     BackLayer.Hide();
 }
示例#10
0
        private void Tmr_Tick(object sender, EventArgs e)
        {
            if (currentProc == 0)
            {
                LRunText.Text      = "Spliting File...";
                SubProgBar.Value   = fSplit.SubProgress;
                ProgBar.Value      = fSplit.Progress;
                LbCurrentFile.Text = "Part " + fSplit.CurrentPart.ToString();
                LbPart.Text        = fSplit.SubProgress + "%";
                LbOverAll.Text     = fSplit.Progress + "%";
                LbParts.Text       = (fSplit.CurrentPart == 0 ? 0 : fSplit.CurrentPart - 1).ToString() + " Part(s) Completed.";

                if (fSplit.ErrorMessage != null)
                {
                    BackLayer.Hide();
                    RunPanel.Visible = false;
                    this.Refresh();
                    ShowMessage(fSplit.ErrorMessage, MsgType.Error);

                    Tmr.Enabled = false;
                }

                if (fSplit.Finished)
                {
                    RunPanel.Visible = false;
                    this.Refresh();

                    if (!OpChkTurnOff.Checked &&
                        !OpChkSfv.Checked && !stoped)
                    {
                        ShowMessage("Successfully done.", MsgType.Normal);
                        DisplayTime();
                    }

                    if (!stoped)
                    {
                        CheckSfvGeneration();
                        CheckDeleteOriginal();
                    }

                    if (!OpChkSfv.Checked && !stoped)
                    {
                        CheckShutDown();
                    }

                    Tmr.Enabled = false;
                }
            }
            else if (currentProc == 1)
            {
                LRunText.Text      = "Joining Files...";
                SubProgBar.Value   = fJoin.SubProgress;
                ProgBar.Value      = fJoin.Progress;
                LbCurrentFile.Text = "Part " + fJoin.CurrentPart.ToString();
                LbPart.Text        = fJoin.SubProgress + "%";
                LbOverAll.Text     = fJoin.Progress + "%";
                LbParts.Text       = (fJoin.CurrentPart == 0 ? 0 : fJoin.CurrentPart - 1).ToString() + " Part(s) Completed.";

                if (fJoin.ErrorMessage != null)
                {
                    BackLayer.Hide();
                    RunPanel.Visible = false;
                    this.Refresh();
                    ShowMessage(fJoin.ErrorMessage, MsgType.Error);
                    Tmr.Enabled = false;
                }

                if (fJoin.Finished)
                {
                    RunPanel.Visible = false;
                    this.Refresh();

                    if (!OpChkDeleteFiles.Checked && !stoped &&
                        !OpChkTurnOff.Checked)
                    {
                        ShowMessage("Successfully done.", MsgType.Normal);
                        DisplayTime();
                    }

                    if (!stoped)
                    {
                        CheckFilesDelete();
                    }

                    if (!stoped)
                    {
                        CheckShutDown();
                    }

                    Tmr.Enabled = false;
                }
            }
        }