示例#1
0
文件: Params.cs 项目: yingted/Myro
        /// <summary>
        /// Return the class instance associated with the GUID.  This GUID must be in the
        /// KnownImageTypes property.
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public static MyroImageType CreateFromGuid(Guid guid)
        {
            var ret = KnownImageTypes.Find(it => it.Guid.Equals(guid));

            if (ret == default(MyroImageType))
            {
                throw new ArgumentException("Guid does not represent a known Myro image type.  Try the Guids in Myro.Utilities.Params");
            }
            return(ret);
        }
示例#2
0
文件: Params.cs 项目: yingted/Myro
        /// <summary>
        /// Return the class instance associated with the short name.  This short name must be in the
        /// KnownImageTypes property.
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public static MyroImageType CreateFromShortName(string shortName)
        {
            var ret = KnownImageTypes.Find(it => it.ShortName.Equals(shortName, StringComparison.CurrentCultureIgnoreCase));

            if (ret == default(MyroImageType))
            {
                throw new ArgumentException("Guid does not represent a known Myro image type.  Try the Guids in Myro.Utilities.Params");
            }
            return(ret);
        }