Example #1
0
 internal override void Update(XmlNode node)
 {
     base.Update(node);
     Project = Context.Projects.Lookup(
         TeamCityUtility.LoadString(node.Attributes["projectId"]),
         TeamCityUtility.LoadString(node.Attributes["projectName"]));
 }
Example #2
0
 internal override void Update(XmlNode node)
 {
     Status    = TeamCityUtility.LoadBuildStatus(node.Attributes[StatusProperty.XmlNodeName]);
     Number    = TeamCityUtility.LoadString(node.Attributes[NumberProperty.XmlNodeName]);
     StartDate = TeamCityUtility.LoadDateForSure(node.Attributes[StartDateProperty.XmlNodeName]);
     BuildType = Context.BuildTypes.Lookup(node.Attributes[BuildTypeProperty.XmlNodeName].InnerText);
 }
Example #3
0
 internal Build(TeamCityServiceContext context, XmlNode node)
     : base(context, node)
 {
     _status    = TeamCityUtility.LoadBuildStatus(node.Attributes[StatusProperty.XmlNodeName]);
     _number    = TeamCityUtility.LoadString(node.Attributes[NumberProperty.XmlNodeName]);
     _startDate = TeamCityUtility.LoadDateForSure(node.Attributes[StartDateProperty.XmlNodeName]);
     _buildtype = Context.BuildTypes.Lookup(node.Attributes[BuildTypeProperty.XmlNodeName].InnerText);
 }
Example #4
0
        protected TeamCityObject(TeamCityServiceContext context, XmlNode node)
        {
            Verify.Argument.IsNotNull(context, "context");
            Verify.Argument.IsNotNull(node, "node");

            _context = context;
            _id      = TeamCityUtility.LoadString(node.Attributes[IdProperty.XmlNodeName]);
            _webUrl  = TeamCityUtility.LoadString(node.Attributes[WebUrlProperty.XmlNodeName]);
        }
Example #5
0
        public Build[] Query(BuildLocator locator)
        {
            Verify.Argument.IsNotNull(locator, nameof(locator));

            var xml    = Context.GetXml(QUERY + locator.ToString());
            var root   = xml["builds"];
            var result = new Build[TeamCityUtility.LoadInt(root.Attributes["count"])];
            int id     = 0;

            foreach (XmlElement node in root.ChildNodes)
            {
                result[id++] = Lookup(node);
            }
            return(result);
        }
Example #6
0
        internal T Lookup(XmlNode node)
        {
            Verify.Argument.IsNotNull(node, "node");

            var id = TeamCityUtility.LoadString(node.Attributes[TeamCityObject.IdProperty.XmlNodeName]);
            T   obj;

            lock (SyncRoot)
            {
                if (!_cache.TryGetValue(id, out obj))
                {
                    obj = Create(node);
                    _cache.Add(id, obj);
                }
                else
                {
                    obj.Update(node);
                }
            }
            return(obj);
        }
Example #7
0
        internal virtual void Update(XmlNode node)
        {
            Verify.Argument.IsNotNull(node, "node");

            WebUrl = TeamCityUtility.LoadString(node.Attributes[WebUrlProperty.XmlNodeName]);
        }
Example #8
0
 internal BuildType(TeamCityServiceContext context, XmlNode node)
     : base(context, node)
 {
     _builds  = new BuildTypeBuildsCollection(this, Context.Builds);
     _project = Context.Projects.Lookup(TeamCityUtility.LoadString(node.Attributes["projectId"]), TeamCityUtility.LoadString(node.Attributes["projectName"]));
 }
Example #9
0
 internal override void Update(XmlNode node)
 {
     base.Update(node);
     Name = TeamCityUtility.LoadString(node.Attributes[NameProperty.XmlNodeName]);
 }
Example #10
0
 protected NamedTeamCityObject(TeamCityServiceContext context, XmlNode node)
     : base(context, node)
 {
     _name = TeamCityUtility.LoadString(node.Attributes[NameProperty.XmlNodeName]);
 }