Esempio n. 1
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            MaintenanceListViewController2 destinationVc = StoryboardHelper.GetViewController <MaintenanceListViewController2>("Main", "MaintenanceListViewController");
            UITableViewCell cellSelected = tableView.CellAt(indexPath);

            if (cellSelected.Equals(RequestedTableViewCell))
            {
                destinationVc.SetMaintenanceStatus(Enums.MaintenanceStatus.Requested);
            }
            else if (cellSelected.Equals(IncompleteTableViewCell))
            {
                destinationVc.SetMaintenanceStatus(Enums.MaintenanceStatus.Incomplete);
            }
            else if (cellSelected.Equals(CompletedTableViewCell))
            {
                destinationVc.SetMaintenanceStatus(Enums.MaintenanceStatus.Complete);
            }
            else if (cellSelected.Equals(CreateMaintenanceTableViewCell))
            {
                return;
            }
            else
            {
                return;
            }

            NavigationController.PushViewController(destinationVc, true);
        }
Esempio n. 2
0
        public static async Task SlideDownAndFadeIn(this FrameworkElement element, float seconds, double offset, Thickness margin)
        {
            var sb = new Storyboard();

            StoryboardHelper.SlideToBottom(sb, 1, offset, margin);
            StoryboardHelper.FadeIn(sb, 1);
            sb.Begin(element);
            await Task.Delay((int)seconds * 1000);
        }
Esempio n. 3
0
        protected async override Task OnAfterRenderAsync(bool isFirstRender)
        {
            await JSRuntime.InvokeVoidAsync("doUserSelectDir");

            var queryString = QueryHelpers.ParseQuery(new Uri(NavigationManager.Uri).Query);

            ResourceReader = await BeatmapHelper.LoadNetworkResources(94790);

            /*
             * if (queryString.TryGetValue("sid", out var beatmapSetId))
             *  ResourceReader = await BeatmapHelper.LoadNetworkResources(int.Parse(beatmapSetId.ToString()));
             * else
             *  //尝试发起本地上传文件请求
             *  ResourceReader = await BeatmapHelper.LoadLocalResources();
             *
             * if (ResourceReader is null)
             * {
             *  //错误处理
             *  return;
             * }
             */

            Console.WriteLine("Start to select a .osb file and a .osu file (if it exist.)");
            var osbFilePath = ResourceReader.EnumeratePath("*.osb").FirstOrDefault();
            var osuFilePath = ResourceReader.EnumeratePath("*.osu").FirstOrDefault();

            Console.WriteLine("osu file : " + osuFilePath);
            Console.WriteLine("osb file : " + osbFilePath);

            var updater = StoryboardHelper.ParseStoryboard(ResourceReader.ReadFile(osuFilePath), ResourceReader.ReadFile(osbFilePath));

            Console.WriteLine($"Storyboard objects count : {updater.StoryboardObjectList.Count}");

            Console.WriteLine($"Start load render resource...");
            await StoryboardWindow.PrepareRenderResource(updater, ResourceReader);

            Console.WriteLine($"Render resource loading DONE!");

            StoryboardWindow.Play();

            Console.WriteLine($"OnAfterRenderAsync() end");
        }
        static async Task Main(string[] args)
        {
            var bufferSize = 123456;
            var buffer     = ArrayPool <byte> .Shared.Rent(bufferSize);

            var memory = buffer.AsMemory().Slice(0, bufferSize);

            MemoryMarshal.TryGetArray <byte>(memory, out var segment);

            var reader = await BeatmapHelper.LoadNetworkResources(94790);

            Console.WriteLine("Start to select a .osb file and a .osu file (if it exist.)");
            var osbFilePath = reader.EnumeratePath("*.osb").FirstOrDefault();
            var osuFilePath = reader.EnumeratePath("*.osu").FirstOrDefault();


            var updater = StoryboardHelper.ParseStoryboard(reader.ReadFile(osbFilePath), reader.ReadFile(osuFilePath));

            Console.WriteLine(updater.StoryboardObjectList.Count);
        }
        public override void OnApplyTemplate()
        {
            OnApplyTemplate();

            //Assign Controls
            _newItem          = (ContentPresenter)GetTemplateChild("PART_NewItem");
            _oldItem          = (ContentPresenter)GetTemplateChild("PART_OldItem");
            _contentPresenter = (UIElement)GetTemplateChild("PART_ContentPresenter");
            this._Transitions = (Panel)base.GetTemplateChild("PART_Transitions");

            //Assign Storyboard
            var previousStoryboard = (Storyboard)base.Template.Resources["RP_TransitionPreviousStoryboard"];
            var nextStoryboard     = (Storyboard)base.Template.Resources["RP_TransitionNextStoryboard"];


            if (previousStoryboard != null)
            {
                this._transitionPreviousStoryboard = StoryboardHelper.CloneStoryboard(previousStoryboard);

                //Delegate Completed Event
                if (this._transitionPreviousStoryboard != null)
                {
                    this._transitionPreviousStoryboard.Completed += new EventHandler(this.OnPreviousStoryboardCompleted);
                }
            }

            if (nextStoryboard != null)
            {
                this._transitionNextStoryboard = StoryboardHelper.CloneStoryboard(nextStoryboard);

                if (this._transitionNextStoryboard != null)
                {
                    this._transitionNextStoryboard.Completed += new EventHandler(this.OnNextStoryboardCompleted);
                }
            }
        }