-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Change SystemInformation from static to regular class #3168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michael-hawker
merged 4 commits into
CommunityToolkit:dev/7.0.0
from
vgromfeld:u/vgromfeld/binSizeReduction
Mar 20, 2020
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 21 additions & 21 deletions
42
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SystemInformation/SystemInformationCode.bind
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
// To get application's name: | ||
public string ApplicationName => SystemInformation.ApplicationName; | ||
public string ApplicationName => SystemInformation.Instance.ApplicationName; | ||
|
||
// To get application's version: | ||
public string ApplicationVersion => $"{SystemInformation.ApplicationVersion.Major}.{SystemInformation.ApplicationVersion.Minor}.{SystemInformation.ApplicationVersion.Build}.{SystemInformation.ApplicationVersion.Revision}"; | ||
public string ApplicationVersion => $"{SystemInformation.Instance.ApplicationVersion.Major}.{SystemInformation.Instance.ApplicationVersion.Minor}.{SystemInformation.Instance.ApplicationVersion.Build}.{SystemInformation.Instance.ApplicationVersion.Revision}"; | ||
|
||
// To get the most preferred language by the user: | ||
public CultureInfo Culture => SystemInformation.Culture; | ||
public CultureInfo Culture => SystemInformation.Instance.Culture; | ||
|
||
// To get operating syste, | ||
public string OperatingSystem => SystemInformation.OperatingSystem; | ||
// To get operating system | ||
public string OperatingSystem => SystemInformation.Instance.OperatingSystem; | ||
|
||
// To get used processor architecture | ||
public ProcessorArchitecture OperatingSystemArchitecture => SystemInformation.OperatingSystemArchitecture; | ||
public ProcessorArchitecture OperatingSystemArchitecture => SystemInformation.Instance.OperatingSystemArchitecture; | ||
|
||
// To get operating system version | ||
public OSVersion OperatingSystemVersion => SystemInformation.OperatingSystemVersion; | ||
public OSVersion OperatingSystemVersion => SystemInformation.Instance.OperatingSystemVersion; | ||
|
||
// To get device family | ||
public string DeviceFamily => SystemInformation.DeviceFamily; | ||
public string DeviceFamily => SystemInformation.Instance.DeviceFamily; | ||
|
||
// To get device model | ||
public string DeviceModel => SystemInformation.DeviceModel; | ||
public string DeviceModel => SystemInformation.Instance.DeviceModel; | ||
|
||
// To get device manufacturer | ||
public string DeviceManufacturer => SystemInformation.DeviceManufacturer; | ||
public string DeviceManufacturer => SystemInformation.Instance.DeviceManufacturer; | ||
|
||
// To get available memory in MB | ||
public float AvailableMemory => SystemInformation.AvailableMemory; | ||
public float AvailableMemory => SystemInformation.Instance.AvailableMemory; | ||
|
||
// To get if the app is being used for the first time since it was installed. | ||
public bool IsFirstUse => SystemInformation.IsFirstRun; | ||
public bool IsFirstUse => SystemInformation.Instance.IsFirstRun; | ||
|
||
// To get if the app is being used for the first time since being upgraded from an older version. | ||
public bool IsAppUpdated => SystemInformation.IsAppUpdated; | ||
public bool IsAppUpdated => SystemInformation.Instance.IsAppUpdated; | ||
|
||
// To get the first version installed | ||
public PackageVersion FirstVersionInstalled => SystemInformation.FirstVersionInstalled; | ||
public PackageVersion FirstVersionInstalled => SystemInformation.Instance.FirstVersionInstalled; | ||
|
||
// To get the first time the app was launched | ||
public DateTime FirstUseTime => SystemInformation.FirstUseTime; | ||
public DateTime FirstUseTime => SystemInformation.Instance.FirstUseTime; | ||
|
||
// To get the time the app was launched. | ||
public DateTime LaunchTime => SystemInformation.LaunchTime; | ||
public DateTime LaunchTime => SystemInformation.Instance.LaunchTime; | ||
|
||
// To get the time the app was previously launched, not including this instance. | ||
public DateTime LastLaunchTime => SystemInformation.LastLaunchTime; | ||
public DateTime LastLaunchTime => SystemInformation.Instance.LastLaunchTime; | ||
|
||
// To get the time the launch count was reset, not including this instance | ||
public string LastResetTime => SystemInformation.LastResetTime.ToString(Culture.DateTimeFormat); | ||
public string LastResetTime => SystemInformation.Instance.LastResetTime.ToString(Culture.DateTimeFormat); | ||
|
||
// To get the number of times the app has been launched sicne the last reset. | ||
public long LaunchCount => SystemInformation.LaunchCount; | ||
public long LaunchCount => SystemInformation.Instance.LaunchCount; | ||
|
||
// To get the number of times the app has been launched. | ||
public long TotalLaunchCount => SystemInformation.TotalLaunchCount; | ||
public long TotalLaunchCount => SystemInformation.Instance.TotalLaunchCount; | ||
|
||
// To get how long the app has been running | ||
public TimeSpan AppUptime => SystemInformation.AppUptime; | ||
public TimeSpan AppUptime => SystemInformation.Instance.AppUptime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.