示例#1
0
 private void addManequinButton_Click(object sender, EventArgs e)
 {
     Manequin m = new Manequin();
     Manequins.Add(m);
     TreeNode manequinTreeNode = m.GetManequinTree(string.Format("Gubbe {0}", Manequins.Count));
     manequinTreeView.Nodes[0].Nodes.Add(manequinTreeNode);
     manequinTreeView.SelectedNode = manequinTreeNode.Nodes[0];
 }
示例#2
0
 private void läggTillGubbeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Manequin m = new Manequin();
     Manequins.Add(m);
     TreeNode manequinTreeNode = m.GetManequinTree(string.Format("Gubbe {0}", Manequins.Count));
     manequinTreeView.Nodes[0].Nodes.Add(manequinTreeNode);
     manequinTreeView.SelectedNode = manequinTreeNode.Nodes[0];
 }
示例#3
0
        public void LoadValues(string manequinXml)
        {
            this.Manequins.Clear();

            using (DataSet ds = new DataSet())
            {
                ds.ReadXml(new StringReader(manequinXml));

                SongName = ds.Tables["SongManequin"].Rows[0]["SongName"].ToString();

                if (ds.Tables.Contains("Manequin"))
                {
                    foreach (DataRow row in ds.Tables["Manequin"].Rows)
                    {
                        Manequin m = new Manequin();
                        m.ManequinText = row[0].ToString();

                        foreach (DataRow mp in row.GetChildRows(ds.Tables["Manequin"].ChildRelations["Manequin_ManequinPart"].RelationName))
                        {
                            ManequinPoint p = m.GetPoint(mp[0].ToString());
                            p.XRel = mp["XRel"].ToString().ToDouble();
                            p.YRel = mp["YRel"].ToString().ToDouble();
                        }

                        if (ds.Tables.Contains("Shakes"))
                        {
                            foreach (DataRow shakesRow in row.GetChildRows(ds.Tables["Manequin"].ChildRelations["Manequin_Shakes"].RelationName))
                            {

                                foreach (DataRow shakeRow in shakesRow.GetChildRows(ds.Tables["Shakes"].ChildRelations["Shakes_Shake"].RelationName))
                                {
                                    Shake shake = new Shake();
                                    shake.OriginRelX = shakeRow["OrigX"].ToString().ToFloat();
                                    shake.OriginRelY = shakeRow["OrigY"].ToString().ToFloat();
                                    shake.DestinationRelX = shakeRow["DestX"].ToString().ToFloat();
                                    shake.DestinationRelY = shakeRow["DestY"].ToString().ToFloat();

                                    m.Shakes.Add(shake);
                                }
                            }
                        }

                        this.Manequins.Add(m);
                    }
                }
            }
        }
示例#4
0
        public TreeNode GetManequinTree()
        {
            TreeNode songNode = new TreeNode(SongName);
            songNode.Tag = this;

            if (Manequins.Count == 0)
            {
                Manequin m = new Manequin();
                Manequins.Add(m);

                //manequinTreeView.Nodes[0].Nodes.Add(m.GetManequinTree(string.Format("Gubbe {0}", manequins.Count)));
                //manequinTreeView.SelectedNode = manequinTreeView.Nodes[0].Nodes[0].Nodes[0];
            }

            for (int i = 0; i < Manequins.Count; i++)
            {
                TreeNode node = Manequins[i].GetManequinTree(string.Format("Gubbe {0}", i + 1));
                songNode.Nodes.Add(node);
            }

            return songNode;
        }
示例#5
0
 public void Delete(Manequin manequin)
 {
     Manequins.Remove(manequin);
 }
示例#6
0
 public void Add(Manequin manequin)
 {
     Manequins.Add(manequin);
 }