RegistDynamicProperty() public method

public RegistDynamicProperty ( Name propertyName, DynamicPropertyCalculator_T1 surrogate, string description = null ) : void
propertyName Name
surrogate DynamicPropertyCalculator_T1
description string
return void
Example #1
0
 public void Test_DynamicProperty_Regist_Fail_ConstantProperties()
 {
     var kb = new KB((Name)"Me");
     Assert.Throws<ArgumentException>(() =>
     {
         kb.Tell((Name)"Count(John)", Name.BuildName(3));
         kb.RegistDynamicProperty((Name)"Count", DummyCount);
     });
 }
Example #2
0
 private static void RegistNativeDynamicProperties(KB kb)
 {
     kb.RegistDynamicProperty(COUNT_TEMPLATE, CountPropertyCalculator, new[] { "x" });
 }
Example #3
0
 public void Test_DynamicProperty_Regist_Fail_Null_Surogate()
 {
     var kb = new KB((Name)"Me");
     Assert.Throws<ArgumentNullException>(() => kb.RegistDynamicProperty((Name)"Count", (DynamicPropertyCalculator_T1)null));
 }
Example #4
0
 public void Test_DynamicProperty_Regist_Fail_InvalidTemplate()
 {
     var kb = new KB((Name)"Me");
     Assert.Throws<ArgumentException>(() => kb.RegistDynamicProperty((Name)"Count(John)", DummyCount));
 }
Example #5
0
 public void BindCalls(KB kb)
 {
     kb.RegistDynamicProperty(EVENT_ID_PROPERTY_NAME, EventIdPropertyCalculator, "Returns the ids of all events that unify with the property's name");
     kb.RegistDynamicProperty(EVENT_ELAPSED_TIME_PROPERTY_NAME, EventAgePropertyCalculator, "The number of ticks passed since the event associated to [id] occured");
     kb.RegistDynamicProperty(LAST_EVENT_ID_PROPERTY_NAME, LastEventIdPropertyCalculator, "Returns the id of the last event if it unifies with the property's name");
 }