Example #1
0
        void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IReverseTemplate tag = null;

            if (sender != null && sender is ToolStripItem ti)
            {
                tag = (IReverseTemplate)ti.Tag;
            }

            if (tag == null)
            {
                return;
            }

            if (Reverser != null)
            {
                Reverser = null;
            }
            CleanDebugger();

            if (Result != null)
            {
                Result.Instructions.Clear();
                Result = null;
            }

            Template = tag;

            Reverser = Template.CreateReverser();
            Reverser.OnParseProgress += OnReverseProgress;

            if (Config == null || Template.ConfigType == null || Config.GetType() != Template.ConfigType)
            {
                if (Config != null && Config is IDisposable d)
                {
                    d.Dispose();
                }

                //preferencesToolStripMenuItem_Click(sender, e);
                Config = null;
            }

            EnableDisableConfig();
            EnableDisableDebugger();
        }