示例#1
0
        // リストアイテムが選択された.
        private void listBoxMainListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (TDCGExplorer.BusyTest()==true) return;

            try
            {
                int index = listBoxMainListBox.SelectedIndex;
                if (index >= 0)
                {
                    if (index == lastSelectedListBoxIndex) return;

                    lastSelectedListBoxIndex = index;

                    LbGenItem item = listBoxMainListBox.Items[index] as LbGenItem;
                    if (item != null)
                    {
                        item.DoClick();
                        listBoxMainListBox.Focus();
                    }
                }
            }
            catch (Exception exception)
            {
                TDCGExplorer.SetToolTips(TextResource.Error + ":" + exception.Message);
                Debug.WriteLine(exception.Message);
            }
        }
示例#2
0
        private void toolStripMenuItemTouchAll_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.BusyTest() == true) return;

            try
            {
                SimpleTextDialog dialog = new SimpleTextDialog();
                dialog.Owner = TDCGExplorer.MainFormWindow;
                dialog.dialogtext = TextResource.TouchDialogText;
                dialog.labeltext = TextResource.DateTime;
                dialog.textfield = DateTime.Now.ToString();

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    DateTime newtime = DateTime.Parse(dialog.textfield);
                    foreach (Object itemobject in ListBoxMainView.Items)
                    {
                        LbSaveFileItem item = itemobject as LbSaveFileItem;
                        if (item != null)
                        {
                            item.SetDate(newtime);
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

        }
示例#3
0
        // ファイルをドラッグドロップされた→TAHページを作成してTAH梱包の準備をする.
        private void MainForm_DragDrop(object sender, DragEventArgs e)
        {
            if (TDCGExplorer.BusyTest()) return;

            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            if (files.Length == 0) return;

            TDCGExplorer.FileDrop(files);
        }
示例#4
0
        private void toolStripMenuItemTouch_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.BusyTest() == true) return;

            try
            {
                int index = listBoxMainListBox.SelectedIndex;
                if (index >= 0)
                {
                    LbSaveFileItem item = listBoxMainListBox.Items[index] as LbSaveFileItem;
                    if (item != null)
                    {
                        item.Touch();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
示例#5
0
        private void TahDecryptToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.BusyTest()) return;

            try
            {
                int index = listBoxMainListBox.SelectedIndex;
                if (index >= 0)
                {
                    LbGenItem item = listBoxMainListBox.Items[index] as LbGenItem;
                    if (item != null)
                    {
                        item.DoTahEdit();
                        listBoxMainListBox.Focus();
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(TextResource.ExtractFailure + ":" + exception.Message, TextResource.ExtractFailureCaption, MessageBoxButtons.OK);
            }
        }
示例#6
0
        private void LookupMODRefToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.BusyTest()) return;

            try
            {
                GenericZipTreeNode node = lastSelectTreeNode as GenericZipTreeNode;
                if (node != null)
                {
                    AssignTagPageControl(new MODRefPage(node.Entry));
                }
                else
                {
                    MessageBox.Show(TextResource.ZipFileOnly, TextResource.Error, MessageBoxButtons.OK);
                }
            }
            catch (Exception exception)
            {
                TDCGExplorer.SetToolTips(TextResource.Error + ":" + exception.Message);
                Debug.WriteLine(exception.Message);
            }
        }
示例#7
0
        // TAHファイルを直接展開する.
        private void ExtractTahFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.BusyTest()) return;

            try
            {
                int index = listBoxMainListBox.SelectedIndex;
                if (index >= 0)
                {
                    LbGenItem item = listBoxMainListBox.Items[index] as LbGenItem;
                    if (item != null)
                    {
                        item.DoDecrypt();
                        listBoxMainListBox.Focus();
                    }
                }
            }
            catch (Exception exception)
            {
                TDCGExplorer.SetToolTips(TextResource.Error + ":" + exception.Message);
                Debug.WriteLine(exception.Message);
            }
        }
