Exemple #1
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;
        }
Exemple #2
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);
        }