Esempio n. 1
0
 /// <summary>
 /// Gets the type namespace
 /// </summary>
 /// <param name="extractedType"></param>
 /// <returns></returns>
 public string GetPrefix(ExtractedTypeDescriptor extractedType)
 {
     if (_imports.ContainsImportPath(extractedType.TargetPath))
     {
         return(_imports.GetImportAtPath(extractedType.TargetPath).ImportAlias);
     }
     return("");
 }
        /// <summary>
        /// Gets the type namespace
        /// </summary>
        /// <param name="extractedType"></param>
        /// <returns></returns>
        protected override string GetTypeNamespace(ExtractedTypeDescriptor extractedType)
        {
            if (extractedType is ExtractedEnumTypeDescriptor enumType)
            {
                return(_enumPrefix);
            }

            return(_typePrefix);
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the namespace with the trailing dot for the given type
        /// </summary>
        /// <param name="typeDescriptor"></param>
        /// <returns></returns>
        private string GetNamespaceWithDot(ExtractedTypeDescriptor typeDescriptor)
        {
            string typeNs = GetTypeNamespace(typeDescriptor);

            if (!string.IsNullOrEmpty(typeNs))
            {
                typeNs += ".";
            }
            return(typeNs);
        }
Esempio n. 4
0
 /// <summary>
 /// Gets the namespace (or prefix) of the given type
 /// </summary>
 /// <param name="typeDescriptor">The type descriptor</param>
 /// <returns>The namespace or prefix, or null if not applicable</returns>
 protected virtual string GetTypeNamespace(ExtractedTypeDescriptor typeDescriptor)
 {
     return(_resolver.GetPrefix(typeDescriptor));
 }
Esempio n. 5
0
 public string GetPrefix(ExtractedTypeDescriptor typeDescriptor)
 {
     return(Prefix);
 }
 /// <summary>
 /// Gets the namespace (or prefix) of the given type
 /// </summary>
 /// <param name="typeDescriptor">The type descriptor</param>
 /// <returns>The namespace or prefix, or null if not applicable</returns>
 protected virtual string GetTypeNamespace(ExtractedTypeDescriptor typeDescriptor)
 {
     return(typeDescriptor.Namespace);
 }