Exemplo n.º 1
0
        private void LoadMapPaths(Map map)
        {
            currentMapPaths.Clear();
            foreach (string pathId in map.PathIds.ToArray())
            {
                MapPath path = LoadSave.LoadMapPath(Globals.MapPathsDir + pathId);
                if (path != null)
                {
                    currentMapPaths.Add(path);

                    if (Globals.IsDebugMode)
                    {
                        DrawPath(path, bluePen);
                    }
                }
                else
                {
                    throw new Exception("MapPath returned is null. This should ne ver happen. Please contact administrator.");
                }
            }

            // Load navigator paths in the current map
            currentNavigatorPaths.Clear();
            foreach (string pathId in map.PathIds.ToArray())
            {
                foreach (NavigatorPath path in Globals.NavigatorPlace.Paths)
                {
                    if (path.Id == pathId)
                    {
                        currentNavigatorPaths.Add(pathId, path);
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void Load()
        {
            Shops.Clear();
            List <Shop> shops = (List <Shop>)LoadSave.Load(shopFileName, typeof(List <Shop>));

            if (shops != null)
            {
                Shops.AddRange(shops.ToArray());
            }
        }
Exemplo n.º 3
0
        public void Load()
        {
            Items.Clear();
            List <string> items = (List <string>)LoadSave.Load(groupFileName, typeof(List <string>));

            if (items != null)
            {
                Items.AddRange(items.ToArray());
            }
        }
Exemplo n.º 4
0
        public static void Load()
        {
            Groups.Clear();
            List <GroupSettings> groups = (List <GroupSettings>)LoadSave.Load(groupSettingsFileName, typeof(List <GroupSettings>));

            if (groups != null)
            {
                Groups.AddRange(groups.ToArray());
            }
        }
Exemplo n.º 5
0
        public static void Load()
        {
            files.Clear();
            List <string> recentfiles = (List <string>)LoadSave.Load(recentFilesFile, typeof(List <string>));

            if (recentfiles != null)
            {
                files.AddRange(recentfiles.ToArray());
            }
        }
Exemplo n.º 6
0
        public static void Load()
        {
            hotspots.Clear();
            List <Hotspot> spots = (List <Hotspot>)LoadSave.Load(hotspotsFileName, typeof(List <Hotspot>));

            if (spots != null)
            {
                hotspots.AddRange(spots.ToArray());
            }
        }
Exemplo n.º 7
0
        public static void Load()
        {
            Ads.Clear();
            List <AdSettings> ads = (List <AdSettings>)LoadSave.Load(adsFileName, typeof(List <AdSettings>));

            if (ads != null)
            {
                Ads.AddRange(ads.ToArray());
            }
            IsLoaded = true;
        }
Exemplo n.º 8
0
        public void LoadMaps()
        {
            maps = LoadSave.LoadMaps(Globals.ProjectFile);

            floorsCtrl.LoadFloors(maps);

            if (maps != null && maps.Count > 0)
            {
                LoadSelectedMap(maps[0]); // TODO: Default map can be different, not just the first one
                floorsCtrl.SelectedMap = maps[0];
            }
        }
Exemplo n.º 9
0
 public static void Load()
 {
     instance = (User)LoadSave.Load(userFile, typeof(User));
     if (instance == null)
     {
         instance = new User();
         Save(); // Save default passwords
     }
     else
     {
         instance.adminPassword  = EncryptionHelper.Decrypt(instance.adminPassword);
         instance.clientPassword = EncryptionHelper.Decrypt(instance.clientPassword);
     }
 }
Exemplo n.º 10
0
        private void btnLoadProject_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                currentPlace = LoadSave.Load(dlg.FileName);
                imagePath    = Path.GetDirectoryName(dlg.FileName) + "\\images";

                currentPath  = currentPlace.Paths[0];
                currentPoint = currentPath.Points[0];
                currentAngle = 0;

                LoadImage();
            }
        }
Exemplo n.º 11
0
        public static void Save()
        {
            // assign default settings to each group if not in the list
            foreach (string groupName in GroupManager.Floors.Items)
            {
                if (GroupExists(groupName) == false)
                {
                    GroupSettings newGroupSettings = new GroupSettings();
                    newGroupSettings.GroupName = groupName;
                    newGroupSettings.GroupType = GroupType.Floor;
                }
            }

            // delete if there is any extra group (may be deleted by the user)

            LoadSave.Save(groupSettingsFileName, Groups, typeof(List <Shop>));
        }
Exemplo n.º 12
0
 public static void Save()
 {
     LoadSave.Save(hotspotsFileName, hotspots, typeof(List <Hotspot>));
 }
Exemplo n.º 13
0
 public static void Save()
 {
     LoadSave.Save(groupSettingsFileName, groupSettings, typeof(GroupSettings));
 }
Exemplo n.º 14
0
 public static void Load()
 {
     groupSettings = (GroupSettings)LoadSave.Load(groupSettingsFileName, typeof(GroupSettings));
 }
Exemplo n.º 15
0
 public static void Save()
 {
     LoadSave.Save(userFile, instance, typeof(User));
 }
Exemplo n.º 16
0
 public void Save()
 {
     LoadSave.Save(groupFileName, Items, typeof(List <string>));
 }
Exemplo n.º 17
0
 public static void Save()
 {
     LoadSave.Save(recentFilesFile, files, typeof(List <string>));
 }
Exemplo n.º 18
0
 public void Save()
 {
     LoadSave.Save(youarehereLocationFile, instance, typeof(YouAreHereLocation));
 }
Exemplo n.º 19
0
 public static void Save()
 {
     LoadSave.Save(adsFileName, Ads, typeof(List <AdSettings>));
 }
Exemplo n.º 20
0
 public static void Load()
 {
     instance = (LogoSettings)LoadSave.Load(logoSettingsPath, typeof(LogoSettings));
 }
Exemplo n.º 21
0
 public static void Save()
 {
     LoadSave.Save(logoSettingsPath, instance, typeof(LogoSettings));
 }
Exemplo n.º 22
0
 public void Load()
 {
     instance = (YouAreHereLocation)LoadSave.Load(youarehereLocationFile, typeof(YouAreHereLocation));
 }
Exemplo n.º 23
0
 public static void Save()
 {
     LoadSave.Save(shopFileName, Shops, typeof(List <Shop>));
 }