using Oobe.Region;
using System;
using Oobe.Wifi;
+using System.IO;
namespace Oobe
{
private LinkedList<Lazy<ProcessStep>> steps;
private LinkedListNode<Lazy<ProcessStep>> current;
+ static private string doneFile = Tizen.Applications.CoreUIApplication.Current.DirectoryInfo.Data + "oobe_done";
+
public ProcessManager()
{
//TODO consider loading this from xaml, xml or something...
{
step.Value.Shutdown();
}
+ #if RELEASE
+ SetDone();
+ #endif
NUIApplication.Current.Exit();
}
ui.Pop();
}
}
+
+ static void SetDone()
+ {
+ if (!File.Exists(doneFile))
+ {
+ File.Create(doneFile).Dispose();
+ }
+ }
+
+ /// <summary>
+ /// Indicates if oobe process has been previously finished
+ /// </summary>
+ /// <returns></returns>
+ static public bool IsDone()
+ {
+ return File.Exists(doneFile);
+ }
+
+ static void ClearDone()
+ {
+ File.Delete(doneFile);
+ }
}
}
protected override void OnCreate()
{
+ processManager = new ProcessManager();
+ if (ProcessManager.IsDone())
+ {
+ NUIApplication.Current.Exit();
+ return;
+ }
+
base.OnCreate();
Initialize();
}
{
processManager = new ProcessManager();
processManager.Start();
-
Button button = new Button();
button.Text = "Next";
button.BackgroundColor = Color.Blue;