public static void SetMapLocation(string address) { TargetProfileViewModel viewModelInstance = AlohomoraServices.GetService("TargetProfileViewModel") as TargetProfileViewModel; if (viewModelInstance != null) { viewModelInstance.GetLatLong(address); } }
public static IEnumerable <PersonModel> GetTargetProfiles() { MasterTargetListViewModel masterTargetListViewModel = AlohomoraServices.GetService("MasterTargetListViewModel") as MasterTargetListViewModel; if (masterTargetListViewModel != null) { return(masterTargetListViewModel.TargetProfiles); } else { return(null); } }
public static void SaveTargetProfiles() { MasterTargetListViewModel masterTargetListViewModel = AlohomoraServices.GetService("MasterTargetListViewModel") as MasterTargetListViewModel; string json = Serializer.PersonModelsToJson(masterTargetListViewModel.TargetProfiles); if (File.Exists("./cachedTargets.alohomora")) { File.Delete("./cachedTargets.alohomora"); } File.AppendAllText("./cachedTargets.alohomora", json); File.Encrypt("./cachedTargets.alohomora"); }
public static void AddTarget(PersonModel model) { MasterTargetListViewModel masterTargetListViewModel = AlohomoraServices.GetService("MasterTargetListViewModel") as MasterTargetListViewModel; if (masterTargetListViewModel != null) { bool targetExists = masterTargetListViewModel.TargetProfiles.Where(profile => profile.PersonId == model.PersonId).Count() > 0; if (!targetExists) { masterTargetListViewModel.TargetProfiles.Add(model); masterTargetListViewModel.OnPropertyChanged("TargetProfiles"); } } }