예제 #1
0
파일: BuildType.cs 프로젝트: oqewok/gitter
 internal override void Update(XmlNode node)
 {
     base.Update(node);
     Project = Context.Projects.Lookup(
         TeamCityUtility.LoadString(node.Attributes["projectId"]),
         TeamCityUtility.LoadString(node.Attributes["projectName"]));
 }
예제 #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);
 }
예제 #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);
 }
예제 #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]);
        }
예제 #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);
        }
예제 #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);
        }
예제 #7
0
        internal virtual void Update(XmlNode node)
        {
            Verify.Argument.IsNotNull(node, "node");

            WebUrl = TeamCityUtility.LoadString(node.Attributes[WebUrlProperty.XmlNodeName]);
        }
예제 #8
0
파일: BuildType.cs 프로젝트: oqewok/gitter
 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"]));
 }
예제 #9
0
 internal override void Update(XmlNode node)
 {
     base.Update(node);
     Name = TeamCityUtility.LoadString(node.Attributes[NameProperty.XmlNodeName]);
 }
예제 #10
0
 protected NamedTeamCityObject(TeamCityServiceContext context, XmlNode node)
     : base(context, node)
 {
     _name = TeamCityUtility.LoadString(node.Attributes[NameProperty.XmlNodeName]);
 }