/// <summary>
        /// Determines whether the reference is enabled for a particular target item,
        /// based on the condition contained in the reference.
        /// </summary>
        /// <param name="target">The <see cref="T:System.Object"/> to check for references.</param>
        /// <returns>
        ///     <see langword="true"/> if the reference is enabled for the given <paramref name="target"/>.
        /// Otherwise, <see langword="false"/>.
        /// </returns>
        public override bool IsEnabledFor(object target)
        {
            if (!ReferenceUtil.IsCSharpProject(target) &&
                !DteHelperEx.IsWebCSharpProject(target))
            {
                return(false);
            }

            return(OnIsEnabledFor(target));
        }
Esempio n. 2
0
 private string GetTypeOfDependingOnProjectTypeCSharpOrVisualBasic()
 {
     if (ReferenceUtil.IsCSharpProject(CustomProvider))
     {
         return(Resources.TypeOf);
     }
     else if (EntlibReferences.ReferenceUtil.IsVisualBasicProject(CustomProvider))
     {
         return(Resources.TypeOfVB);
     }
     return(null);
 }
Esempio n. 3
0
 private string GetMethodEndString()
 {
     if (ReferenceUtil.IsCSharpProject(ProjectItem))
     {
         return(CSharpMethodEndString);
     }
     else if (BlockFactory.References.ReferenceUtil.IsVisualBasicProject(ProjectItem))
     {
         return(VisualBasicSubEndString);
     }
     else
     {
         return(string.Empty);
     }
 }
Esempio n. 4
0
 protected void AddDefaultConstructor(CodeClass codeClass)
 {
     if (null == GetDefaultConstructor(codeClass))
     {
         CodeFunction constructor = null;
         if (ReferenceUtil.IsCSharpProject(CustomProvider))
         {
             constructor = codeClass.AddFunction(string.Empty, vsCMFunction.vsCMFunctionConstructor, vsCMTypeRef.vsCMTypeRefVoid, -1, vsCMAccess.vsCMAccessPublic, null);
         }
         else if (EntlibReferences.ReferenceUtil.IsVisualBasicProject(CustomProvider))
         {
             constructor = codeClass.AddFunction(VisualBasicConstructorKeyWord, vsCMFunction.vsCMFunctionSub, vsCMTypeRef.vsCMTypeRefVoid, 0, vsCMAccess.vsCMAccessPublic, null);
         }
         constructor.AddParameter(ConfigurationParameterName, NamespaceHelper.GenerateFullTypeName(Namespace, ConfigurationNamespacePart, ConfigurationClassname), -1);
     }
 }
Esempio n. 5
0
        public override bool OnBeginRecipe(object currentValue, out object newValue)
        {
            IDictionaryService dictionaryService = (IDictionaryService)GetService <IDictionaryService>();
            Project            project           = (Project)dictionaryService.GetValue(projectName);

            if (ReferenceUtil.IsCSharpProject(project))
            {
                newValue = csharpBaseDirectory;
                return(true);
            }
            else if (EntlibReferences.ReferenceUtil.IsVisualBasicProject(project))
            {
                newValue = vbBaseDirectory;
                return(true);
            }

            newValue = null;
            return(false);
        }