// Fill list from selection private void FillList(GraphicsList graphicsList, ref List <DrawObject> listToFill) { listToFill = new List <DrawObject>(); foreach (DrawObject o in graphicsList.Selection) { listToFill.Add(o.Clone()); } }
// Fill list from selection private void FillList(GraphicsList graphicsList, ref List<DrawObject> listToFill) { listToFill = new List<DrawObject>(); foreach (DrawObject o in graphicsList.Selection) { listToFill.Add(o.Clone()); } }
public void LoadFromStream(System.Runtime.Serialization.SerializationInfo info, int orderNumber) { _graphicsList = new GraphicsList(); _name = info.GetString( String.Format(CultureInfo.InvariantCulture, "{0}{1}", entryLayerName, orderNumber)); _visible = info.GetBoolean( String.Format(CultureInfo.InvariantCulture, "{0}{1}", entryLayerVisible, orderNumber)); _active = info.GetBoolean( String.Format(CultureInfo.InvariantCulture, "{0}{1}", entryLayerActive, orderNumber)); int n = info.GetInt32( String.Format(CultureInfo.InvariantCulture, "{0}{1}", entryGraphicsCount, orderNumber)); string typeName; object drawObject; for (int i = 0; i < n; i++) { typeName = info.GetString( String.Format(CultureInfo.InvariantCulture, "{0}{1}-{2}", entryObjectType, orderNumber, i)); drawObject = Assembly.GetExecutingAssembly().CreateInstance(typeName); ((DrawObject)drawObject).LoadFromStream(info, orderNumber, i); _graphicsList.Add((DrawObject)drawObject); } }
// Replace objects in graphicsList with objects from list private void ReplaceObjects(GraphicsList graphicsList, List <DrawObject> list) { for (int i = 0; i < graphicsList.Count; i++) { DrawObject replacement = null; foreach (DrawObject o in list) { if (o.ID == graphicsList[i].ID) { replacement = o; break; } } if (replacement != null) { graphicsList.Replace(i, replacement); } } }
// Replace objects in graphicsList with objects from list private void ReplaceObjects(GraphicsList graphicsList, List<DrawObject> list) { for (int i = 0; i < graphicsList.Count; i++) { DrawObject replacement = null; foreach (DrawObject o in list) { if (o.ID == graphicsList[i].ID) { replacement = o; break; } } if (replacement != null) { graphicsList.Replace(i, replacement); } } }