Exemplo n.º 1
0
        /// <summary>
        /// AddTool
        /// </summary>
        /// <param name="tool"></param>
        /// <returns></returns>
        public bool AddTool(DeviceTool tool)
        {
            bool result = false;

            if (!ToolExists(tool))
            {
                Tools.Add(tool);
                result = true;
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// FindToolById
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DeviceTool FindToolById(string id)
        {
            DeviceTool result = null;

            if (!string.IsNullOrEmpty(id))
            {
                foreach (var tool in Tools)
                {
                    if (tool.Id.ToLower() == id.ToLower())
                    {
                        result = tool;
                        break;
                    }
                }
            }

            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// ToolExists
 /// </summary>
 /// <param name="tool"></param>
 /// <returns></returns>
 public bool ToolExists(DeviceTool tool)
 {
     return(FindToolById(tool.Id) != null);
 }