示例#1
0
        public async void Initialize()
        {
            while (DescriptionBrowser == null)
            {
                Thread.Sleep(1);
            }
            await DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => {
                DescriptionBrowser.NavigateToString(Content.Description);
                Handler.LoadMovie();
            }));

            LiveCommentInstance = new NicoNicoLiveComment(Content.GetPlayerStatus.MesseageServerUrl, Content.GetPlayerStatus.MesseageServerPort, this);

            Time = new VideoTime();


            Time.VideoTimeString = NicoNicoUtil.GetTimeFromVpos(Content.GetPlayerStatus, (int.Parse(Content.GetPlayerStatus.EndTime) - int.Parse(Content.GetPlayerStatus.BaseTime)) * 100);
            Time.Length          = int.Parse(Content.GetPlayerStatus.EndTime) - int.Parse(Content.GetPlayerStatus.BaseTime);
            Time.BufferedTime    = Time.Length;

            Comment = new LiveCommentViewModel(this);


            OpenVideo();

            //タイムシフトじゃなかったらすぐに再生
            if (!Content.GetPlayerStatus.Archive)
            {
                foreach (var content in Content.GetPlayerStatus.ContentsList)
                {
                    Handler.InvokeScript("AsCommandExcute", "/liveplay", "0", content.Content);
                }
            }
        }
示例#2
0
        // Render the given course id (0 = all controls) and kind to a map, and compare it to the saved version.
        internal void CheckRenderMapStandardChange(string filename, Id <Course> id, DescriptionKind kind, string newDescStandard)
        {
            SymbolDB   symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml"));
            UndoMgr    undomgr  = new UndoMgr(5);
            EventDB    eventDB  = new EventDB(undomgr);
            CourseView courseView;

            eventDB.Load(filename);
            symbolDB.Standard = eventDB.GetEvent().descriptionStandard;
            eventDB.Validate();

            courseView = CourseView.CreateViewingCourseView(eventDB, DesignatorFromCourseId(eventDB, id));

            DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting);

            DescriptionLine[] description = descFormatter.CreateDescription(kind == DescriptionKind.Symbols);

            Bitmap bmNew = RenderToMapThenToBitmap(symbolDB, description, kind, 1);

            TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "_std_default", kind));

            undomgr.BeginCommand(71231, "change standard");
            symbolDB.Standard = newDescStandard;
            ChangeEvent.UpdateDescriptionToMatchStandard(eventDB, symbolDB);
            undomgr.EndCommand(71231);
            description = descFormatter.CreateDescription(kind == DescriptionKind.Symbols);

            bmNew = RenderToMapThenToBitmap(symbolDB, description, kind, 1);
            TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "_std_" + newDescStandard, kind));
        }
示例#3
0
        // Render the given course id (0 = all controls) and kind to a bitmap, and compare it to the saved version.
        internal void CheckRenderBitmap(string filename, Id <Course> id, DescriptionKind kind, int numColumns = 1)
        {
            SymbolDB   symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml"));
            UndoMgr    undomgr  = new UndoMgr(5);
            EventDB    eventDB  = new EventDB(undomgr);
            CourseView courseView;

            eventDB.Load(filename);
            eventDB.Validate();

            courseView = CourseView.CreateViewingCourseView(eventDB, DesignatorFromCourseId(eventDB, id));

            DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting);

            DescriptionLine[] description = descFormatter.CreateDescription(kind == DescriptionKind.Symbols);

            Bitmap bmNew = DescriptionBrowser.RenderToBitmap(symbolDB, description, kind, numColumns);

            if (numColumns > 1)
            {
                TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "_" + numColumns + "col", kind));
            }
            else
            {
                TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "", kind));
            }
        }
示例#4
0
        // Render the given course id (0 = all controls) and kind to a bitmap, and compare it to the saved version.
        internal void CheckRenderBitmapPixelAtATime(Id <Course> id, DescriptionKind kind)
        {
            SymbolDB   symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml"));
            UndoMgr    undomgr  = new UndoMgr(5);
            EventDB    eventDB  = new EventDB(undomgr);
            CourseView courseView;

            eventDB.Load(TestUtil.GetTestFile("descriptions\\sampleevent1.coursescribe"));
            eventDB.Validate();

            courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(id));

            DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting);

            DescriptionLine[] description = descFormatter.CreateDescription(false);

            Bitmap bmNew = RenderToBitmapPixelAtATime(symbolDB, description, kind);

            TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "", kind));
        }
 private void DescriptionBrowser_Loaded(object sender, RoutedEventArgs e)
 {
     DescriptionBrowser.NavigateToString(App.ViewModel.SelectedFeedItem.Description);
 }