Exemple #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (buttonCancel.Enabled)
            {
                // if we are a dialog, use alternative window caption
                Text = (string)Tag;
            }
            else
            {
                // put the version to window title
                Text = Text.Replace("n.n.nnnn.nnnnn", ApplicationVersionString);
            }

            // Start building the native storage
            ThreadPool.QueueUserWorkItem(new WaitCallback(this.LoadNativeStorage), this);

            // Load up the correct tab page
            tabControl1.SelectedTab = pinvokeSearchTabPage;

            // Disable wrapper method generation
            PInvoke.Transform.TransformKindFlags transformFlags = PInvoke.Transform.TransformKindFlags.All;
            transformFlags &= ~PInvoke.Transform.TransformKindFlags.WrapperMethods;
            symbolDisplay.TransformKindFlags    = transformFlags;
            snippetDisplay.TransformKindFlags   = transformFlags;
            snippetDisplay.LanguageTypeChanged += new EventHandler(OnLanguageTypeChanged);
            symbolDisplay.LanguageTypeChanged  += new EventHandler(OnLanguageTypeChanged);
        }
Exemple #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (buttonCancel.Enabled)
            {
                // if we are a dialog, use alternative window caption
                Text = (string)Tag;
            }
            else
            {
                // put the version to window title
                Text = Text.Replace("n.n.nnnn.nnnnn", ApplicationVersionString);
            }

            // Start building the native storage
            ThreadPool.QueueUserWorkItem(new WaitCallback(this.LoadNativeStorage), this);

            // Load up the correct tab page
            switch ((TabMode)(userSettings.Mode))
            {
            case TabMode.ReversePInvoke:
                tabControl1.SelectedTab = reversePInvokeTabPage;
                break;

            case TabMode.PInvokeSearch:
                tabControl1.SelectedTab = pinvokeSearchTabPage;
                break;

            case TabMode.PInvokeSnippet:
                tabControl1.SelectedTab = pinvokeSnippetTabPage;
                break;

            default:
                tabControl1.SelectedTab = reversePInvokeTabPage;
                break;
            }

            // Show all setting
            showAllToolStripMenuItem.Checked = userSettings.PInvokeShowAll;
            symbolDisplay.ShowAll            = userSettings.PInvokeShowAll;

            // Disable wrapper method generation
            PInvoke.Transform.TransformKindFlags transformFlags = PInvoke.Transform.TransformKindFlags.All;
            transformFlags &= ~PInvoke.Transform.TransformKindFlags.WrapperMethods;
            symbolDisplay.TransformKindFlags  = transformFlags;
            snippetDisplay.TransformKindFlags = transformFlags;

            // Load settings
            symbolDisplay.AutoGenerate          = userSettings.PInvokeSearchAutoGenerate;
            snippetDisplay.AutoGenerate         = userSettings.PInvokeSnippetAutoGenerate;
            symbolDisplay.SearchKind            = ParseOrDefault(userSettings.PInvokeSearchKind, SearchKind.All);
            symbolDisplay.LanguageType          = ParseOrDefault(userSettings.PInvokeLanguageType, PInvoke.Transform.LanguageType.CSharp);
            snippetDisplay.LanguageType         = ParseOrDefault(userSettings.PInvokeLanguageType, PInvoke.Transform.LanguageType.CSharp);
            snippetDisplay.LanguageTypeChanged += new EventHandler(OnLanguageTypeChanged);
            symbolDisplay.LanguageTypeChanged  += new EventHandler(OnLanguageTypeChanged);
        }