Пример #1
0
        /// <summary>
        /// Gets the name of the given function.
        /// </summary>
        /// <returns>True if a function name was found, false if a default name is used.</returns>
        public string GetFunctionName(LocFunction function, out bool isCustom)
        {
            var setting = Entity.Functions.FirstOrDefault(x => x.Function == function);

            if (setting != null)
            {
                // Custom name
                isCustom = true;
                return(setting.Description);
            }
            isCustom = false;
            return((function == LocFunction.Light) ? "Light" : string.Format("F{0}", (int)function));
        }
Пример #2
0
 /// <summary>
 /// Return the state of a function.
 /// </summary>
 /// <returns>True if such a state exists, false otherwise</returns>
 public bool TryGetFunctionState(LocFunction function, out IStateProperty <bool> state)
 {
     return(functionStates.TryGetValue(function, out state));
 }