コード例 #1
0
ファイル: TimelineEx.cs プロジェクト: z-saffarpour/duscusys
        ///
        /// <summary>
        /// Once new visual element is created for timeline event we attach
        /// event handlers to it's elements</summary>
        ///
        private new void OnEventCreated(
            FrameworkElement element,
            TimelineDisplayEvent de
            )
        {
            Grid      b;
            Border    bsize;
            Border    bdescr;
            Border    bduration;
            Hyperlink hlink;

            b         = element.FindName("EventTemplateRoot") as Grid;
            bsize     = element.FindName("ResizeButton") as Border;
            bdescr    = element.FindName("EventDescriptionBorder") as Border;
            bduration = element.FindName("DurationChangeBorder") as Border;

            hlink = element.FindName("EditButton") as Hyperlink;

            if (hlink != null)
            {
                hlink.Click += OnEditClick;
                hlink.Tag    = de;
            }

            if (bdescr != null)
            {
                bdescr.MouseLeftButtonDown += CaptureMouse;
                bdescr.MouseLeftButtonUp   += ReleaseMouse;
                bdescr.MouseMove           += OnDescriptionMouseMove;
                bdescr.Tag = element;
            }

            if (bduration != null)
            {
                bduration.MouseLeftButtonDown += CaptureMouse;
                bduration.MouseLeftButtonUp   += ReleaseMouse;
                bduration.MouseMove           += OnBDurationMouseMove;
                bduration.Tag = element;
            }

            if (bsize != null)
            {
                bsize.MouseLeftButtonDown += CaptureMouse;
                bsize.MouseLeftButtonUp   += ReleaseMouse;
                bsize.MouseMove           += OnResizeMouseMove;
                bsize.Tag = b;
            }
        }
コード例 #2
0
        ///
        /// <summary>
        /// This event fires when event is about to be displayed on the screen,
        /// we attach event handlers to stop/play mediaplayer link here</summary>
        ///
        void OnEventCreated(
            FrameworkElement element,
            TimelineDisplayEvent de
            )
        {
            MediaElement    me;
            HyperlinkButton link;

            me   = element.FindName("MediaPlayer") as MediaElement;
            link = element.FindName("StopPlayButton") as HyperlinkButton;

            if (me != null && link != null)
            {
                link.Tag    = me;
                link.Click += new RoutedEventHandler(OnButtonClick);
            }
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: Zzz466/Timeline
        ///
        /// <summary>
        /// This event fires when event is about to be displayed on the screen,
        /// we attach event handlers to stop/play mediaplayer link here</summary>
        ///
        void OnEventCreated(
            FrameworkElement element,
            TimelineDisplayEvent de
            )
        {
            MediaElement me;

            TimelineLibrary.Hyperlink link;

            me   = element.FindName("MediaPlayer") as MediaElement;
            link = element.FindName("StopPlayButton") as TimelineLibrary.Hyperlink;

            if (me != null && link != null)
            {
                link.Tag       = me;
                link.Click    += new RoutedEventHandler(OnButtonClick);
                me.MediaEnded += new RoutedEventHandler(OnMediaEnded);
                me.Tag         = false;
            }
        }