public void AddOrReplace(EntityAppearance app) { if (newAppearances == null) { newAppearances = new EntityAppearanceCollection(); } newAppearances.AddOrReplace(app); }
public void AddOrReplace(EntityAppearance app) { Type t = app.GetType(); if (!t.IsSerializable) { throw new IntegrityViolation("Trying to add non-serializable appearance to collection: " + t); } members[app.GetType()] = app; }
public override int CompareTo(EntityAppearance other) { GeometricAppearance o = other as GeometricAppearance; if (o == null) { return(1); } return(new Helper.Comparator() .Append(string.Compare(geometryName, o.geometryName)) .Append(orientation, o.orientation) .Finish() ); }
public void Add(EntityAppearance app) { Type t = app.GetType(); if (!t.IsSerializable) { throw new IntegrityViolation("Trying to add non-serializable appearance to collection: " + t); } if (Contains(t)) { throw new IntegrityViolation("This appearance already exists in this collection"); } members.Add(t, app); }