示例#8
0
        public override void DoTvTreeSelect()
        {
            TDCGExplorer.MainFormWindow.SetTahContextMenu(true); // TAH関連のメニューがあるcontext menu
            TDCGExplorer.MainFormWindow.ListBoxClear();
            //セレクトされたときにSQLに問い合わせる.
            List <ArcsZipTahEntry> files = TDCGExplorer.ArcsDB.GetZipTahs(zipid);

            foreach (ArcsZipTahEntry file in files)
            {
                TDCGExplorer.MainFormWindow.ListBoxMainView.Items.Add(new LbZipFileItem(file));
            }
            if (TDCGExplorer.BusyTest() == true)
            {
                return;
            }

            // ZIPページを開いた時の動作を指定する (none:なにもしない server:サーバにアクセス image:画像表示 text:テキスト表示)
            // public string zippage_behavior
            switch (TDCGExplorer.SystemDB.zippage_behavior)
            {
            case "server":
            {
                TDCGExplorer.MainFormWindow.AssignTagPageControl(new MODRefPage(zipid));
            }
                return;

            case "image":
                foreach (ArcsZipTahEntry entry in files)
                {
                    string ext = Path.GetExtension(entry.path).ToLower();
                    if (ext == ".bmp" || ext == ".png" || ext == ".jpg" || ext == ".gif" || ext == ".tif")
                    {
                        string savefilpath = entry.path.ToLower();
                        if (savefilpath.EndsWith(".tdcgsav.png") || savefilpath.EndsWith(".tdcgsav.bmp") || savefilpath.EndsWith(".tdcgpose.png"))
                        {
                            continue;
                        }

                        TDCGExplorer.MainFormWindow.AssignTagPageControl(new ImagePageControl(new GenericZipsTahInfo(entry)));
                        return;
                    }
                }
                foreach (ArcsZipTahEntry entry in files)
                {
                    string ext = Path.GetExtension(entry.path).ToLower();
                    if (ext == ".txt" || ext == ".doc" || ext == ".xml")
                    {
                        TDCGExplorer.MainFormWindow.AssignTagPageControl(new TextPageControl(new GenericZipsTahInfo(entry)));
                        return;
                    }
                }
                break;

            case "text":
                foreach (ArcsZipTahEntry entry in files)
                {
                    string ext = Path.GetExtension(entry.path).ToLower();
                    if (ext == ".txt" || ext == ".doc" || ext == ".xml")
                    {
                        TDCGExplorer.MainFormWindow.AssignTagPageControl(new TextPageControl(new GenericZipsTahInfo(entry)));
                        return;
                    }
                }
                foreach (ArcsZipTahEntry entry in files)
                {
                    string ext = Path.GetExtension(entry.path).ToLower();
                    if (ext == ".bmp" || ext == ".png" || ext == ".jpg" || ext == ".gif" || ext == ".tif")
                    {
                        string savefilpath = entry.path.ToLower();
                        if (savefilpath.EndsWith(".tdcgsav.png") || savefilpath.EndsWith(".tdcgsav.bmp") || savefilpath.EndsWith(".tdcgpose.png"))
                        {
                            continue;
                        }

                        TDCGExplorer.MainFormWindow.AssignTagPageControl(new ImagePageControl(new GenericZipsTahInfo(entry)));
                        return;
                    }
                }
                break;

            default:
                break;
            }
        }
示例#9
0
 // スレッド実行時はエラーにする.
 private bool threadCheck()
 {
     if (TDCGExplorer.BusyTest()) return true;
     return false;
 }
示例#10
0
 // タブを閉じる.
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (TDCGExplorer.BusyTest()) return;
     if (tabMainView.SelectedTab != null) tabMainView.SelectedTab.Dispose();
 }
示例#11
0
 // 00番が見つからないMODを探索する.
 private void findNoBaseModToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (TDCGExplorer.BusyTest() == true) return;
     AssignTagPageControl(new FindBaseModPage());
 }