Inheritance: Windows.UI.Xaml.Controls.Page
コード例 #1
0
        private async void GotoScriptDetail(object sender, ItemClickEventArgs e)
        {
            GrantProcess GProc = ( GrantProcess )e.ClickedItem;

            if (GProc.GrantDef.SourceRemoved || GProc.IsLoading)
            {
                return;
            }

            GProc.IsLoading = true;
            string AccessToken = ( string )TokMgr.GetAuthById(GProc.ScriptId)?.Value;

            SHSearchLoader SHLoader = new SHSearchLoader(
                "uuid: " + GProc.ScriptId
                , AccessToken == null ? null : new string[] { AccessToken }
                );

            IList <HubScriptItem> HSIs = await SHLoader.NextPage();

            HubScriptItem HSI = HSIs.FirstOrDefault();

            if (HSI != null)
            {
                ControlFrame.Instance.NavigateTo(PageId.SCRIPT_DETAILS, () => {
                    ScriptDetails SDetails = new ScriptDetails(HSI);
                    SDetails.OpenRequest(GProc.Target);
                    return(SDetails);
                });
            }
        }
コード例 #2
0
        private void TransferRequest( SHTarget Target, HubScriptItem HSI )
        {
            Sharers.ScriptDetails Details = PopupFrame.Content as Sharers.ScriptDetails;

            if ( Details == null )
            {
                Details = new Sharers.ScriptDetails( HSI );
                PopupFrame.Content = Details;
            }

            Details.PlaceRequest( Target, HSI );
        }
コード例 #3
0
        private async void MessageBus_OnDelivery( Message Mesg )
        {
            switch ( Mesg.Content )
            {
                case AppKeys.SH_SCRIPT_DATA:
                    HubScriptItem HSI = ( HubScriptItem ) Mesg.Payload;

                    if ( ( HSI.Scope & SpiderScope.ZONE ) != 0 )
                    {
                        MainHub.ScrollToSection( ZoneListView );
                        PopupFrame.Content = null;
                        await ZoneListContext.OpenFile( HSI.ScriptFile );
                        break;
                    }

                    if ( await FileListContext.OpenSpider( HSI.ScriptFile ) )
                    {
                        ConfirmScriptParse( HSI );
                    }
                    else
                    {
                        ConfirmErrorReport( HSI.Id, StatusType.HS_INVALID );
                    }
                    break;

                case AppKeys.HS_DECRYPT_FAIL:
                    StringResources stx = new StringResources( "Message", "ContextMenu" );
                    MessageDialog MsgBox = new MessageDialog( stx.Str( "Desc_DecryptionFailed" ), stx.Str( "DecryptionFailed" ) );

                    HSI = ( HubScriptItem ) Mesg.Payload;
                    bool Place = false;

                    MsgBox.Commands.Add( new UICommand( stx.Text( "PlaceRequest", "ContextMenu" ), ( x ) => { Place = true; } ) );
                    MsgBox.Commands.Add( new UICommand( stx.Str( "OK" ) ) );

                    await Popups.ShowDialog( MsgBox );

                    if ( Place ) TransferRequest( SHTarget.KEY, HSI );
                    break;

                case AppKeys.HS_DETAIL_VIEW:
                    PopupFrame.Content = new Sharers.ScriptDetails( ( HubScriptItem ) Mesg.Payload );
                    break;

                case AppKeys.HS_OPEN_COMMENT:
                    InboxMessage BoxMessage = ( InboxMessage ) Mesg.Payload;
                    Sharers.ScriptDetails SSDetails = new Sharers.ScriptDetails( BoxMessage.HubScript );
                    PopupFrame.Content = SSDetails;
                    SSDetails.OpenCommentStack( BoxMessage.CommId );
                    break;

                case AppKeys.SH_SHOW_GRANTS:
                    Sharers.ManageAuth ManageAuth = new Sharers.ManageAuth( SHHub, PopupFrame );
                    PopupFrame.Content = ManageAuth;

                    ManageAuth.GotoRequests();
                    break;

                case AppKeys.SH_SCRIPT_REMOVE:
                    Tuple<string, HubScriptItem> RemoveInst = ( Tuple<string, HubScriptItem> ) Mesg.Payload;
                    if ( await SHHub.Remove( RemoveInst.Item2, RemoveInst.Item1 ) )
                    {
                        PopupFrame.Content = null;
                    }
                    break;

                case AppKeys.HS_NO_VOLDATA:
                    ConfirmErrorReport( ( ( BookInstruction ) Mesg.Payload ).Id, StatusType.HS_NO_VOLDATA );
                    break;

                case AppKeys.HS_MOVED:
                    Tuple<string, SpiderBook> Payload = ( Tuple<string, SpiderBook> ) Mesg.Payload;

                    LocalBook OBook = FileListContext.GetById( Payload.Item1 );
                    OBook?.RemoveSource();

                    FileListContext.Add( Payload.Item2 );
                    FileListContext.CleanUp();
                    break;
            }
        }