コード例 #1
0
ファイル: Agenda.cs プロジェクト: WoodMuleen/expergent
 /// <summary>
 /// Adds the object to the internal list of business objects.
 /// </summary>
 /// <param name="obj">The obj.</param>
 public void AddObject(IFactProvider obj)
 {
     if (obj != null)
     {
         _initialFacts.AddRange(obj.GenerateFactsForRootObject());
     }
 }
コード例 #2
0
        /// <summary>
        /// Generates the set of facts for this object as relation to a parent object.
        /// </summary>
        /// <param name="parent">The parent path.</param>
        /// <param name="parentObject">The parent object.</param>
        /// <returns>An IList of facts.</returns>
        public virtual IList <WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject)
        {
            List <WME> list = new List <WME>();

            list.Add(new WME(new EntityObjectTerm(this), parent, new EntityObjectTerm(this)));
            MakeFacts(list, parent);
            return(list);
        }
コード例 #3
0
ファイル: Agenda.cs プロジェクト: WoodMuleen/expergent
        /// <summary>
        /// Invokes the specified fact.
        /// </summary>
        /// <param name="fact">The fact.</param>
        private void Invoke(WME fact)
        {
            IFactProvider eo = fact.Identifier.Value as IFactProvider;

            if (eo == null)
            {
                return;
            }
            try
            {
                eo.InvokeMethod(fact.Attribute.Value.ToString(), fact.Value.Value);
                _actionsTaken.Add(fact);
            }
            catch
            {
                _actionsSkipped.Add(fact);
            }
        }
 public void SetProvider(IFactProvider provider)
 {
     this.generator = provider;
 }
コード例 #5
0
 /// <summary>
 /// Generates the set of facts for this object as relation to a parent object.
 /// </summary>
 /// <param name="parent">The parent path.</param>
 /// <param name="parentObject">The parent object.</param>
 /// <returns>An IList of facts.</returns>
 public virtual IList<WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject)
 {
     List<WME> list = new List<WME>();
     list.Add(new WME(new EntityObjectTerm(this), parent, new EntityObjectTerm(this)));
     MakeFacts(list, parent);
     return list;
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityObjectTerm"/> class.
 /// </summary>
 /// <param name="entityObject">The entity object.</param>
 public EntityObjectTerm(IFactProvider entityObject)
     : base(entityObject)
 {
     _termType = TermType.EntityObject;
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityObjectTerm"/> class.
 /// </summary>
 /// <param name="entityObject">The entity object.</param>
 public EntityObjectTerm(IFactProvider entityObject)
     : base(entityObject)
 {
     _termType = TermType.EntityObject;
 }
コード例 #8
0
 /// <summary>
 /// Generates the set of facts for this object as relation to a parent object.
 /// </summary>
 /// <param name="parent">The parent path.</param>
 /// <param name="parentObject">The parent object.</param>
 /// <returns>An IList of facts.</returns>
 public IList <WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject)
 {
     throw new Exception("The method or operation is not implemented.");
 }
コード例 #9
0
ファイル: Agenda.cs プロジェクト: KristenWegner/expergent
 /// <summary>
 /// Adds the object to the internal list of business objects.
 /// </summary>
 /// <param name="obj">The obj.</param>
 public void AddObject(IFactProvider obj)
 {
     if (obj != null)
     {
         _initialFacts.AddRange(obj.GenerateFactsForRootObject());
     }
 }
コード例 #10
0
ファイル: Mixup.cs プロジェクト: KristenWegner/expergent
 /// <summary>
 /// Generates the set of facts for this object as relation to a parent object.
 /// </summary>
 /// <param name="parent">The parent path.</param>
 /// <param name="parentObject">The parent object.</param>
 /// <returns>An IList of facts.</returns>
 public IList<WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject)
 {
     throw new Exception("The method or operation is not implemented.");
 }