Пример #1
0
        private ReleaseIdentifier ReadReleaseIdentifier(JObject source)
        {
            ReleaseIdentifier releaseIdentifier = new ReleaseIdentifier();

            foreach (var item in source)
            {
                var v = item.Value;

                switch (item.Key)
                {
                case "type":
                    releaseIdentifier.Type = DataReader.ParseReleaseIdentifierType(v.Value <string>());
                    break;

                case "value":
                    releaseIdentifier.Value = v.Value <string>();
                    break;

                case "description":
                    releaseIdentifier.Description = v.Value <string>();
                    break;

                default:
                    this.ThrowIfStrict("Unknown key: " + item.Key);
                    break;
                }
            }
            return(releaseIdentifier);
        }
Пример #2
0
        private ReleaseIdentifier ReadReleaseIdentifier()
        {
            this.XmlReader.AssertElementStart("identifier");
            this.XmlReader.AssertEmptyElement();

            ReleaseIdentifier identifier = new ReleaseIdentifier();

            identifier.Type        = DataReader.ParseReleaseIdentifierType(this.XmlReader.GetAttribute("type"));
            identifier.Value       = this.XmlReader.GetAttribute("value");
            identifier.Description = this.XmlReader.GetAttribute("description");

            return(identifier);
        }
Пример #3
0
        private ReleaseIdentifier ReadReleaseIdentifier()
        {
            this.XmlReader.AssertElementStart("identifier");
            this.XmlReader.AssertEmptyElement();

            ReleaseIdentifier identifier = new ReleaseIdentifier();
            identifier.Type = DataReader.ParseReleaseIdentifierType(this.XmlReader.GetAttribute("type"));
            identifier.Value = this.XmlReader.GetAttribute("value");
            identifier.Description = this.XmlReader.GetAttribute("description");

            return identifier;
        }
Пример #4
0
        private ReleaseIdentifier ReadReleaseIdentifier(JObject source)
        {
            ReleaseIdentifier releaseIdentifier = new ReleaseIdentifier();
            foreach (var item in source)
            {
                var v = item.Value;

                switch (item.Key)
                {
                    case "type":
                        releaseIdentifier.Type = DataReader.ParseReleaseIdentifierType(v.Value<string>());
                        break;
                    case "value":
                        releaseIdentifier.Value = v.Value<string>();
                        break;
                    case "description":
                        releaseIdentifier.Description = v.Value<string>();
                        break;
                    default:
                        this.ThrowIfStrict("Unknown key: " + item.Key);
                        break;
                }
            }
            return releaseIdentifier;
        }