public async Task ProcessComandsAsync(DataPackageView dataview)
        {
            if (DropDataViewAction != null)
            {
                DropDataViewAction.Invoke(dataview);
            }

            if (dataview.Contains(StandardDataFormats.ApplicationLink) && DropApplicationLinkAction != null)
            {
                Uri uri = await dataview.GetApplicationLinkAsync();

                DropApplicationLinkAction.Invoke(uri);
            }

            if (dataview.Contains(StandardDataFormats.Bitmap) && DropBitmapAction != null)
            {
                RandomAccessStreamReference stream = await dataview.GetBitmapAsync();

                DropBitmapAction.Invoke(stream);
            }

            if (dataview.Contains(StandardDataFormats.Html) && DropHtmlAction != null)
            {
                string html = await dataview.GetHtmlFormatAsync();

                DropHtmlAction.Invoke(html);
            }

            if (dataview.Contains(StandardDataFormats.Rtf) && DropRtfAction != null)
            {
                string rtf = await dataview.GetRtfAsync();

                DropRtfAction.Invoke(rtf);
            }

            if (dataview.Contains(StandardDataFormats.StorageItems) && DropStorageItemsAction != null)
            {
                IReadOnlyList <IStorageItem> storageItems = await dataview.GetStorageItemsAsync();

                DropStorageItemsAction.Invoke(storageItems);
            }

            if (dataview.Contains(StandardDataFormats.Text) && DropTextAction != null)
            {
                string text = await dataview.GetTextAsync();

                DropTextAction.Invoke(text);
            }

            if (dataview.Contains(StandardDataFormats.WebLink) && DropWebLinkAction != null)
            {
                Uri uri = await dataview.GetWebLinkAsync();

                DropWebLinkAction.Invoke(uri);
            }
        }
示例#2
0
        public async Task ProcessComandsAsync(DataPackageView dataview)
        {
            if (DropDataViewAction != null)
            {
                DropDataViewAction.Invoke(dataview);
            }

            if (dataview.Contains(StandardDataFormats.ApplicationLink) && DropApplicationLinkAction != null)
            {
                var uri = await dataview.GetApplicationLinkAsync();

                DropApplicationLinkAction.Invoke(uri);
            }

            if (dataview.Contains(StandardDataFormats.Bitmap) && DropBitmapAction != null)
            {
                var stream = await dataview.GetBitmapAsync();

                DropBitmapAction.Invoke(stream);
            }

            if (dataview.Contains(StandardDataFormats.Html) && DropHtmlAction != null)
            {
                var html = await dataview.GetHtmlFormatAsync();

                DropHtmlAction.Invoke(html);
            }

            if (dataview.Contains(StandardDataFormats.Rtf) && DropRtfAction != null)
            {
                var rtf = await dataview.GetRtfAsync();

                DropRtfAction.Invoke(rtf);
            }

            if (dataview.Contains(StandardDataFormats.StorageItems) && DropStorageItemsAction != null)
            {
                var storageItems = await dataview.GetStorageItemsAsync();

                DropStorageItemsAction.Invoke(storageItems);
            }

            if (dataview.Contains(StandardDataFormats.Text) && DropTextAction != null)
            {
                var text = await dataview.GetTextAsync();

                DropTextAction.Invoke(text);
            }

            if (dataview.Contains(StandardDataFormats.WebLink) && DropWebLinkAction != null)
            {
                var uri = await dataview.GetWebLinkAsync();

                DropWebLinkAction.Invoke(uri);
            }
        }