Beispiel #1
0
 public TfsBuildDefinition(DefinitionReference definition)
 {
     Name     = definition.Name;
     NativeId = definition.Id;
     Id       = NativeId.ToString(CultureInfo.InvariantCulture);
     Links    = new ReferenceLinks();
 }
        /// <summary>
        /// Create a RegionGUID instance.
        /// </summary>
        /// <param name="GUID">GUID.</param>
        public RegionGUID(String GUID)
            : base(GUID)
        {
            Int32  categoryId;
            String categoryIdString;

            // Check arguments.
            if (ObjectID.Length < (Settings.Default.RegionCategoryId_LSID.Length +
                                   Settings.Default.RegionNativeId_LSID.Length +
                                   2))
            {
                throw new ArgumentException("Wrong format in region GUID : " + GUID);
            }
            if (ObjectID.Substring(0, Settings.Default.RegionCategoryId_LSID.Length).ToUpper() !=
                Settings.Default.RegionCategoryId_LSID.ToUpper())
            {
                throw new ArgumentException("Wrong format in region GUID : " + GUID);
            }
            categoryIdString = GetRegionCategoryId();
            if (categoryIdString.IsEmpty() ||
                !Int32.TryParse(categoryIdString, out categoryId))
            {
                throw new ArgumentException("Wrong format in region GUID : " + GUID);
            }
            if (NativeId.IsEmpty())
            {
                throw new ArgumentException("Wrong format in region GUID : " + GUID);
            }
        }
        public TfsBuildDefinition(DefinitionReference definition)
        {
            Name     = definition.Name;
            NativeId = definition.Id;
            Id       = NativeId.ToString();

            _url = definition.Url;
        }