예제 #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);
        }