/// <summary>
        /// Returns the value of the specified property in the report.
        /// </summary>
        /// <param name="key">Property ID.</param>
        /// <returns>Property value.</returns>
        public object GetValue(PropertyKey key)
        {
            PROPVARIANT variant;

            _locationReport.GetValue(ref key, out variant);
            try
            {
                return(variant.Value);
            }
            finally
            {
                variant.Clear();
            }
        }
        private double GetDoubleProperty(ILocationReport report, PROPERTYKEY propkey)
        {
            double val = double.NaN;

            PROPVARIANT pv = new PROPVARIANT();

            using (pv)
            {
                if (0 == report.GetValue(ref propkey, pv))
                {
                    if (pv.vt == VarEnum.VT_R8)
                    {
                        val = (double)pv.GetValue();
                    }
                }
            }

            return(val);
        }
        private string GetStringProperty(ILocationReport report, PROPERTYKEY propkey)
        {
            string val = String.Empty;

            PROPVARIANT pv = new PROPVARIANT();

            using (pv)
            {
                int hr = report.GetValue(ref propkey, pv);
                if (0 == hr)
                {
                    if (pv.vt == VarEnum.VT_LPWSTR)
                    {
                        val = (string)pv.GetValue();
                    }
                }
            }

            return(val);
        }