예제 #1
0
        public void LoadContainersPlacement(string FileName)
        {
            XDocument xml = XDocument.Load(FileName);

            xml.Descendants("Bay").Select(x => new
            {
                Name       = x.Attribute("Name").Value,
                Containers = x.Descendants("Container").Select(c => new
                {
                    Row    = Convert.ToInt16(c.Attribute("Row").Value),
                    Tier   = Convert.ToInt16(c.Attribute("Tier").Value),
                    Loaded = Convert.ToBoolean(c.Attribute("Loaded").Value)
                })
            }).ToList().ForEach(d =>
            {
                foreach (var item in d.Containers)
                {
                    ContainerObject container = ContainerList.Find(i => i.BayNumberString == d.Name && i.Row == item.Row && i.Tier == item.Tier);
                    container.containerLoaded = item.Loaded;
                }
            });
        }
예제 #2
0
 public static Container Load(int csmID)
 {
     return(ContainerList.Find(delegate(Container csm) { return csm.ID.Equals(csmID); }));
     //return VesselPlansList.Find(vp => vp.ID.Equals(vpID));
 }