Beispiel #1
0
        public void ExecuteForEachParam(ParamAction paramAction)
        {
            Assert.IsNotNull(paramAction);

            foreach (var param_pair in m_DiObjectManager.ID2Object)
            {
                paramAction(param_pair.Value);
            }
        }
Beispiel #2
0
 public void Execute()
 {
     if (Action != null)
     {
         Action.Invoke();
     }
     if (ParamAction != null && Parameter != null)
     {
         ParamAction.Invoke(Parameter);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Perform an action on all the values in the top level of the ParameterSet.
        /// This hides the fact that there are delegate values
        /// </summary>
        /// <param name="act"></param>
        public void ForEach(ParamAction act)
        {
            string lastKey = "NOTSET";

            try {
                lock (m_params) {
                    foreach (KeyValuePair <string, OMVSD.OSD> kvp in m_params)
                    {
                        lastKey = kvp.Key;
                        act(kvp.Key, kvp.Value);
                    }
                    foreach (KeyValuePair <string, ParameterSetRuntimeValue> kvp in m_runtimeValues)
                    {
                        lastKey = kvp.Key;
                        act(kvp.Key, kvp.Value(kvp.Key));
                    }
                }
            }
            catch (Exception e) {
                LogManager.Log.Log(LogLevel.DBADERROR, "ParameterSet.ForEach: lastkey={0}, e={0}", lastKey, e.ToString());
            }
        }
 /// <summary>
 /// Perform an action on all the values in the top level of the ParameterSet.
 /// This hides the fact that there are delegate values
 /// </summary>
 /// <param name="act"></param>
 public void ForEach(ParamAction act)
 {
     string lastKey = "NOTSET";
     try {
     lock (m_params) {
         foreach (KeyValuePair<string, OMVSD.OSD> kvp in m_params) {
             lastKey = kvp.Key;
             act(kvp.Key, kvp.Value);
         }
         foreach (KeyValuePair<string, ParameterSetRuntimeValue> kvp in m_runtimeValues) {
             lastKey = kvp.Key;
             act(kvp.Key, kvp.Value(kvp.Key));
         }
     }
     }
     catch (Exception e) {
     LogManager.Log.Log(LogLevel.DBADERROR, "ParameterSet.ForEach: lastkey={0}, e={0}", lastKey, e.ToString());
     }
 }
 // this makes no sense on this structure -- something better later
 public void ForEach(ParamAction act)
 {
     return;
 }
 public ParamPropertyAttribute(ParamAction action, string name, bool isRequired)
 {
     this.Action     = action;
     this.Name       = name;
     this.IsRequired = isRequired;
 }
 public ParamPropertyAttribute(ParamAction action, string name)
     : this(action, name, false)
 {
 }
 // this makes no sense on this structure -- something better later
 public void ForEach(ParamAction act) {
     return;
 }
 public ParamPropertyAttribute(ParamAction action, string name, bool isRequired)
 {
     this.Action     = action;
     this.Name       = name;
     this.IsRequired = isRequired;
 }
 public ParamPropertyAttribute(ParamAction action, string name) : this(action, name, false)
 {
 }