/// </summary>
public static string TAG = "home";
+
+ /// <summary>
+ /// A flag which enables console log writting
+ /// </summary>
+ private static readonly bool IsNeedToShowInConsole = true;
+
public static string Prefix
{
set;
public static void D(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
{
Log.Debug(TAG, Prefix + ", " + message, file, func, line);
+ if (IsNeedToShowInConsole)
+ {
+ Console.WriteLine(String.Format("{0}, {1}:{2},{3}", message, file.Substring(file.LastIndexOf("\\")), line, func));
+ }
}
public static void E(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
{
Log.Error(TAG, Prefix + ", " + message, file, func, line);
+ if (IsNeedToShowInConsole)
+ {
+ Console.WriteLine(String.Format("{0}, {1}:{2},{3}", message, file.Substring(file.LastIndexOf("\\")), line, func));
+ }
}
}
}
\ No newline at end of file
MainWindow.KeyUp += KeyUpListener;
MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName, true);
+ MainWindow.KeyGrab("XF86Info", true);
}
/// <summary>
private void KeyUpListener(object sender, ElmSharp.EvasKeyEventArgs args)
{
DebuggingUtils.Dbg("[TVApps.TizenTV.cs] Key Pressed :" + args.KeyName);
- if (args.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName) == 0)
+ if (args.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName) == 0 ||
+ args.KeyName.CompareTo("XF86Info") == 0)
{
if (notification != null)
{
notification = null;
PackageManagerPort.UnregisterCallbacks();
MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
+ MainWindow.KeyUngrab("XF86Info");
}
/// <summary>
SizeUtils.Dpi = dpi;
SizeUtils.ScaleRatio = scaleRatio;
- string modelName;
- if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+ try
{
- SizeUtils.SetModelName(modelName);
+ string modelName;
+ if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+ {
+ SizeUtils.SetModelName(modelName);
+ }
+ }
+ catch(Exception e)
+ {
+ DebuggingUtils.Err("Cant get model name!!!, " + e.Message);
}
MainPage = new MainPage();
/// Grab key events
MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName, true);
MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName, true);
- MainWindow.KeyGrab("XF86SysMenu", true);
+ MainWindow.KeyGrab("XF86Info", true);
MainWindow.KeyGrab("Up", false);
MainWindow.KeyGrab("Down", false);
MainWindow.KeyGrab("Left", false);
}
}
else if (e.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName) == 0 ||
- e.KeyName.CompareTo("XF86SysMenu") == 0)
+ e.KeyName.CompareTo("XF86Info") == 0)
{
if (notification != null)
{
PackageManagerPort.UnregisterCallbacks();
MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName);
MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
+ MainWindow.KeyUngrab("XF86Info");
MainWindow.KeyUngrab("Up");
MainWindow.KeyUngrab("Down");
MainWindow.KeyUngrab("Left");
SizeUtils.Dpi = dpi;
SizeUtils.ScaleRatio = scaleRatio;
- string modelName;
- if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+ try
{
- SizeUtils.SetModelName(modelName);
+ string modelName;
+ if (DependencyService.Get<ISystemSettings>().GetSystemModelName(out modelName))
+ {
+ SizeUtils.SetModelName(modelName);
+ }
+ }
+ catch (Exception e)
+ {
+ DebuggingUtils.Err("Cant get model name!!!, " + e.Message);
}
MainPage = new MainPage();