//ライセンス情報はAgeOnフォルダのLISENCEフォルダを参照してください
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Drawing;
using System.Diagnostics;

using MecInfoDll;

namespace nispi.Analysis
{
    class AnalysisMagic
    {
        public AnalysisMagicControls analysisMagicControls;

        public static bool Visible = false;

        public bool oneLineCut = false;
        public bool twoLineCut = false;
        public bool threeLineCut = false;
        public bool fourLineCut = false;

        public bool kusaCut = false;
        public bool noAnchorCut = false;

        public ThreadViewCommon threadView;

        public AnalysisMagic(ThreadViewCommon threadView)
        {
            this.threadView = threadView;
            analysisMagicControls = new AnalysisMagicControls(this);

            Visible = false;
        }
        public void Show()
        {
            analysisMagicControls.amFormParts.Show();

            analysisMagicControls.amFormParts.Location =
                new Point(System.Windows.Forms.Cursor.Position.X - (analysisMagicControls.amFormParts.Size.Width),
                    System.Windows.Forms.Cursor.Position.Y + 5);

        }

        public void Hide()
        {
            analysisMagicControls.amFormParts.Hide();
        }

        public void Close()
        {
            //この作業をしないとメインウィンドウが閉じない。
            this.analysisMagicControls.amFormParts.Owner = null;

            try
            {
                this.analysisMagicControls.RemoveControls();
            }
            catch { ;}

            //analysisMagicControls.amFormParts.Hide();

            this.analysisMagicControls = null;
        }
    }
}
