Clone() public method

public Clone ( bool includeWeekly, bool includeMonthly ) : UsageModel
includeWeekly bool
includeMonthly bool
return UsageModel
コード例 #1
0
ファイル: UsageTracker.cs プロジェクト: github/VisualStudio
        async Task SendUsage(UsageModel usage, bool weekly, bool monthly)
        {
            Debug.Assert(client != null, "SendUsage should not be called when there is no IMetricsService");

            if (connectionManager.Connections.Any(x => x.HostAddress.IsGitHubDotCom()))
            {
                usage.IsGitHubUser = true;
            }

            if (connectionManager.Connections.Any(x => !x.HostAddress.IsGitHubDotCom()))
            {
                usage.IsEnterpriseUser = true;
            }

            var model = usage.Clone(weekly, monthly);
            await client.PostUsage(model);
        }