Beispiel #1
0
 /// <summary>
 /// Constructor which just takes the model class.
 /// </summary>
 /// <param name="caller"></param>
 public ModelEngine(object caller)
     : base(null, null)
 {
     //TODO: I'd like to remove this overload
     _caller  = caller;
     _options = (ModelEngineOptions)ModelEngineOptions.Default.Clone();
 }
Beispiel #2
0
        /// <summary>
        /// Constructor which takes multiple models.
        /// </summary>
        /// <param name="models">object of type Model</param>
        public ModelEngine(ModelEngine parent, params Model[] models)
            : base(null, null)
        {
            _parent = parent;
            _caller = parent;

            //Options
            if (parent != null)
            {
                _options = (ModelEngineOptions)parent.Options.Clone();    //Copy from parent
            }
            else
            {
                _options = (ModelEngineOptions)ModelEngineOptions.Default.Clone();          //Defaults
            }
            //Use passed in models, instead of finding them
            //Saves perf, and the user having to first clear, then add
            _models = new Models(this);
            _models.Add(models);
        }
Beispiel #3
0
		/// <summary>
		/// Constructor which just takes the model class.
		/// </summary>
		/// <param name="caller"></param>
		public ModelEngine(object caller)
			: base(null, null)
		{
            //TODO: I'd like to remove this overload
			_caller	    = caller;
		    _options    = (ModelEngineOptions)ModelEngineOptions.Default.Clone();
		}
Beispiel #4
0
        /// <summary>
        /// Constructor which takes multiple models.
        /// </summary>
        /// <param name="models">object of type Model</param>
        public ModelEngine(ModelEngine parent, params Model[] models)
            : base(null, null)
        {
            _parent = parent;
            _caller = parent;
            
            //Options
            if(parent != null)
                _options = (ModelEngineOptions)parent.Options.Clone();    //Copy from parent
		    else
		        _options = (ModelEngineOptions)ModelEngineOptions.Default.Clone();  //Defaults

            //Use passed in models, instead of finding them
            //Saves perf, and the user having to first clear, then add
            _models = new Models(this);
            _models.Add(models);
        }