529 Panel2.UserControlSyncSource_DisplayAnnotation(idUser, brushAnnot); |
532 Panel2.UserControlSyncSource_DisplayAnnotation(idUser, brushAnnot); |
530 if (Panel3 != null) |
533 if (Panel3 != null) |
531 Panel3.UserControlSyncSource_DisplayAnnotation(idUser, brushAnnot); |
534 Panel3.UserControlSyncSource_DisplayAnnotation(idUser, brushAnnot); |
532 if (Panel4 != null) |
535 if (Panel4 != null) |
533 Panel4.UserControlSyncSource_DisplayAnnotation(idUser, brushAnnot); |
536 Panel4.UserControlSyncSource_DisplayAnnotation(idUser, brushAnnot); |
534 } |
537 |
|
538 // We save datas |
|
539 saveDatas(); |
|
540 |
|
541 } |
|
542 |
|
543 // |
|
544 // Enable to save datas in a xml file with LDT format |
|
545 // |
|
546 private void saveDatas() |
|
547 { |
|
548 //XDocument d = new XDocument( |
|
549 // new XComment("This is a comment."), |
|
550 // new XProcessingInstruction("xml-stylesheet", |
|
551 // "href='mystyle.css' title='Compact' type='text/css'"), |
|
552 // new XElement("Pubs", |
|
553 // new XElement("Book", |
|
554 // new XElement("Title", "Artifacts of Roman Civilization"), |
|
555 // new XElement("Author", "Moreno, Jordao") |
|
556 // ), |
|
557 // new XElement("Book", |
|
558 // new XElement("Title", "Midieval Tools and Implements"), |
|
559 // new XElement("Author", "Gazit, Inbar") |
|
560 // ) |
|
561 // ), |
|
562 // new XComment("This is another comment.") |
|
563 //); |
|
564 //d.Declaration = new XDeclaration("1.0", "utf-8", "true"); |
|
565 //Console.WriteLine(d); |
|
566 |
|
567 XDocument d = new XDocument( |
|
568 new XElement("iri", |
|
569 new XElement("project", |
|
570 new XAttribute("id", "1"), |
|
571 new XAttribute("user", "IRI-Strate-EFREI"), |
|
572 new XAttribute("title", _mainviewmodel.Project.Name), |
|
573 new XAttribute("abstract", _mainviewmodel.Project.Description) |
|
574 ), |
|
575 new XElement("medias", |
|
576 new XElement("media", |
|
577 new XAttribute("id","for_oneflat"), |
|
578 new XAttribute("src","srcIri"), |
|
579 new XAttribute("video",""), |
|
580 new XAttribute("extra",""), |
|
581 new XAttribute("pict","") |
|
582 ) |
|
583 ), |
|
584 new XElement("annotations", |
|
585 new XElement("content", |
|
586 new XAttribute("id", "for_oneflat"), |
|
587 new XAttribute("title", "Déc. personnels"), |
|
588 new XAttribute("author", "perso"), |
|
589 new XAttribute("abstract", "Ensemble de découpages définis par un utilisateur") |
|
590 ) |
|
591 ), |
|
592 new XElement("displays"), |
|
593 new XElement("edits") |
|
594 ) |
|
595 ); |
|
596 // We add each cutting |
|
597 XElement annotContent = (XElement)(d.Root.Elements().ToList()[2]).FirstNode; |
|
598 foreach (Cutting cut in _mainviewmodel.Project.Cuttings) |
|
599 { |
|
600 XElement cutNode = new XElement("decoupage", new XAttribute("id", "c_" + System.Guid.NewGuid()), new XAttribute("author", "perso"), |
|
601 new XElement("title",cut.Title), |
|
602 new XElement("abstract","")); |
|
603 XElement cutElmts = new XElement("elements"); |
|
604 cutNode.Add(cutElmts); |
|
605 foreach (Annotation annot in cut.AnnotList) |
|
606 { |
|
607 cutElmts.Add(new XElement("element", new XAttribute("id", "s_" + System.Guid.NewGuid()), |
|
608 new XAttribute("begin", annot.TcBegin), |
|
609 new XAttribute("dur", annot.Dur), |
|
610 new XAttribute("author", cut.Title), |
|
611 new XAttribute("date", DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString()), |
|
612 new XAttribute("color", annot.Color), |
|
613 new XAttribute("src", ""), |
|
614 new XElement("title", annot.GestureType), |
|
615 new XElement("abstract"), |
|
616 new XElement("audio"), |
|
617 new XElement("tags"), |
|
618 new XElement("gestureType", annot.GestureType))); |
|
619 } |
|
620 annotContent.Add(cutNode); |
|
621 } |
|
622 |
|
623 d.Declaration = new XDeclaration("1.0", "utf-8", "true"); |
|
624 Console.WriteLine(d); |
|
625 |
|
626 d.Save(_mainviewmodel.Project.Name + ".ldt"); |
|
627 |
|
628 } |
|
629 |
|
630 |
535 //On Tag Visualisation Mute all the other Players |
631 //On Tag Visualisation Mute all the other Players |
536 private void Panel_OnTagVisualisation(object sender, EventArgs e) |
632 private void Panel_OnTagVisualisation(object sender, EventArgs e) |
537 { |
633 { |
538 UserControlUserPanel PanelMaster = (UserControlUserPanel)sender; |
634 UserControlUserPanel PanelMaster = (UserControlUserPanel)sender; |
539 if (Panel1 != null) |
635 if (Panel1 != null) |