An object of this type is passed to the DataProviderHandler delegate.
示例#1
0
        private Uri GetUri(string format)
        {
            if (_package._data.ContainsKey(format))
            {
                DataProviderHandler handler = _package._data[format] as DataProviderHandler;

                if (handler != null)
                {
                    DataProviderRequest request = new DataProviderRequest(_package, format);
                    handler.Invoke(request);
                }

                return((Uri)_package._data[format]);
            }

            return(null);
        }
示例#2
0
        /// <summary>
        /// Gets the text in the <see cref="DataPackageView"/> object.
        /// </summary>
        /// <returns></returns>
        public Task <string> GetTextAsync()
        {
            return(Task.Run <string>(() =>
            {
                if (_package._data.ContainsKey(StandardDataFormats.Text))
                {
                    DataProviderHandler handler = _package._data[StandardDataFormats.Text] as DataProviderHandler;

                    if (handler != null)
                    {
                        DataProviderRequest request = new DataProviderRequest(_package, StandardDataFormats.Text);
                        handler.Invoke(request);
                    }

                    return _package._data[StandardDataFormats.Text].ToString();
                }

                return null;
            }));
        }
示例#3
0
        /// <summary>
        /// Gets the data contained in the <see cref="DataPackageView"/>.
        /// </summary>
        /// <param name="formatId">The format of the data.</param>
        /// <returns>The data.</returns>
        public Task<object> GetDataAsync(string formatId)
        {
            return Task.Run<object>(() => 
            {
                if (_package.data.ContainsKey(formatId))
                {
                    DataProviderHandler handler = _package.data[formatId] as DataProviderHandler;

                    if (handler != null)
                    {
                        DataProviderRequest request = new DataProviderRequest(_package, formatId);
                        handler.Invoke(request);
                    }
                    else
                    {
                        return _package.data[formatId];
                    }
                }

                return null;
            });
        }
示例#4
0
        /// <summary>
        /// Gets the data contained in the <see cref="DataPackageView"/>.
        /// </summary>
        /// <param name="formatId">The format of the data.</param>
        /// <returns>The data.</returns>
        public Task <object> GetDataAsync(string formatId)
        {
            return(Task.Run <object>(() =>
            {
                if (_package._data.ContainsKey(formatId))
                {
                    DataProviderHandler handler = _package._data[formatId] as DataProviderHandler;

                    if (handler != null)
                    {
                        DataProviderRequest request = new DataProviderRequest(_package, formatId);
                        handler.Invoke(request);
                    }
                    else
                    {
                        return _package._data[formatId];
                    }
                }

                return null;
            }));
        }
示例#5
0
        /// <summary>
        /// Gets the text in the <see cref="DataPackageView"/> object.
        /// </summary>
        /// <returns></returns>
        public Task<string> GetTextAsync()
        {
            return Task.Run<string>(() =>
            {
                if (_package.data.ContainsKey(StandardDataFormats.Text))
                {
                    DataProviderHandler handler = _package.data[StandardDataFormats.Text] as DataProviderHandler;

                    if (handler != null)
                    {
                        DataProviderRequest request = new DataProviderRequest(_package, StandardDataFormats.Text);
                        handler.Invoke(request);
                    }

                    return _package.data[StandardDataFormats.Text].ToString();
                }

                return null;
            });
        }
示例#6
0
        private Uri GetUri(string format)
        {
            if (_package.data.ContainsKey(format))
            {
                DataProviderHandler handler = _package.data[format] as DataProviderHandler;

                if (handler != null)
                {
                    DataProviderRequest request = new DataProviderRequest(_package, format);
                    handler.Invoke(request);
                }

                return (Uri)_package.data[format];
            }

            return null;
        }