Exemplo n.º 1
0
        /*internal, but public for FSharp.Project.dll*/ public static RegisteredProjectType CreateRegisteredProjectType(Guid projectTypeGuid)
        {
            RegisteredProjectType registederedProjectType = null;

            using (RegistryKey rootKey = VSRegistry.RegistryRoot(__VsLocalRegistryType.RegType_Configuration))
            {
                if (rootKey == null)
                {
                    return(null);
                }

                string projectPath = "Projects\\" + projectTypeGuid.ToString("B");
                using (RegistryKey projectKey = rootKey.OpenSubKey(projectPath))
                {
                    if (projectKey == null)
                    {
                        return(null);
                    }

                    registederedProjectType = new RegisteredProjectType();
                    registederedProjectType.DefaultProjectExtensionValue = projectKey.GetValue(DefaultProjectExtension) as string;
                    registederedProjectType.ProjectTemplatesDirValue     = projectKey.GetValue(ProjectTemplatesDir) as string;
                    registederedProjectType.WizardTemplatesDirValue      = projectKey.GetValue(WizardsTemplatesDir) as string;
                    registederedProjectType.PackageGuidValue             = new Guid(projectKey.GetValue(Package) as string);
                }
            }

            return(registederedProjectType);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves the fxcop dierctory location
        /// </summary>
        private static string GetFxCopDirectoryLocation()
        {
            using (RegistryKey root = VSRegistry.RegistryRoot(__VsLocalRegistryType.RegType_Configuration))
            {
                if (null == root)
                {
                    return(String.Empty);
                }

                using (RegistryKey key = root.OpenSubKey(FxCopRegistryRelativePathEntry))
                {
                    if (key != null)
                    {
                        string fxcopInstallDir = key.GetValue(FxCopRegistryInstallDirKeyName) as string;

                        return((fxcopInstallDir == null) ? String.Empty : fxcopInstallDir);
                    }
                }
            }

            return(String.Empty);
        }