Esempio n. 1
0
        /// <summary>
        /// Constructs the DefaultLocationProvider instance.
        /// </summary>
        protected DefaultLocationProvider()
        {
            Type t = GetType();

            object[] attrs = t.GetCustomAttributes(typeof(LocationProviderDescriptionAttribute), true);

            if (attrs == null || attrs.Length == 0)
            {
                throw new NotSupportedException(String.Format("Report {0} does not have the LocationReportDescription attribute", t.Name));
            }

            LocationProviderDescriptionAttribute attr = (LocationProviderDescriptionAttribute)attrs[0];

            _reportGuid = attr.ReportTypeGuid;
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs the LocationProvider instance with the specified minimal report interval.
        /// </summary>
        protected LocationProvider(uint minReportInterval)
        {
            Type t = GetType();

            object[] attrs = t.GetCustomAttributes(typeof(LocationProviderDescriptionAttribute), true);

            if (attrs == null || attrs.Length == 0)
            {
                throw new NotSupportedException(String.Format("Report {0} does not have the LocationReportDescription attribute", t.Name));
            }

            LocationProviderDescriptionAttribute attr = (LocationProviderDescriptionAttribute)attrs[0];

            _reportGuid = attr.ReportTypeGuid;

            _location.RegisterForReport(this, ref _reportGuid, minReportInterval);
        }