示例#1
0
 public SlotInfo AddSlot(string name, SlotType type, TypeInfo valueType)
 {
     lock (LockObject)
     {
         var index = type == SlotType.Value ? ValuesCount++ : ParametersCount++;
         var slot  = new SlotInfo(this, type, valueType, name, index);
         slots.Add(name, slot);
         return(slot);
     }
 }
示例#2
0
        public bool TryGetValue(string key, out object value)
        {
            value = null;
            SlotInfo slot = scope.ScopeInfo.GetSlot(key);

            if (slot == null)
            {
                return(false);
            }
            value = scope.GetValue(slot.Index);
            return(true);
        }