src/FingersDance.Actions/ActionStartOrEndAnnotation.cs
author cavaliet
Wed, 25 Nov 2009 10:49:44 +0100
changeset 231 4eff6b0c9215
parent 214 beebae32b1ed
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
     1
using System;
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
     2
using System.Collections.Generic;
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
     3
using System.Linq;
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
     4
using System.Text;
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
     5
using System.IO;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
     6
using System.Net;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
     7
using System.Windows;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
     8
using System.Windows.Controls;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
     9
using System.Windows.Data;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    10
using System.Windows.Input;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    11
using System.Windows.Media;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    12
using System.Windows.Media.Animation;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    13
using System.Windows.Navigation;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    14
using System.Windows.Controls.Primitives;
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    15
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    16
using FingersDance.Control.TimeLine;
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    17
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    18
namespace FingersDance.Actions
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    19
{
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    20
    public class ActionStartOrEndAnnotation : FingersDance.Actions.ActionBase
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    21
    {
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    22
        
194
d96cd2bce653 gesture passed as parameter from the menu
cavaliet
parents: 145
diff changeset
    23
        private String _Text = "";
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    24
        private UserControlTimeLine myTimeline;
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    25
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    26
        public ActionStartOrEndAnnotation()
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    27
        {
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    28
            
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    29
        }
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    30
194
d96cd2bce653 gesture passed as parameter from the menu
cavaliet
parents: 145
diff changeset
    31
        public ActionStartOrEndAnnotation(String text)
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    32
        {
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    33
            _Text = text;
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    34
        }
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    35
194
d96cd2bce653 gesture passed as parameter from the menu
cavaliet
parents: 145
diff changeset
    36
        public ActionStartOrEndAnnotation(Object[] param)
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    37
        {
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    38
            // The context param[0] is the userPanel, so we have to get the timeline's instance.
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    39
            UserControl userPanel = (UserControl)param[0];
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    40
            // Its content...
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    41
            Grid o = (Grid)userPanel.Content;
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    42
            // and the UserControlSyncSource within the grid...
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    43
            UserControl syncSrc = (UserControl)((Grid)o.Children[1]).Children[0];
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    44
            // and finally the timeline
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    45
            myTimeline = (UserControlTimeLine)((Grid)((Grid)syncSrc.Content).Children[0]).Children[0];
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 194
diff changeset
    46
194
d96cd2bce653 gesture passed as parameter from the menu
cavaliet
parents: 145
diff changeset
    47
            _Text = (String)param[1];
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    48
        }
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    49
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    50
        public void Execute()
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    51
        {
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    52
            if (myTimeline != null)
194
d96cd2bce653 gesture passed as parameter from the menu
cavaliet
parents: 145
diff changeset
    53
                myTimeline.startOrEndAnnotation(_Text);
145
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    54
        }
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    55
    }
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    56
}
42cf4dbc473b add ActionStartOrEndAnnotation
cavaliet
parents:
diff changeset
    57