Пример #1
0
		private void CopyInterpreterToAttributes(InteractiveInterpreter interpreter,
												IActionContext context)
		{
			IDictionaryEnumerator configEnum;
			configEnum=context.GetConfiguration().GetEnumerator();
			while(configEnum.MoveNext())
			{
				DictionaryEntry property;
				property = (DictionaryEntry)configEnum.Current;
				if (!property.Key.Equals("script"))
				{
					object attributeValue = context.GetAttribute((String)property.Key);
					object interpreterValue = interpreter.GetValue((String)property.Key);
					// Change the attribute only if the value changed and is marked for copying
					if (!property.Key.Equals("script") && attributeValue != null 
						&& ! attributeValue.Equals(interpreterValue)
						&& property.Value.ToString().IndexOf("Out")!=-1 )
					{
						if (log.IsDebugEnabled)
						{
							log.Debug("copy from <-interpreter key:"+property.Key+" oldvalue:"+attributeValue+ " newvalue:"+interpreterValue);
						}
						context.SetAttribute((String)property.Key,interpreterValue);
					}
				}
			}
		}
Пример #2
0
        private void CopyInterpreterToAttributes(InteractiveInterpreter interpreter,
                                                 IActionContext context)
        {
            IDictionaryEnumerator configEnum;

            configEnum = context.GetConfiguration().GetEnumerator();
            while (configEnum.MoveNext())
            {
                DictionaryEntry property;
                property = (DictionaryEntry)configEnum.Current;
                if (!property.Key.Equals("script"))
                {
                    object attributeValue   = context.GetAttribute((String)property.Key);
                    object interpreterValue = interpreter.GetValue((String)property.Key);
                    // Change the attribute only if the value changed and is marked for copying
                    if (!property.Key.Equals("script") && attributeValue != null &&
                        !attributeValue.Equals(interpreterValue) &&
                        property.Value.ToString().IndexOf("Out") != -1)
                    {
                        if (log.IsDebugEnabled)
                        {
                            log.Debug("copy from <-interpreter key:" + property.Key + " oldvalue:" + attributeValue + " newvalue:" + interpreterValue);
                        }
                        context.SetAttribute((String)property.Key, interpreterValue);
                    }
                }
            }
        }
Пример #3
0
 public void Run(IActionContext actionContext)
 {
     actionContext.SetAttribute("available", Evaluation.DISAPPROVE);
 }
Пример #4
0
 public void Run(IActionContext actionContext)
 {
     actionContext.SetAttribute("the text attrib", ":(");
 }
Пример #5
0
		public void Run(IActionContext actionContext)
		{
			actionContext.SetAttribute("available",Evaluation.DISAPPROVE);
		}
Пример #6
0
 public void Run(IActionContext actionContext)
 {
     actionContext.SetAttribute("the text attrib",":(");
 }