예제 #1
0
        public static InstanceRep FromXDocument(XElement xElement)
        {
            var id       = int.Parse(xElement.Attribute(XName.Get("id")).Value);
            var name     = xElement.Attribute(XName.Get("name")).Value;
            var instance = new InstanceRep(id, name)
            {
                AggregatedBy = ParseUtility.ValueOfDescendant(xElement, "IsAggregatedBy", Convert.ToInt32, 0),
                InstanceOf   = ParseUtility.ValueOfDescendant(xElement, "IsInstanceOf", Convert.ToInt32, 0)
            };

            return(instance);
        }
        public static Instance3D FromXDocument(XElement xElement)
        {
            var id       = int.Parse(xElement.Attribute(XName.Get("id")).Value);
            var name     = xElement.Attribute(XName.Get("name")).Value;
            var instance = new Instance3D(id, name)
            {
                AggregatedBy   = ParseUtility.ValueOfDescendant(xElement, "IsAggregatedBy", Convert.ToInt32, 0),
                InstanceOf     = ParseUtility.ValueOfDescendant(xElement, "IsInstanceOf", Convert.ToInt32, 0),
                RelativeMatrix =
                    ParseUtility.ValueOfDescendant <IList <double> >(xElement, "RelativeMatrix",
                                                                     ParseList, new List <double>())
            };

            return(instance);
        }