You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2015/04/25 23:58:25 UTC
[2/3] cordova-plugin-splashscreen git commit: CB-8750 [wp8]: Rewrite
resoultion helper
CB-8750 [wp8]: Rewrite resoultion helper
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/00e8999e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/00e8999e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/00e8999e
Branch: refs/heads/master
Commit: 00e8999eeb03291baef71b5e1b1ce380e12f0449
Parents: 9549ce3
Author: sgrebnov <v-...@microsoft.com>
Authored: Sat Apr 25 14:56:39 2015 -0700
Committer: sgrebnov <v-...@microsoft.com>
Committed: Sat Apr 25 14:56:39 2015 -0700
----------------------------------------------------------------------
src/wp/ResolutionHelper.cs | 39 +++++++++------------------------------
1 file changed, 9 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/00e8999e/src/wp/ResolutionHelper.cs
----------------------------------------------------------------------
diff --git a/src/wp/ResolutionHelper.cs b/src/wp/ResolutionHelper.cs
index 4d7996c..050c392 100644
--- a/src/wp/ResolutionHelper.cs
+++ b/src/wp/ResolutionHelper.cs
@@ -21,39 +21,18 @@ namespace WPCordovaClassLib.Cordova.Commands
public enum Resolutions { WVGA, WXGA, HD };
public static class ResolutionHelper
- {
- private static bool IsWvga
+ {
+ public static Resolutions CurrentResolution
{
get
{
- return Application.Current.Host.Content.ScaleFactor == 100;
- }
- }
-
- private static bool IsWxga
- {
- get
- {
- return Application.Current.Host.Content.ScaleFactor == 160;
- }
- }
-
- private static bool IsHD
- {
- get
- {
- return Application.Current.Host.Content.ScaleFactor == 150;
- }
- }
-
- public static Resolutions CurrentResolution
- {
- get
- {
- if (IsWvga) return Resolutions.WVGA;
- else if (IsWxga) return Resolutions.WXGA;
- else if (IsHD) return Resolutions.HD;
- else throw new InvalidOperationException("Unknown resolution");
+ switch (Application.Current.Host.Content.ScaleFactor)
+ {
+ case 100: return Resolutions.WVGA;
+ case 160: return Resolutions.WXGA;
+ case 150: return Resolutions.HD;
+ }
+ throw new InvalidOperationException("Unknown resolution");
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org