Example #1
0
        /// <summary>
        ///  用于显示窗体的方法
        /// </summary>
        /// <param name="control"> 表示传递给每个功能区用户界面 (UI) 控件的
        /// 回调过程的对象. </param>
        public void ShowForm(IRibbonControl control)
        {
            OneNote.Window      context = control.Context as OneNote.Window;
            CWin32WindowWrapper owner   =
                new CWin32WindowWrapper((IntPtr)context.WindowHandle);
            TestForm form = new TestForm(applicationObject as OneNote.Application);

            form.ShowDialog(owner);

            form.Dispose();
            form    = null;
            context = null;
            owner   = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();
        }
Example #2
0
        /// <summary>
        ///  ������ʾ����ķ���
        /// </summary>
        /// <param name="control"> ��ʾ���ݸ�ÿ���������û����� (UI) �ؼ���	
        /// �ص����̵Ķ���. </param>
        public void ShowForm(IRibbonControl control)
        {
            OneNote.Window context = control.Context as OneNote.Window;
            CWin32WindowWrapper owner =
                new CWin32WindowWrapper((IntPtr)context.WindowHandle);
            TestForm form = new TestForm(applicationObject as OneNote.Application);
            form.ShowDialog(owner);

            form.Dispose();
            form = null;
            context = null;
            owner = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();
        }