Ejemplo n.º 1
0
        /// <summary>
        /// Registers a type in a namespace with the specified type alias
        /// </summary>
        /// <param name="type">Type to register</param>
        /// <param name="typeAlias">Alias to use</param>
        public void RegisterType(Type type, string typeAlias)
        {
            if (!this.importedNamespaces.TryGetValue(type.Namespace, out ImportedNamespace ns))
            {
                ns = new ImportedNamespace(type.Namespace);
                this.importedNamespaces.Add(type.Namespace, ns);
            }

            ns.RegisterType(type);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Tries to retrieve a namespace lookup if it exists
 /// </summary>
 /// <param name="namespace">Namespace to retrieve</param>
 /// <param name="result">Retrieved namespace. This will be null if the lookup fails</param>
 /// <returns>True if lookup was successful, otherwise false</returns>
 public bool TryGetNamespace(string @namespace, out ImportedNamespace result)
 {
     return(this.importedNamespaces.TryGetValue(@namespace, out result));
 }