Beispiel #1
0
        private void OnVCProjectEngineItemPropertyChange(object item, object tool, int dispid)
        {
            //System.Diagnostics.Debug.WriteLine("OnVCProjectEngineItemPropertyChange " + dispid.ToString());
            VCFileConfiguration vcFileCfg = item as VCFileConfiguration;

            if (vcFileCfg == null)
            {
                // A global or project specific property has changed.

                VCConfiguration vcCfg = item as VCConfiguration;
                if (vcCfg == null)
                {
                    return;
                }
                VCProject vcPrj = vcCfg.project as VCProject;
                if (vcPrj == null)
                {
                    return;
                }
                if (!HelperFunctions.IsQtProject(vcPrj))
                {
                    return;
                }

                if (dispid == dispId_VCCLCompilerTool_UsePrecompiledHeader ||
                    dispid == dispId_VCCLCompilerTool_PrecompiledHeaderThrough ||
                    dispid == dispId_VCCLCompilerTool_AdditionalIncludeDirectories ||
                    dispid == dispId_VCCLCompilerTool_PreprocessorDefinitions)
                {
                    QtProject qtPrj = QtProject.Create(vcPrj);
                    qtPrj.RefreshMocSteps();
                }
            }
            else
            {
                // A file specific property has changed.

                VCFile vcFile = vcFileCfg.File as VCFile;
                if (vcFile == null)
                {
                    return;
                }
                VCProject vcPrj = vcFile.project as VCProject;
                if (vcPrj == null)
                {
                    return;
                }
                if (!HelperFunctions.IsQtProject(vcPrj))
                {
                    return;
                }

                if (dispid == dispId_VCFileConfiguration_ExcludedFromBuild)
                {
                    QtProject qtPrj = QtProject.Create(vcPrj);
                    qtPrj.OnExcludedFromBuildChanged(vcFile, vcFileCfg);
                }
                else if (dispid == dispId_VCCLCompilerTool_UsePrecompiledHeader ||
                         dispid == dispId_VCCLCompilerTool_PrecompiledHeaderThrough ||
                         dispid == dispId_VCCLCompilerTool_AdditionalIncludeDirectories ||
                         dispid == dispId_VCCLCompilerTool_PreprocessorDefinitions)
                {
                    QtProject qtPrj = QtProject.Create(vcPrj);
                    qtPrj.RefreshMocStep(vcFile);
                }
            }
        }