/// <summary>Checks whether this POI type belongs under the specified parent POI type.</summary> public bool IsA(PoiType parentType) { if (parentType == null) return false; for (var type = this; type != null; type = type.Parent as PoiType) { if (parentType == type) return true; } return false; }
/// <summary>Creates a new <see cref="UserDefinedSite"/> instance of the specified type.</summary> public UserDefinedSite(PoiType poiType) { Type = poiType; }
/// <summary>Creates a concrete <see cref="Site"/> instance based on the specified POI type.</summary> /// <param name="localId">The new site's local id.</param> /// <param name="poiType">The POI type that represents the type of site to create.</param> /// <returns>The created site.</returns> public static Site FromPoiType(object localId, PoiType poiType) { if (poiType == null) return null; var bplClass = poiType.ToBplClass(); if (!bplClass.IsConcrete) return null; Site site = (bplClass.IsA<PoiSite>() ? new PoiSite(poiType) : (Site)bplClass.Create()); site.Id = bplClass.CreateId(localId); return site; }
/// <summary>Creates a new <see cref="PoiSite"/> instance of the specified POI type.</summary> public PoiSite(PoiType poiType) { Type = poiType; }