/// Add a set to this collection, if it is of a compatible type /// </summary> /// <param name="set"></param> /// <returns></returns> public bool TryAdd(IModelObjectSet set) { if (set is TSet) { Add((TSet)set); return(true); } else { return(false); } }
/// <summary> /// Construct a string of IDs from the items in the given set, mapped /// to their robot equivalents. /// </summary> /// <param name="set"></param> /// <returns></returns> public string ToIDString(IModelObjectSet set) { var sb = new StringBuilder(); foreach (var obj in set.GetItems()) { if (obj is Unique) { var unique = (Unique)obj; if (HasSecondID(unique.GUID)) { if (sb.Length > 0) { sb.Append(" "); } sb.Append(GetSecondID(unique.GUID)); } } } return(sb.ToString()); }
/// <summary> /// Add a new Set entry to this mapping table /// </summary> /// <param name="set"></param> /// <param name="rGroup"></param> public void Add(IModelObjectSet set, int groupID) { Add(SetsCategory, set.GUID, groupID.ToString()); }