コード例 #1
0
ファイル: OsdBuilder.cs プロジェクト: mythocalos/dotnetage
        public OsdBuilder(string shortName, string description)
        {
            if (string.IsNullOrEmpty(shortName))
            {
                throw new ArgumentNullException("shortName");
            }

            if (string.IsNullOrEmpty(description))
            {
                throw new ArgumentNullException("description");
            }

            //if (shortName.Length > 16)
            //    throw new ArgumentOutOfRangeException("shortName", "shortName must be contain less then 16 characters.");

            //if (description.Length > 1024)
            //    throw new ArgumentOutOfRangeException("description", "shortName must be contain less then 1024 characters.");

            osd = new OpenSearchDescription()
            {
                ShortName   = shortName,
                Description = description,
                Urls        = new List <OpenSearchUrl>()
            };
        }
コード例 #2
0
ファイル: OsdBuilder.cs プロジェクト: howej/dotnetage
        public OsdBuilder(string shortName, string description)
        {
            if (string.IsNullOrEmpty(shortName))
                throw new ArgumentNullException("shortName");

            if (string.IsNullOrEmpty(description))
                throw new ArgumentNullException("description");

            //if (shortName.Length > 16)
            //    throw new ArgumentOutOfRangeException("shortName", "shortName must be contain less then 16 characters.");

            //if (description.Length > 1024)
            //    throw new ArgumentOutOfRangeException("description", "shortName must be contain less then 1024 characters.");

            osd = new OpenSearchDescription()
            {
                ShortName = shortName,
                Description = description,
                Urls = new List<OpenSearchUrl>()
            };
        }