src/FingersDance.Control.Screen/UserControlScreen.xaml.cs
changeset 225 b60e13ed75c8
parent 223 90d2be5c3d39
child 229 05aba5def1fc
equal deleted inserted replaced
224:874de6d84a2e 225:b60e13ed75c8
   171                         foreach (XElement annotNode in cuttingNode.Element("elements").Elements())
   171                         foreach (XElement annotNode in cuttingNode.Element("elements").Elements())
   172                         {
   172                         {
   173                             String aId = annotNode.Attribute("id").Value;
   173                             String aId = annotNode.Attribute("id").Value;
   174                             float begin = (float)annotNode.Attribute("begin");
   174                             float begin = (float)annotNode.Attribute("begin");
   175                             float dur = (float)annotNode.Attribute("dur");
   175                             float dur = (float)annotNode.Attribute("dur");
   176                             String gt = annotNode.Element("gestureType").Value;
   176                             String[] gt = annotNode.Element("gestureType").Value.Split(new Char[] { ',' });
       
   177                             List<String> gtList = new List<String>();
       
   178                             gtList.AddRange(gt);
   177                             String colorString = annotNode.Attribute("color").Value; // is type 0xRRGGBB
   179                             String colorString = annotNode.Attribute("color").Value; // is type 0xRRGGBB
   178                             Byte r = Convert.ToByte(colorString.Substring(2, 2), 16);
   180                             Byte r = Convert.ToByte(colorString.Substring(2, 2), 16);
   179                             Byte g = Convert.ToByte(colorString.Substring(4, 2), 16);
   181                             Byte g = Convert.ToByte(colorString.Substring(4, 2), 16);
   180                             Byte b = Convert.ToByte(colorString.Substring(6, 2), 16);
   182                             Byte b = Convert.ToByte(colorString.Substring(6, 2), 16);
   181                             Color c = Color.FromRgb(r, g, b);
   183                             Color c = Color.FromRgb(r, g, b);
   182                             Annotation Annotation = new Annotation(aId, begin, dur, gt, c);
   184                             Annotation Annotation = new Annotation(aId, begin, dur, gtList, c);
   183                             la.Add(Annotation);
   185                             la.Add(Annotation);
   184                             Data.AddAnnotation(Annotation);
   186                             Data.AddAnnotation(Annotation);
   185                         }
   187                         }
   186                         loadedProject.Cuttings.Add(new Cutting(cuttingNode.Attribute("id").Value,cuttingNode.Element("title").Value,la));
   188                         loadedProject.Cuttings.Add(new Cutting(cuttingNode.Attribute("id").Value,cuttingNode.Element("title").Value,la));
   187                     }
   189                     }