private void OnTriggerExit(Collider collision)
 {
     if (collision.gameObject.tag == "BowlingPin")
     {
         pinManager.RemovePin(collision.gameObject);
     }
     if (collision.gameObject.tag == "BowlingBall")
     {
         collision.gameObject.SetActive(false);
     }
     if (collision.gameObject.tag == "MainCamera")
     {
         collision.gameObject.GetComponent <CameraFollowing>().SetFollow(false);
     }
 }
Exemple #2
0
 private async void RemovePin(object sender, RoutedEventArgs e)
 {
     if (AppSettings.DeviceId == SelectedRecord.DevId)
     {
         PM.RemovePin(SelectedRecord.Id);
         UpdatePinData();
     }
     else
     {
         StringResources stx = StringResources.Load("Message");
         await Popups.ShowDialog(UIAliases.CreateDialog(
                                     stx.Str("PinMgr_NoRemoteAction")
                                     ));
     }
 }
Exemple #3
0
        private async void CheckTiles()
        {
            PinErrored = false;
            PinManager PM = new PinManager();

            await PM.SyncSettings();

            if (PM.Policy == PinPolicy.DO_NOTHING)
            {
                return;
            }

            ActiveItem[] MissingPins = PM.GetLocalPins().Where(
                x => !Windows.UI.StartScreen.SecondaryTile.Exists(x.Payload)
                ).ToArray();

            if (0 < MissingPins.Length)
            {
                switch (PM.Policy)
                {
                case PinPolicy.ASK:
                    bool            RemoveRecord = true;
                    StringResources stx          = StringResources.Load("Message", "AppBar", "ContextMenu");
                    await Popups.ShowDialog(UIAliases.CreateDialog(
                                                string.Format(stx.Str("MissingPins"), MissingPins.Length)
                                                , () => RemoveRecord = false
                                                , stx.Text("PinToStart", "ContextMenu"), stx.Text("PinPolicy_RemoveMissing", "AppBar")
                                                ));

                    if (RemoveRecord)
                    {
                        goto case PinPolicy.REMOVE_MISSING;
                    }
                    goto case PinPolicy.PIN_MISSING;

                case PinPolicy.PIN_MISSING:
                    foreach (ActiveItem Item in MissingPins)
                    {
                        BookItem Book = await ItemProcessor.GetBookFromId(Item.Desc);

                        if (Book == null)
                        {
                            PinError();
                        }
                        else
                        {
                            TaskCompletionSource <string> TileId = new TaskCompletionSource <string>();

                            BookLoader Loader = new BookLoader(async(b) =>
                            {
                                TileId.SetResult(b == null ? null : await PageProcessor.PinToStart(b));
                            });

                            Loader.Load(Book, true);
                            await TileId.Task;
                        }
                    }
                    break;

                case PinPolicy.REMOVE_MISSING:
                    PM.RemovePin(MissingPins.Remap(x => x.Desc));
                    break;
                }
            }
        }