internal void AddShapeId(TEscherOPTRecord Opt) { long ShapeId = Opt.ShapeId(); if (ShapeId < 0) { NotLoadedOpt.Add(Opt); } else { OptsByShapeId[ShapeId] = Opt; } }
internal void Remove(TEscherOPTRecord Opt, bool AlsoRemoveShapeId) { FillNotLoaded(); if (AlsoRemoveShapeId) { OptsByShapeId.Remove(Opt.ShapeId()); } if (Opt == null || String.IsNullOrEmpty(Opt.ShapeName)) { return; } TLinkedOpts FirstOpt; if (!OptsByName.TryGetValue(Opt.ShapeName, out FirstOpt)) { return; } TLinkedOpts current = FirstOpt; TLinkedOpts previous = null; while (current != null) { if (current.Opt == Opt) { break; } previous = current; current = current.Next; } if (current == null) { return; } if (previous != null) { previous.Next = current.Next; } else { TLinkedOpts next = current.Next; OptsByName.Remove(Opt.ShapeName); if (next != null) { OptsByName.Add(Opt.ShapeName, next); } } }