示例#1
0
        public DevicePartSpeed CreateSpeed(DeviceSpeed speed)
        {
            DevicePartSpeed partSpeed = FindSpeed(speed);

            if (partSpeed == null)
            {
                partSpeed = new DevicePartSpeed(this, speed);
                Speeds.Add(partSpeed);
            }
            return(partSpeed);
        }
示例#2
0
 public virtual void Deserialize(XElement element)
 {
     if (string.Compare(element.Name.ToString(), "devicepart") == 0)
     {
         // Parse the package
         XAttribute packageAttr = element.Attribute("package");
         if (packageAttr != null)
         {
             Package = Parent.Family.FindPackage(packageAttr.Value);
         }
         // Parse the speeds
         XElement speeds = element.Element("speeds");
         if (speeds != null)
         {
             foreach (XElement speedElement in speeds.Elements())
             {
                 DevicePartSpeed speed = new DevicePartSpeed(this);
                 speed.Deserialize(speedElement);
                 Speeds.Add(speed);
             }
         }
     }
 }