コード例 #1
0
        /*
         * // TODO call a setMedia method from CardMediaCarouselPage!!!!
         * public void initialize(CardMediaCarouselPage cardMediaCarouselPage)
         * {
         *  this.cardMediaCarouselPage = cardMediaCarouselPage;
         * }
         */

        protected override async Task handleImageTapped(MediaContentType mediaType)
        {
            AbMediaContent otherMedia = await MediaCaptureUtilities.takeMedia(mediaType, base.card, base.parentPage);

            if (otherMedia != null)
            {
                LinkManager linkManager;

                if (card != null)
                {
                    linkManager = card.linkManager;
                }
                else
                {
                    linkManager = MediaManager.mediaLinkManager;
                }

                linkManager.addLink(this.rootMedia, otherMedia);

                if (card != null)
                {
                    card.saveToFile();
                }
                else
                {
                    MediaManager.saveMediaLinkManager();
                }
            }
        }
コード例 #2
0
        private async void takeNoteButton_Clicked(object sender, EventArgs e)
        {
            if (cardProvider != null)
            {
                this.card = await cardProvider.getCardAsync();
            }

            await MediaCaptureUtilities.takeNote(card, parentPage);
        }
コード例 #3
0
        private async void takePictureButton_Clicked(object sender, EventArgs e)
        {
            //mediaCapturePreClick?.Invoke();
            if (cardProvider != null)
            {
                this.card = await cardProvider.getCardAsync();
            }

            await MediaCaptureUtilities.takePicture(card, parentPage);
        }
コード例 #4
0
        private async void camera_Tapped(object sender, EventArgs e)
        {
            AbMediaContent image = await MediaCaptureUtilities.takePicture(parentCard, parentPage);

            if (image != null)
            {
                this.imageFilePath  = image.filePath;
                contactImage.Source = ImageSource.FromFile(imageFilePath);
            }
        }
コード例 #5
0
        public async void addClicked()
        {
            switch (curMediaType)
            {
            case MediaContentType.Note:
                await MediaCaptureUtilities.takeNote(this.card, this.parentPage);

                break;

            case MediaContentType.Audio:
                await MediaCaptureUtilities.takeAudio(this.card, this.parentPage);

                break;

            default:     //audio or note not supported
                break;
            }
        }
コード例 #6
0
        public async void addClicked()
        {
            MediaContentType mediaType;

            if (Enum.TryParse <MediaContentType>(this.title, out mediaType))
            {
                switch (mediaType)
                {
                case MediaContentType.Image:
                    await MediaCaptureUtilities.takePicture(this.card, this.parentPage);

                    break;

                case MediaContentType.Video:
                    await MediaCaptureUtilities.takeVideo(this.card, this.parentPage);

                    break;

                default:     //audio or note not supported
                    break;
                }
            }
        }
コード例 #7
0
 protected virtual async Task handleImageTapped(MediaContentType mediaType)
 {
     await MediaCaptureUtilities.takeMedia(mediaType, card, parentPage);
 }