示例#1
0
 public void AddOrReplace(EntityAppearance app)
 {
     if (newAppearances == null)
     {
         newAppearances = new EntityAppearanceCollection();
     }
     newAppearances.AddOrReplace(app);
 }
示例#2
0
        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;
        }
示例#3
0
        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()
                   );
        }
示例#4
0
        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);
        }