public ActionResult mesDemandeLocation() { decimal id = (decimal)Session["id"]; List <Location> listLocation = db.Location.Where(p => p.archived == 1 && p.Ins_id2 == id).OrderByDescending(p => p.created).ToList(); ViewBag.nbreLocation = db.Location.Where(p => p.archived == 1 && p.Ins_id2 == id).ToList().Count; ViewBag.nbreLocationActif = db.Location.Where(p => p.archived == 1 && p.Ins_id2 == id && p.status == 1).ToList().Count; List <CustomLocation> newlistLocation = new List <CustomLocation>(); foreach (Location item in listLocation) { CustomLocation customLocation = new CustomLocation(); Inscrire inscrire = db.Inscrire.Where(p => p.id == item.Ins_id).FirstOrDefault(); customLocation.inscrire = inscrire; customLocation.location = item; newlistLocation.Add(customLocation); } ViewBag.newlistLocation = newlistLocation; return(View()); }
public void UpdateUserLocation(double longitude, double latitude) { var location = new CustomLocation(longitude, latitude); Task.Factory.StartNew(() => { innerUpdateUserLocation(location); }); }
private async void innerUpdateUserLocation(CustomLocation location) { var result = await ServiceHandler.PostAction <dynamic, User>(new { user = new User { Location = location } }, ApiAction.UPDATE_PROFILE, "PUT"); if (result.HasError) { return; } }
public void UpdatePosition(double longitude, double latitude, bool source = true) { if (source) { SourcePoint = new CustomLocation(longitude, latitude); } else { DestinationPoint = new CustomLocation(longitude, latitude); } }
/// <summary> /// Create a CustomLocation that is a deep copy of the original.<br /> /// Changes will not affect the original. The CustomLocation is already registered in the manager. /// </summary> /// <param name="name">name of the custom location</param> /// <param name="baseName">name of the existing location to copy</param> /// <returns>A CustomLocation object with the cloned location prefab</returns> public CustomLocation CreateClonedLocation(string name, string baseName) { var baseZoneLocation = GetZoneLocation(baseName); var copiedPrefab = Object.Instantiate(baseZoneLocation.m_prefab, Vector3.zero, Quaternion.identity, LocationContainer.transform); copiedPrefab.name = name; var clonedLocation = new CustomLocation(copiedPrefab, false, new LocationConfig(baseZoneLocation)); AddCustomLocation(clonedLocation); return(clonedLocation); }
/// <summary> /// Register a CustomLocation to be added to the ZoneSystem /// </summary> /// <param name="customLocation"></param> /// <returns>true if the custom location could be added to the manager</returns> public bool AddCustomLocation(CustomLocation customLocation) { if (Locations.ContainsKey(customLocation.Name)) { Logger.LogWarning($"Location {customLocation.Name} already exists"); return(false); } customLocation.Prefab.transform.SetParent(LocationContainer.transform); // The root prefab needs to be active, otherwise ZNetViews are not prepared correctly customLocation.Prefab.SetActive(true); Locations.Add(customLocation.Name, customLocation); return(true); }
private void CreateLocation(GameObject prefab) { LocationConfig config = new LocationConfig() { Biome = biome, ExteriorRadius = GetMaxBuildRadius(), Group = blueprint.Name, MaxTerrainDelta = biome == Heightmap.Biome.Mountain ? 4f : 2f, MinAltitude = 0.5f, Quantity = 100, RandomRotation = true, ClearArea = true, }; CustomLocation location = new CustomLocation(prefab, false, config); location.Location.m_applyRandomDamage = true; location.Location.m_noBuild = false; ZoneManager.Instance.AddCustomLocation(location); }
public ActionResult Index(decimal type) { List <Location> listLocation = db.Location.Where(p => p.archived == 1 && p.status == 1 && p.type == type).OrderByDescending(p => p.created).ToList(); ViewBag.nbreLocation = db.Location.Where(p => p.archived == 1 && p.status == 1 && p.type == type).ToList().Count; List <CustomLocation> newlistLocation = new List <CustomLocation>(); foreach (Location item in listLocation) { CustomLocation customLocation = new CustomLocation(); Inscrire inscrire = db.Inscrire.Where(p => p.id == item.Ins_id2).FirstOrDefault(); customLocation.inscrire = inscrire; customLocation.location = item; newlistLocation.Add(customLocation); } ViewBag.newlistLocation = newlistLocation; ViewBag.type = type; return(View()); }
/// <summary> /// Creates or updates a Custom Location. /// </summary> /// <remarks> /// Creates or updates a Custom Location in the specified Subscription and /// Resource Group /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='resourceName'> /// Custom Locations name. /// </param> /// <param name='parameters'> /// Parameters supplied to create or update a Custom Location. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <CustomLocation> BeginCreateOrUpdateAsync(this ICustomLocationsOperations operations, string resourceGroupName, string resourceName, CustomLocation parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates a Custom Location. /// </summary> /// <remarks> /// Creates or updates a Custom Location in the specified Subscription and /// Resource Group /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='resourceName'> /// Custom Locations name. /// </param> /// <param name='parameters'> /// Parameters supplied to create or update a Custom Location. /// </param> public static CustomLocation BeginCreateOrUpdate(this ICustomLocationsOperations operations, string resourceGroupName, string resourceName, CustomLocation parameters) { return(operations.BeginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).GetAwaiter().GetResult()); }
internal override org.objectfabric.Workspace newCustomWorkspace(CustomLocation store) { return(new CustomWorkspace(store)); }
internal override org.objectfabric.Workspace newCustomWorkspace(CustomLocation store) { return new CustomWorkspace(store); }