PageRenderTime 16ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSVstoGetWrapperObject/GetWrapperRibbon.cs

#
C# | 61 lines | 36 code | 7 blank | 18 comment | 2 complexity | 31fb642e92c1cce001ca392b03f8dccb MD5 | raw file
 1/************************************* Module Header **************************************\
 2* Module Name:	GetWrapperRibbon.cs
 3* Project:		CSVstoGetWrapperObject
 4* Copyright (c) Microsoft Corporation.
 5* 
 6* The CSVstoGetWrapperObject project demonstrates how to get a VSTO wrapper
 7* object from an existing Office COM object.
 8*
 9* This feature requires Visual Studio Tools for Office 3.0 SP1 (included in 
10* Visual Studio 2008 SP1) for both design-time and runtime support.
11* 
12* This source is subject to the Microsoft Public License.
13* See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
14* All other rights reserved.
15* 
16* History:
17* * 6/13/2009 3:00 PM Wang Jie Created
18\******************************************************************************************/
19
20
21#region Using directives
22using System;
23using System.Collections.Generic;
24using System.Linq;
25using System.Text;
26using Microsoft.Office.Tools.Ribbon;
27using System.Windows.Forms;
28using System.Diagnostics;
29#endregion
30
31namespace CSVstoGetWrapperObject
32{
33    public partial class GetWrapperRibbon : OfficeRibbon
34    {
35        private GetWrapperForm getWrapperForm = null;
36
37        public GetWrapperRibbon()
38        {
39            InitializeComponent();
40        }
41
42        private void GetWrapperRibbon_Load(object sender, RibbonUIEventArgs e)
43        {
44
45        }
46
47        private void btnShowGetWrapperCS_Click(object sender, RibbonControlEventArgs e)
48        {
49            if (getWrapperForm == null ||
50                getWrapperForm.IsDisposed)
51            {
52                getWrapperForm = new GetWrapperForm();
53                getWrapperForm.Show(NativeWindow.FromHandle(Process.GetCurrentProcess().MainWindowHandle));
54            }
55            else
56            {
57                getWrapperForm.Activate();
58            }
59        }
60    }
61}