/// <summary> /// Bookmark an entity /// </summary> /// <param name="entity"></param> /// <param name="name"></param> /// <param name="comment"></param> /// <param name="folderId"></param> /// <param name="corp"></param> /// <returns></returns> public bool BookmarkEntity(DirectEntity entity, string name, string comment, long?folderId, bool corp = false) { if (!entity.IsValid) { return(false); } if (!corp && Session.CharacterId == null) { return(false); } if (corp && Session.CorporationId == null) { return(false); } if (!corp) { return(DirectBookmark.BookmarkLocation(this, Session.CharacterId.Value, entity.Id, name, comment, entity.TypeId, Session.SolarSystemId, folderId)); } else { return(DirectBookmark.BookmarkLocation(this, Session.CorporationId.Value, entity.Id, name, comment, entity.TypeId, Session.SolarSystemId, folderId)); } }
/// <summary> /// Bookmark the current location /// </summary> /// <param name="ownerId"></param> /// <param name="name"></param> /// <param name="comment"></param> /// <param name="folderId"></param> /// <returns></returns> internal bool BookmarkCurrentLocation(long ownerId, string name, string comment, long?folderId) { if (Session.StationId.HasValue) { var station = GetLocalSvc("station").Attribute("station"); if (!station.IsValid) { return(false); } return(DirectBookmark.BookmarkLocation(this, ownerId, (long)station.Attribute("stationID"), name, comment, (int)station.Attribute("stationTypeID"), (long?)station.Attribute("solarSystemID"), folderId)); } if (ActiveShip.Entity.IsValid && Session.SolarSystemId.HasValue) { return(DirectBookmark.BookmarkLocation(this, ownerId, ActiveShip.Entity.Id, name, comment, ActiveShip.Entity.TypeId, Session.SolarSystemId, folderId)); } return(false); }