Example #1
0
        /// returns the factory that corresponds to the given model
        protected static UMLFactory getFactory(UMLModel model)
        {
            UMLFactory instance = null;

            instances.TryGetValue(model, out instance);
            return(instance);
        }
Example #2
0
 private static void addFactory(UMLModel model, UMLFactory factory)
 {
     if (!instances.ContainsKey(model))
     {
         instances.Add(model, factory);
     }
 }
Example #3
0
        /// returns the singleton instance of the factory
        public static UMLFactory getInstance(UMLModel model)
        {
            UMLFactory instance = getFactory(model);

            if (instance == null)
            {
                instance = model.factory;
            }
            return(instance);
        }
Example #4
0
 public UMLFactory(UMLModel model)
 {
     this.model = model;
     UMLFactory.addFactory(model, this);
 }