Пример #1
0
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            _applicationObject = (DTE2)application;
            _addInInstance = (AddIn)addInInst;

            if (connectMode != ext_ConnectMode.ext_cm_UISetup) return;

            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertGuidCommand, "Insert WiX Guid", 101, true, 1);
            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertFileIdCommand, "Insert WiX Id", 101, false, 2);
            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertShortFilenameCommand, "Insert WiX Short Filename", 101, false, 3);
            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertDirectoryElementCommand, "Insert WiX Directory", 101, false, 4);
            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertComponentElementCommand, "Insert WiX Component", 101, false, 5);
            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertFileElementCommand, "Insert WiX File", 101, false, 6);
            _applicationObject.AddContextMenuItem(_addInInstance, new[] { LocationCodeWindow }, InsertFileAndShortcutElementCommand, "Insert WiX File And Shortcut", 101, false, 7);
        }