示例#1
0
        /// <summary>
        /// Unregisters the variable value update handler.
        /// </summary>
        /// <param name="variableName">Name of the variable.</param>
        /// <param name="handler">The handler.</param>
        /// <returns></returns>
        public bool UnregisterVariableValueUpdateHandler(string variableName, VariableValueUpdateHandler handler)
        {
            bool ret = false;

            try
            {
                VariableEntry entry;
                ret = variableEntriesByName.TryGetValue(variableName, out entry);
                if (ret)
                {
                    entry.valueUpdatingEvent -= handler;
                }
            }
            catch (Exception e)
            {
                Log.Error("Error", e);
            }
            return(ret);
        }
 /// <summary>
 /// Unregisters the variable value update handler.
 /// </summary>
 /// <param name="variableName">Name of the variable.</param>
 /// <param name="handler">The handler.</param>
 /// <returns></returns>
 public bool UnregisterVariableValueUpdateHandler(string variableName, VariableValueUpdateHandler handler)
 {
     bool ret = false;
     try
     {
         VariableEntry entry;
         ret = variableEntriesByName.TryGetValue(variableName, out entry);
         if (ret)
         {
             entry.valueUpdatingEvent -= handler;
         }
     }
     catch (Exception e)
     {
         Log.Error("Error", e);
     }
     return ret;
 }