示例#1
0
        public ExamplesRoute(INotificationService notificationService)
        {
            RouteConfig.Title   = "Examples";
            RouteConfig.Icon    = PackIconKind.ViewList;
            currentModelRefresh = RefreshSource().WithProperties(nameof(CurrentModel));

            RouteConfig.RouteCommands.Add(Command("Validate model", PackIconKind.CheckAll,
                                                  () =>
            {
                var isValid = ModelState.Validate(CurrentModel.Object);
                notificationService.Notify($"Is valid: {isValid}");
            }));

            RouteConfig.RouteCommands.Add(Command("Is valid?", PackIconKind.Help,
                                                  () =>
            {
                var isValid = ModelState.IsValid(CurrentModel.Object);
                notificationService.Notify($"Is valid: {isValid}");
            }));

            RouteConfig.RouteCommands.Add(Command("Reset model", PackIconKind.Undo,
                                                  () => ModelState.Reset(CurrentModel.Object)));
            RouteConfig.RouteCommands.Add(Command("View source", PackIconKind.CodeBraces,
                                                  ViewSource, CanViewSource, currentModelRefresh));
            this.notificationService = notificationService;
        }
        private void DrawExtraFeatures()
        {
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Edit...", EditorStyles.miniButton, GUILayout.Width(80)))
            {
                OpenDialogueEditorWindow();
            }
            GUILayout.FlexibleSpace();
            EditorGUI.BeginDisabledGroup(refreshSource == RefreshSource.None);
            var clickedReconvert = GUILayout.Button("Reconvert...", EditorStyles.miniButton, GUILayout.Width(80));

            EditorGUI.EndDisabledGroup();
            refreshSource = (RefreshSource)EditorGUILayout.EnumPopup(refreshSource, GUILayout.Width(100));
            EditorGUILayout.EndHorizontal();
            EditorWindowTools.DrawHorizontalLine();
            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
            if (clickedReconvert)
            {
                ReconvertDatabase();
                EditorUtility.SetDirty(target);
            }
        }
示例#3
0
        private void OnElementMoved(TimelineElement timelineElement, RefreshSource refreshSource)
        {
            EventHandler <TimelineElementEventArgs> elementMovedHandler = this.ElementMoved;

            if (elementMovedHandler != null)
            {
                elementMovedHandler(this, new TimelineElementEventArgs(timelineElement, refreshSource));
            }
        }
 private void DrawExtraFeatures()
 {
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button("Edit...", EditorStyles.miniButton, GUILayout.Width(80))) OpenDialogueEditorWindow();
     GUILayout.FlexibleSpace();
     EditorGUI.BeginDisabledGroup(refreshSource == RefreshSource.None);
     if (GUILayout.Button("Reconvert...", EditorStyles.miniButton, GUILayout.Width(80))) ReconvertDatabase();
     EditorGUI.EndDisabledGroup();
     refreshSource = (RefreshSource) EditorGUILayout.EnumPopup(refreshSource, GUILayout.Width(100));
     EditorGUILayout.EndHorizontal();
     EditorWindowTools.DrawHorizontalLine();
 }
 public void Refresh(double currentWidth, RefreshSource refreshSource)
 {
     //if (firstCall || refreshSource == RefreshSource.Drag || refreshSource == RefreshSource.Zoom)
     //{
     //    this.initialWidth = currentWidth;
     //    firstCall = false;
     //}
     this.DownloadProgressBar.Refresh();
     this.UpdateFilmstrip(currentWidth);
     this.Element.UpdateTelemetry();
     //this.TelemetryView.Width = initialWidth;
 }
        public void RefreshPreview(RefreshSource refreshSource)
        {
            VideoPreview videoPreview = this.previewControl as VideoPreview;
            AudioPreview audioPreview = this.previewControl as AudioPreview;

            if (videoPreview != null)
            {
                double currentWidth = this.MainCanvas.ActualWidth <= 0
                                          ? this.MainCanvas.Width
                                          : this.MainCanvas.ActualWidth;

                videoPreview.Refresh(currentWidth, refreshSource);
            }

            if (audioPreview != null)
            {
                audioPreview.Refresh();
            }
        }
示例#7
0
        public void MoveElement(TimelineElement element, Track layer, TimeCode newPosition, RefreshSource refreshSource)
        {
            element.Position = newPosition;

            layer.Shots.Sort(CompareElements);

            this.OnElementMoved(element, refreshSource);
        }
示例#8
0
 public void RefreshElement(TimelineElement element, RefreshSource refreshSource)
 {
 }
示例#9
0
 public void MoveElement(TimelineElement element, Track layer, TimeCode newPosition, RefreshSource refreshSource)
 {
     throw new NotImplementedException();
 }
        public void Refresh(RefreshSource refreshSource)
        {
            var width = this.Model.Duration.TotalSeconds * this.viewScale;
            var left  = this.Model.Position.TotalSeconds * this.viewScale;

            if (refreshSource == RefreshSource.LeftTrim && width < this.MainCanvas.Width)
            {
                this.DragBorder.Margin = new Thickness(this.MainCanvas.Width - width, 0, 0, 0);
            }
            else if (refreshSource == RefreshSource.RightTrim && width < this.MainCanvas.Width)
            {
                this.DragBorder.Margin = new Thickness(width, 0, 0, 0);
            }

            if ((refreshSource != RefreshSource.LeftTrim && refreshSource != RefreshSource.RightTrim) || (width >= this.MainCanvas.Width))
            {
                this.DragBorder.Margin = new Thickness(width, 0, 0, 0);
                this.MainCanvas.Width  = width;
                Canvas.SetLeft(this, left);
            }

            // handlers
            if (!(this.Model.Asset is ImageAsset) && !(this.Model.Asset is TitleAsset))
            {
                this.LeftSliderIconEnabled.Visibility = this.areTimelineHandlersEnabled && this.Model.InPosition.TotalSeconds > 0
                                                            ? Visibility.Visible
                                                            : Visibility.Collapsed;
                this.LeftSliderIconDisabled.Visibility = !this.areTimelineHandlersEnabled || this.Model.InPosition.TotalSeconds == 0
                                                             ? Visibility.Visible
                                                             : Visibility.Collapsed;
            }

            var videoAsset = this.Model.Asset as VideoAsset;
            var audioAsset = this.Model.Asset as AudioAsset;

            double totalDuration;

            if (videoAsset != null)
            {
                totalDuration = videoAsset.Duration.TotalSeconds;
            }
            else if (audioAsset != null)
            {
                totalDuration = audioAsset.Duration;
            }
            else
            {
                totalDuration = -1;
            }

            if (!(this.Model.Asset is ImageAsset))
            {
                this.RightSliderIconEnabled.Visibility = this.areTimelineHandlersEnabled && this.Model.OutPosition.TotalSeconds != totalDuration
                                                             ? Visibility.Visible
                                                             : Visibility.Collapsed;
                this.RightSliderIconDisabled.Visibility = !this.areTimelineHandlersEnabled || this.Model.OutPosition.TotalSeconds == totalDuration
                                                              ? Visibility.Visible
                                                              : Visibility.Collapsed;
            }

            this.LeftSlider.Cursor  = this.areTimelineHandlersEnabled ? Cursors.SizeWE : Cursors.Hand;
            this.RightSlider.Cursor = this.areTimelineHandlersEnabled ? Cursors.SizeWE : Cursors.Hand;
        }
 public TimelineElementEventArgs(TimelineElement timelineElement, RefreshSource source)
 {
     this.Element       = timelineElement;
     this.RefreshSource = source;
 }