Ejemplo n.º 1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="NamespaceInfo" /> class.
 /// </summary>
 /// <param name="active">The namespace is active</param>
 /// <param name="index">The namespace index</param>
 /// <param name="metaId">The namespace metaId</param>
 /// <param name="type">The namespace type, namespace and sub namespace.</param>
 /// <param name="depth">The namespace depth</param>
 /// <param name="levels">The namespace level</param>
 /// <param name="parentId">The namespace parent</param>
 /// <param name="owner">The owner of the namespace</param>
 /// <param name="startHeight">The height at which the ownership begins.</param>
 /// <param name="endHeight">The height at which the ownership ends.</param>
 /// <param name="alias"> The alias linked to a namespace.</param>
 public NamespaceInfo(bool?active, int?index, string metaId, NamespaceType type, int?depth,
                      List <NamespaceId> levels, NamespaceId parentId, PublicAccount owner, ulong startHeight, ulong endHeight,
                      Alias alias)
 {
     Active      = active;
     Index       = index;
     MetaId      = metaId;
     Type        = type;
     Depth       = depth;
     Levels      = levels;
     ParentId    = parentId;
     Owner       = owner;
     StartHeight = startHeight;
     EndHeight   = endHeight;
     Alias       = alias;
 }
        /// <summary>
        ///     Helper method to generate sub namespace from parent
        /// </summary>
        /// <param name="subNamespace"></param>
        /// <param name="parentId"></param>
        /// <returns></returns>
        public static NamespaceId CreateFromParent(string subNamespace, NamespaceId parentId)
        {
            var id = IdGenerator.GenerateSubNamespaceIdFromParentId(parentId.Id, subNamespace);

            return(new NamespaceId(id));
        }