Пример #1
0
 public static void DeleteAllInformationXML()
 {
     foreach (string place in GetAllNavigationGraphs())
     {
         string map = PhoneInformation.GetCurrentMapName(place);
         DeleteInformationML(map);
     }
 }
Пример #2
0
 public AddPhoneInfo(PhoneInformation Model)
 {
     InitializeComponent();
     if (viewModel == null)
     {
         viewModel = new PhoneInfoViewModel(this, true);
     }
     BindingContext  = viewModel;
     viewModel.Model = Model;
 }
Пример #3
0
        /// <summary>
        /// If it is the first time to get waypoint then get the value of
        /// route options and start the corresponding session.
        /// </summary>
        private void ConstructSession()
        {
            List <ConnectionType> avoidList = new List <ConnectionType>();

            Console.WriteLine("-- setup preference --- ");
            if (Application.Current.Properties.ContainsKey("AvoidStair"))
            {
                avoidList.Add(
                    (bool)Application.Current.Properties["AvoidStair"] ?
                    ConnectionType.Stair : ConnectionType.NormalHallway);
                avoidList.Add(
                    (bool)Application.Current.Properties["AvoidElevator"] ?
                    ConnectionType.Elevator : ConnectionType.NormalHallway);
                avoidList.Add(
                    (bool)Application.Current.Properties["AvoidEscalator"] ?
                    ConnectionType.Escalator : ConnectionType.NormalHallway);

                avoidList = avoidList.Distinct().ToList();
                avoidList.Remove(ConnectionType.NormalHallway);
            }
            Console.WriteLine("-- end of setup preference --- ");

            // Start the session
            _session = new Session(
                NavigraphStorage.LoadNavigationGraphXML(
                    PhoneInformation.
                    GetCurrentMapName(_navigationGraphName)
                    ),
                _destinationRegionID,
                _destinationWaypointID,
                avoidList.ToArray());

            _navigationResultEventHandler =
                new EventHandler(HandleNavigationResult);
            _session._event._eventHandler += _navigationResultEventHandler;
        }
Пример #4
0
        public static string[] GetAllNavigationGraphs()
        {
            // Check the folder of navigation graph if it is exist
            if (!Directory.Exists(_navigraphFolder))
            {
                Directory.CreateDirectory(_navigraphFolder);
            }
            if (!Directory.Exists(_firstDirectionInstuctionFolder))
            {
                Directory.CreateDirectory(_firstDirectionInstuctionFolder);
            }
            if (!Directory.Exists(_informationFolder))
            {
                Directory.CreateDirectory(_informationFolder);
            }
            //PhoneInformation phoneInformation = new PhoneInformation();


            string[] existNavigraphname = Directory.GetFiles(_navigraphFolder)
                                          .Select(path => Path.GetFileName(path))
                                          .OrderBy(file => file).ToArray();
            string[] returnGraphName = new string[existNavigraphname.Count()];
            for (int i = 0; i < existNavigraphname.Count(); i++)
            {
                XMLInformation information;

                information = NavigraphStorage.LoadInformationML
                                  (existNavigraphname[i].ToString()
                                  + "_info_" + PhoneInformation.GetCurrentLanguage()
                                  + ".xml");

                returnGraphName[i] = information.GiveGraphName();
            }

            return(returnGraphName);
        }