Exemplo n.º 1
0
        public ClangCommand(CommandsController aCommandsController, Package aPackage, Guid aGuid, int aId) : base(aPackage, aGuid, aId)
        {
            mCommand  = DTEObj.Commands as Commands2;
            VsEdition = DTEObj.Edition;
            mVsVersions.TryGetValue(DTEObj.Version, out string version);
            VsVersion = version;

            if (null == mCommandsController)
            {
                mCommandsController = aCommandsController;
            }

            mGeneralOptions = (ClangGeneralOptionsView)Package.GetDialogPage(typeof(ClangGeneralOptionsView));
        }
Exemplo n.º 2
0
        public ClangCommand(CommandsController aCommandsController, ErrorWindowController aErrorWindow,
                            OutputWindowController aOutputWindow, AsyncPackage aPackage, Guid aGuid, int aId)
            : base(aPackage, aGuid, aId)
        {
            if (null == mCommandsController)
            {
                mCommandsController = aCommandsController;
            }

            mErrorWindow    = aErrorWindow;
            mOutputWindow   = aOutputWindow;
            mGeneralOptions = (ClangGeneralOptionsView)aPackage.GetDialogPage(typeof(ClangGeneralOptionsView));

            if (VsServiceProvider.TryGetService(typeof(DTE), out object dte))
            {
                var dte2 = dte as DTE2;
                mCommand  = dte2.Commands as Commands2;
                VsEdition = dte2.Edition;
                mVsVersions.TryGetValue(dte2.Version, out string version);
                VsVersion = version;
            }
        }