コード例 #1
0
ファイル: Timeline.cs プロジェクト: olofn/db_public
 private void FromXmlElementToChannel(XmlElement channelElement)
 {
     Channel channel = new Channel();
     AddChannel(channel);
     foreach (XmlNode node in channelElement.ChildNodes)
     {
         if (node.Name == "number")
         {
             channel.ChannelNumber = int.Parse(node.InnerText);
         }
         else if (node.Name == "clip")
         {
             XmlElement element = (XmlElement)node;
             if (element.GetAttribute("type") == "spline")
             {
                 SplineClip clip = new SplineClip();
                 clip.FromXmlElement(element);
                 AddClip(clip, clip.Location, clip.Dimension.Width);
             }
             else if (element.GetAttribute("type") == "generator")
             {
                 GeneratorClip clip = new GeneratorClip();
                 clip.FromXmlElement(element);
                 AddClip(clip, clip.Location, clip.Dimension.Width);
             }
         }
     }
 }