/// <summary> /// Try to avoid using this unless necessary. If the part is hosted in something other than a map object, then the parent /// could come back null /// </summary> /// <remarks> /// The case that needed this was SwarmBay. The swarm bots need to know the location/size/speed of the parent bot /// </remarks> public IMapObject GetParent() { if (this.RequestParent == null) { throw new ApplicationException("There is no event handler for RequestParent"); } PartRequestParentArgs args = new PartRequestParentArgs(); this.RequestParent(this, args); return args.Parent; }
private void Part_RequestParent(object sender, PartRequestParentArgs e) { e.Parent = this; }