Ejemplo n.º 1
0
        async Task UpdateUsageMetrics(PropertyInfo propertyInfo)
        {
            var data = await service.ReadLocalData();

            var usage = await GetCurrentReport(data);

            var value = (int)propertyInfo.GetValue(usage.Measures);

            propertyInfo.SetValue(usage.Measures, value + 1);

            await service.WriteLocalData(data);
        }
Ejemplo n.º 2
0
        public async Task IncrementCounter(Expression <Func <UsageModel.MeasuresModel, int> > counter)
        {
            await Initialize();

            var data = await service.ReadLocalData();

            var usage = await GetCurrentReport(data);

            var property     = (MemberExpression)counter.Body;
            var propertyInfo = (PropertyInfo)property.Member;

            log.Verbose("Increment counter {Name}", propertyInfo.Name);
            var value = (int)propertyInfo.GetValue(usage.Measures);

            propertyInfo.SetValue(usage.Measures, value + 1);
            await service.WriteLocalData(data);
        }
Ejemplo n.º 3
0
        async Task <UsageData> LoadUsage()
        {
            await Initialize();

            var result = await service.ReadLocalData();

            result.Model.Lang       = CultureInfo.InstalledUICulture.IetfLanguageTag;
            result.Model.AppVersion = AssemblyVersionInformation.Version;
            result.Model.VSVersion  = vsservices.VSVersion;
            return(result);
        }
Ejemplo n.º 4
0
        async Task <UsageData> LoadUsage()
        {
            await Initialize();

            var usage = await service.ReadLocalData();

            var model = usage.Model;

            model.Lang       = CultureInfo.InstalledUICulture.IetfLanguageTag;
            model.AppVersion = AssemblyVersionInformation.Version;
            model.VSVersion  = vsservices.VSVersion;
            usage.Model      = model;
            return(usage);
        }