Beispiel #1
0
        /*/// <summary>
         * ///     Disposes of this IComponent and its managed resources
         * /// </summary>
         * public void Dispose()
         * {
         *  dispose(true);
         *  //GC.SuppressFinalize(this);
         * }*/

        /// <summary>
        ///     Gets a IComponent from the active colletion by it's name. Reports any errors and returns
        ///     null should there be any.
        /// </summary>
        /// <param name="commonName">CommonName of the component</param>
        /// <returns></returns>
        public IComponent Get(CommonName commonName)
        {
            try
            {
                return(componentCollection[commonName.ToString()]);
            }
            catch (Exception ex)
            {
                Log.Write(ex);
            }

            Report.Error($"Cannot find component {commonName}, it does not exist in the active collection!");
            return(null);
        }
Beispiel #2
0
 /// <summary>
 ///     Method to check if two commonNames are equal
 /// </summary>
 /// <param name="other">The commonName to compare to</param>
 /// <returns>Boolean equals</returns>
 private bool equals(CommonName other) => string.Equals(name, other.name);