예제 #1
0
    public void ReportAlarmOnClick()
    {
        CalendarViewController viewController = FindObjectOfType <CalendarViewController>();

        if (viewController)
        {
            viewController.RequestView(CalendarViewController.State.REPORT);
        }

        ExtrasViewController exrasController = FindObjectOfType <ExtrasViewController>();

        if (exrasController)
        {
            exrasController.RequestView(ExtrasViewController.State.ILLEGAL);
        }
    }
 public void AlarmPressed()
 {
     optionsController.RequestView(ExtrasViewController.State.ALARM);
 }
예제 #3
0
    public void Command(string[] s)
    {
        switch (s[1])
        {
        case "FULLSCREEN":
            SetFullScreen(s[2] == "ON" ? true : false);
            break;

        case "CLEAR_LEGACY":
            if (s.Length > 2 && s[2] == "TRUE")
            {
                Directory.Delete(LEGACY_FOLDER, true);
            }
            break;

        case "SEARCH_LEGACY":
            if (s.Length > 2)
            {
                GetComponent <DataManager>().SearchLegacy(s[2]);
            }
            break;

        case "MinimumTourTime":
            int spacing = 0;
            if (int.TryParse(s[2], out spacing))
            {
                SettingsManager.Write("MinimumTourTime", spacing);
            }
            break;

        case "LEGACY_THRESHOLD":
            int time = 0;
            if (int.TryParse(s[2], out time))
            {
                SettingsManager.Write("OldDataThreshold", time);
            }
            break;

        case "EXIT":
            ExitApplication();
            break;

        case "BACKUP":
            if (s.Length == 3)
            {
                if (s[2] == "DATA")
                {
                    DataReader.BackUp(DATA_FOLDER, EXPORT_PATH + "/CalendarDataBackUp/Data", true);
                }
                else if (s[2] == "LEGACY")
                {
                    DataReader.BackUp(LEGACY_FOLDER, EXPORT_PATH + "/CalendarDataBackUp/Legacy", true);
                }
            }
            else if (s.Length == 2)
            {
                DataReader.BackUp(DATA_PATH, EXPORT_PATH + "/CalendarDataBackUp", true);
            }

            break;

        case "REARRANGE":
            RearrangeData();
            break;

        case "IMPORT":
            if (s.Length > 2)
            {
                string path = s[2];
                for (int i = 3; i < s.Length; i++)
                {
                    path = path + " " + s[i];
                }
                DataReader.BackUp(path, DATA_PATH, false);
            }
            else
            {
                if (IMPORT_PATH != "")
                {
                    DataReader.BackUp(IMPORT_PATH, DATA_PATH, false);
                }
            }
            ReloadScene();
            break;

        case "REPORT":
            CalendarViewController viewController = FindObjectOfType <CalendarViewController>();
            if (viewController)
            {
                viewController.RequestView(CalendarViewController.State.REPORT);
            }
            break;

        case "HELP":
            ExtrasViewController extras = FindObjectOfType <ExtrasViewController>();
            if (extras)
            {
                extras.RequestView(ExtrasViewController.State.HELP);
            }
            break;

        case "LANGUAGE":
            if (s.Length > 2)
            {
                int i = 0;
                int.TryParse(s[2], out i);
                SetLanguage(i);
            }
            break;

        case "Monday":
        case "Tuesday":
        case "Wednesday":
        case "Thursday":
        case "Friday":
        case "Saturday":
        case "Sunday":
            if (s.Length > 2)
            {
                UpdateTimetable(s[1], s[2]);
            }
            break;

        case "TicketPrice":
            if (s.Length > 2)
            {
                float f = 0;
                float.TryParse(s[2], out f);
                SettingsManager.Write("TicketPrice", f);
            }
            break;

        case "ReducedTicketPrice":
            if (s.Length > 2)
            {
                float f = 0;
                float.TryParse(s[2], out f);
                SettingsManager.Write("ReducedTicketPrice", f);
            }
            break;

        case "OPTIONS":
            Options();
            break;

        case "DataPath":
            if (s.Length > 2)
            {
                SettingsManager.Write("DataPath", s[2]);
                DATA_PATH = s[2];
            }
            break;

        case "ExportPath":
            if (s.Length > 2)
            {
                SettingsManager.Write("ExportPath", s[2]);
                EXPORT_PATH = s[2];
            }
            break;

        case "ImportPath":
            if (s.Length > 2)
            {
                SettingsManager.Write("ImportPath", s[2]);
                IMPORT_PATH = s[2];
            }
            break;

        default:
            break;
        }
    }