public async Task <IActionResult> Edit(int id, [Bind("Id,PriorityDescription,LastUpdated,Active,Team")] Priorities priorities) { if (id != priorities.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(priorities); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrioritiesExists(priorities.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Team"] = new SelectList(_context.Teams, "Id", "TeamDescription", priorities.Team); return(View(priorities)); }
/// <summary> /// Filters the results. /// </summary> /// <param name="addresses">The addresses.</param> /// <returns></returns> protected override AddressInformation[] FilterResults(AddressInformation[] addresses) { var results = addresses.Where(s => !s.Components.Any(c => c.Types.Contains(AddressPartsNames.NaturalFeature, StringComparer.InvariantCultureIgnoreCase))); if (this.IgnoreCloseMatches) { if (results.Any(r => r.Type == null || !Priorities.ContainsKey(r.Type))) { return(addresses); } // Filter stuffs here. foreach (var address in results.ToList()) { // If there are more than one of the same type, then don't filter. if (results.Count(r => Priorities[r.Type] == Priorities[address.Type]) > 1) { return(results.ToArray()); } } results = results.OrderByDescending(r => Priorities[r.Type]).Take(1); } return(results.ToArray()); }
public ActionResult DeleteConfirmed(int id) { Priorities priorities = db.Priorities.Find(id); db.Priorities.Remove(priorities); db.SaveChanges(); return RedirectToAction("Index"); }
//Default constructor public Task() { //set default values time = DateTime.Now; description = string.Empty; priority = Priorities.Medium; }
public PriorityPopupViewModel(IPlanStreetNavigationService planStreetNavigationService) { _planStreetNavigationService = planStreetNavigationService; PrioritySelectedCommand = new RelayCommand(PriorityUpdated); OkCommand = new RelayCommand(() => { var status = Priorities.Where(x => x.IsSelected == true).FirstOrDefault(); if (status == null) { return; } App.Locator.CreateProjectViewModel.PriorityColor = status.PriorityColor; App.Locator.CreateProjectViewModel.PriorityName = status.PriorityName; _planStreetNavigationService.ClosePopup(); var message = new PriorityChangedMessage() { SelectedPriority = status.PriorityType }; MessagingCenter.Send(message, MessageConstants.PriorityChangedMessage); }); CancelCommand = new RelayCommand(() => { _planStreetNavigationService.ClosePopup(); }); Priorities = new ObservableCollection <PriorityModelItem>(); Priorities.Add(new PriorityModelItem("Low Priority", Color.FromRgb(112, 216, 124), false, Enums.PriorityType.Low)); Priorities.Add(new PriorityModelItem("Medium Priority", Color.FromRgb(253, 196, 79), true, Enums.PriorityType.Medium)); Priorities.Add(new PriorityModelItem("High Priority", Color.FromRgb(255, 0, 0), false, Enums.PriorityType.High)); ListHeights = Priorities.Count * RowHeights; }
public Priorities GetActionPriorities(string id) { Priorities pr = new Priorities(); DataSet dataset = new DataSet(); string queryStr = string.Format("SELECT * FROM priorities WHERE PriorityID = '{0}'", id); Program.destopService.DataQuery(Program.Username, Program.Password, queryStr, ref dataset, "x", ref errorString); if (!string.IsNullOrEmpty(errorString)) { return(null); } if (dataset.Tables["x"].Rows.Count > 0) { pr.PriorityID = dataset.Tables["x"].Rows[0]["PriorityID"].ToString(); pr.PriorityName = dataset.Tables["x"].Rows[0]["PriorityName"].ToString(); pr.PriorityName2 = dataset.Tables["x"].Rows[0]["PriorityName2"].ToString(); pr.PriorityName3 = dataset.Tables["x"].Rows[0]["PriorityName3"].ToString(); } else { pr = null; } return(pr); }
public bool Put(object data, Priorities pri = Priorities.Normal) { if (!this.SupportDataTypes.Contains(data.GetType())) { throw new ArgumentException("Not Support data type"); } using (var trans = new MessageQueueTransaction()) using (var mq = this.GetQueue()) { trans.Begin(); try { //mq.Formatter = new JsonMessageFormater(data.GetType()); //mq.Formatter = new ProtoBufFormatter(data.GetType()); var msg = new Message(data); msg.Formatter = new JsonMessageFormater(data.GetType()); msg.Label = data.GetType().FullName.To16bitMD5();////名称太长会报错 msg.Priority = this.ConvertPriority(pri); msg.Recoverable = true; mq.Send(msg, trans); //不能这样,否则 Processed Queue 不会被写入 //mq.Send(msg, MessageQueueTransactionType.Automatic); trans.Commit(); return(true); } catch (Exception ex) { Console.WriteLine(ex.Message); trans.Abort(); return(false); } } }
public static void FadeTo(string SongName, float FadeTime = 3f, Priorities SongPriority = Priorities.None) { if (Main.dedServ || Main.engine == null || SongPriority < Priority) { return; } Priority = SongPriority; string text = Config.tempModAssembly + "\\" + TMod.GetCurrentMod() + "\\" + SongName; if (!Path.HasExtension(text)) { string text2 = text + ".mp3"; text = ((!File.Exists(text2)) ? (text + ".wav") : text2); } if (SongName == null || File.Exists(text)) { NextSong = text; MusicFadeDelay = FadeTime; FadingOut = true; if (FadingIn) { FadingIn = false; MusicTimer = MusicFadeDelay - MusicTimer; } } }
/// <summary> /// Constructor /// </summary> /// <param name="date">Date</param> /// <param name="hour">Hour</param> /// <param name="priority">Priority</param> /// <param name="description">Description</param> public Task(string date, string hour, Priorities priority, string description) { Date = date; Hour = hour; Priority = priority; Description = description; }
public async Task <IActionResult> Edit(int?id, [Bind("PriorityId,PriorityName,PriorityDescription,CreatedBy,CreatedDate,Deleted")] Priorities priorities) { if (id != priorities.PriorityId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(priorities); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrioritiesExists(priorities.PriorityId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(priorities)); }
public bool IsPriorityOrdered(Spell s1, Spell s2) { int i1 = Priorities.IndexOf(s1); int i2 = Priorities.IndexOf(s2); return((i1 < i2 && i1 != -1) || (i1 != -1 && i2 == -1)); }
public async Task <IActionResult> PutPriorities(int id, Priorities priorities) { if (id != priorities.PriorityId) { return(BadRequest()); } _context.Entry(priorities).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrioritiesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public WowTimer( double d, string a ) { name = a; state = States.Paused; delay = (int)d; if ( d <= 10 ) priority = Priorities.Milisec1; else if ( d <= 100 ) priority = Priorities.Milisec10; else if ( d <= 500 ) priority = Priorities.Milisec100; else if ( d <= 1000 ) priority = Priorities.Milisec500; else if ( d <= 5000 ) priority = Priorities.Second; else if ( d <= 10000 ) priority = Priorities.Second5; else if ( d > 60 * 60 * 1000 ) priority = Priorities.Hour; else priority = Priorities.Second30; TimeSpan ts = DateTime.Now.Subtract( World.startingTime ); lastCall = (long)ts.TotalMilliseconds; }
public async void Initialize(ViewRequest viewRequest) { model.GetConfiguration((viewRequest as KanbanViewRequest)?.ConfigurtaionName); var filtersData = await Task .Run(() => model.LoadFiltersData()) .ConfigureAwait(true); Projects.Clear(); foreach (var project in filtersData.Projects) { Projects.Add(project); } Priorities.Clear(); foreach (var priority in filtersData.Priorities) { Priorities.Add(priority); } if (model.Configuration != null && model.Configuration.ProjectId.HasValue) { CurrentProject = Projects.FirstOrDefault(x => x.Id == model.Configuration.ProjectId); } await DoRefresh(); }
public void InsertPriority(string typePriority) { var priority = new Priorities(typePriority); // PriorityDataServices.Instance.InsertPriority(ConvertPriority(priority)); PriorityDataServices.Instance.InsertPriority(priority.MapTo(new Priority())); }
public IUnitDef WhatShouldIBuild(UnitDefArrayList constructordef, int constructorid, Float3 pos) { Priorities.Add( 1.0, tanks, 5 ) Priorities.Add( 0.8, radar, position ) if (isfactory) { if (numbertanks < 5 || numberscouts >= 2 ) { if (haveenergy(buildtank)) { if (havemetal(buildtank)) { buildtank(); } } else { buildenergy(); } } else { if (numberscouts < 1) { if( } } } if( isconstructor ) { } }
//public void UpdateService(string serviceName, int idService) //{ // var service = new Priorities(serviceName, idService); // PriorityDataServices.Instance.Update(ConvertPriority(service)); //} public void DeletePriority(int idPriority) { var priority = new Priorities(idPriority); // PriorityDataServices.Instance.DeletePriority(ConvertPriority(priority)); PriorityDataServices.Instance.DeletePriority(priority.MapTo(new Priority())); }
private void RegisterTask(object sender, EventArgs args) { if (TxtName.Text.Trim().Length > 0 && this.Prioritie > 0) { TaskController _tskList = new TaskController(); Modelos.Priorities _prioritie = new Priorities(); _prioritie.IndexPrioritie = this.Prioritie; _prioritie.NamePrioritie = Priorities.PrioritieSelected(this.Prioritie); Modelos.Task _task = new Modelos.Task(); _task.DateDone = null; _task.Index = _tskList.SizeListTask(); /*take the last saved task add one and...*/ _task.TaskName = TxtName.Text.Trim(); _task.Prioritie = _prioritie; /*update critic task image*/ new TaskController().Save(_task); App.Current.MainPage = new NavigationPage(new Index()); } else { DisplayAlert("ERROR", "Please, infomr the name of the task as also a prioritie!", "Gotcha!"); } }
public async Task <ActionResult <Priorities> > PostPriorities(Priorities priorities) { _context.Priorities.Add(priorities); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPriorities", new { id = priorities.PriorityId }, priorities)); }
/// <summary> /// Checks if a pair in the solution is a stable pair /// </summary> /// <param name="priorities">The priorities of the stable marriage</param> /// <param name="solution">The solution</param> /// <param name="pair">The pair</param> /// <returns>Conditional for the pair being stable in the solution</returns> private bool IsStablePair(Priorities priorities, Solution solution, int pair) { int p1 = solution[pair].Item1; int p2 = solution[pair].Item2; //Iterate through p1's more prefered candidates for (int posX = 0; posX < priorities[p1].FindIndex(x => x == p2); posX++) { //More prefered by p1 int pX = priorities[p1][posX]; //X's current pair int pY = solution.GetPair(pX); //check if X prefers p1 more than Y if (priorities[pX].FindIndex(x => x == p1) < priorities[pX].FindIndex(x => x == pY)) { return(false); } } //Iterate through p2's more prefered candidates for (int posX = 0; posX < priorities[p2].FindIndex(x => x == p1); posX++) { //More prefered by p2 int pX = priorities[p2][posX]; //X's current pair int pY = solution.GetPair(pX); //check if X prefers p2 more than Y if (priorities[pX].FindIndex(x => x == p2) < priorities[pX].FindIndex(x => x == pY)) { return(false); } } return(true); }
static SyntaxNodeReader() { var priorities = new List <TokType[]>(7) { new[] { TokType.ArrOBr, TokType.Dot, TokType.Obr }, new[] { TokType.Pow }, new[] { TokType.Mult, TokType.Div, TokType.Rema }, new[] { TokType.Plus, TokType.Minus, TokType.BitShiftLeft, TokType.BitShiftRight }, new[] { TokType.BitAnd, TokType.BitXor, TokType.In, TokType.Equal, TokType.NotEqual, TokType.More, TokType.Less, TokType.MoreOrEqual, TokType.LessOrEqual }, new[] { TokType.And, TokType.ArrConcat }, new[] { TokType.Or, TokType.Xor, TokType.BitOr } }; for (byte i = 0; i < priorities.Count; i++) { foreach (var tokType in priorities[i]) { Priorities.Add(tokType, i); } } MaxPriority = priorities.Count - 1; }
private Priorities ReadPrio(out bool success) { Priorities prio = (Priorities)prioCombo.SelectedIndex; success = true; return(prio); }
internal LandUse(PFSSection Section) { _pfsHandle = Section; for (int i = 1; i <= Section.GetSectionsNo(); i++) { PFSSection sub = Section.GetSection(i); switch (sub.Name) { case "VEGETATION": _vEGETATION = new VEGETATION(sub); break; case "CommandAreas": _commandAreas = new CommandAreas(sub); break; case "Demands": _demands = new Demands(sub); break; case "Priorities": _priorities = new Priorities(sub); break; case "PavedRunoffCoefficient": _pavedRunoffCoefficient = new Topography(sub); break; default: _unMappedSections.Add(sub.Name); break; } } }
public usrMessageView() { InitializeComponent(); Priorities.Add(new ImageListItem <MessagePriority>(Strings.MessagePriority_Normal, "PriorityNormal.png".ToResourceString(), MessagePriority.Normal)); Priorities.Add(new ImageListItem <MessagePriority>(Strings.MessagePriority_Low, "PriorityLow.png".ToResourceString(), MessagePriority.Low)); Priorities.Add(new ImageListItem <MessagePriority>(Strings.MessagePriority_High, "PriorityHigh.png".ToResourceString(), MessagePriority.High)); Priorities.Add(new ImageListItem <MessagePriority>(Strings.MessagePriority_System, "PrioritySystem.png".ToResourceString(), MessagePriority.System)); }
private static Priority ConvertPriority(Priorities priority) { return(new Priority { TypePriority = priority.TypePriority, idPriority = priority.idPriority }); }
public object Get(Priorities request) { return(base.RequestContext.ToOptimizedResultUsingCache(base.Cache, string.Format("urn:{0}:{1}", base.Request.GetBasicAuth(), base.Request.PathInfo.Substring(1)), new System.TimeSpan(2, 0, 0), () => { return GetPriorities(request); })); }
public CreateViewModel(ITodoService todoServ, INavigationService navigServ) { _todoService = todoServ; _navigationService = navigServ; Priorities = Enum.GetValues(typeof(TaskPriority)).Cast <TaskPriority>().ToList(); Priority = Priorities.First(); }
public WowTimer( Priorities p, double d ) { state = States.Paused; delay = (int)d; priority = p; TimeSpan ts = DateTime.Now.Subtract( World.startingTime ); lastCall = (long)ts.TotalMilliseconds; }
public ProcessControlBlock(string pid, Priorities priority) { Pid = pid; Priority = priority; StatusType = ProcessStates.Ready; Children = new List <ProcessControlBlock>(); OtherResources = new List <KeyValuePair <ResourceControlBlock, int> >(); }
private PriorityData(long id, string displayName, string iconName) { ID = id; DisplayName = displayName; bitmapImage = WazeraUtils.GetResource(iconName); Priorities.Add(this); PriorityMap.Add(ID, this); }
public async Task GetPrioritiesAsync() { OperationInProgress = true; Priorities = await PrioritiesProvider.GetPrioritiesAsync(); SelectedPriority = Priorities?.FirstOrDefault(); OperationInProgress = false; }
public IProcess Interpret(CodeReader reader, Priorities priority) { if (TryInterpret(reader, priority, out var process)) { return(process); } throw new Exception("Uninterpreted code."); }
public WowTimer(Priorities p, double d) { state = States.Paused; delay = (int)d; priority = p; TimeSpan ts = DateTime.Now.Subtract(World.startingTime); lastCall = (long)ts.TotalMilliseconds; }
private MaintenanceItem(string name, string desc, DateTime issueDate, Property property, Statuses status, List<Tenant> tenantsInvolved, RequestorTypes requestedBy, double estimatedCost, DateTime ealiestDue, DateTime latestDue, Priorities priority, TimeSpan estimatedTimeTaken,bool isServiceCall) : base(name, desc, issueDate, property, status, tenantsInvolved) { InstanceID = "Mnt_" + new string(InstanceID.Skip(4).ToArray()); Priority = priority; RequestedBy = requestedBy; EstimatedCost = estimatedCost; EstimatedTimeTaken = estimatedTimeTaken; EarliestDueDate = ealiestDue; LatestDueDate = latestDue; IsServiceCall = isServiceCall; }
Priorities[] SortCases(Priorities[] entry) { for (int i = 0; i < entry.Length - 1; i++) { for (int j = i + 1; j > 0; j--) { if (ComparePriorities(entry[j - 1].priority, entry[j].priority)) { Priorities temp = entry[j - 1]; entry[j - 1] = entry[j]; entry[j] = temp; } } } return entry; }
public static void add(QueueManagerAction function, Priorities priority = Priorities.Normal) { mQueue[(int)priority].Enqueue(function); }
public static void addGCCollectionMode(Priorities priority, string Sender = "GC") { if(debug) QueueManager.add(new QueueManager.QueueManagerAction(Sender, () => Debug.Log("Memory used before collection: " + System.GC.GetTotalMemory(false)), "GC.GetTotalMemory(false)"), priority); QueueManager.add(new QueueManager.QueueManagerAction(Sender, () => GC(), "GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced)"), priority); if(debug) QueueManager.add(new QueueManager.QueueManagerAction(Sender, () => Debug.Log("Memory used after full collection: " + System.GC.GetTotalMemory(true)), "GC.GetTotalMemory(true)"), priority); }
public async Task SetPriority(IEnumerable<InfoHash> torrents, Priorities priority) { string url = getPriorityUrl(priority); StringBuilder sb = new StringBuilder(); foreach (var item in torrents) { sb.Append('|'); sb.Append(item.Hash.ToString()); } await req.Post(url, $"hashes={sb.ToString()}"); }
public void Tell(object message, ActorReference source = null, Priorities priority = Priorities.Normal) { ActorSystem.Tell (this, message, source, priority); }
public static void LogError(string describtion, string Location, Priorities Priority) { }
//Constructor. public Package(Priorities priority) { this.priority = priority; }
public object Get(Priorities request) { ApiUser hdUser = request.ApiUser; return Models.Priorities.All(hdUser.OrganizationId, hdUser.DepartmentId); }
public CombatStats(Character character, Stats stats, CalculationOptionsEnhance calcOpts, BossOptions bossOpts) { _stats = stats; _character = character; _calcOpts = calcOpts; _bossOpts = bossOpts; _talents = _character.ShamanTalents; fightLength = _bossOpts.BerserkTimer; levelDifference = _bossOpts.Level - _character.Level; if (levelDifference > 3) levelDifference = 3; else if (levelDifference < 0) levelDifference = 0; whiteCritDepression = StatConversion.NPC_LEVEL_CRIT_MOD[levelDifference];// 0.03f + 0.006f * levelDifference; yellowCritDepression = StatConversion.NPC_LEVEL_CRIT_MOD[levelDifference];// 0.006f * levelDifference; UpdateCalcs(true); SetManaRegen(); _rotation = new Priorities(this, _calcOpts, _bossOpts, _character, _stats, _talents); _rotation.CalculateAbilities(); UpdateCalcs(false); // second pass to revise calcs based on new ability cooldowns }
public static void SubmitMaintenanceRequest(string name, string desc, DateTime issueDate, Property property, Statuses status, List<Tenant> tenantsInvolved, RequestorTypes requestedBy, double estimatedCost, DateTime ealiestDue, DateTime latestDue, Priorities priority, TimeSpan estimatedTimeTaken) { Occurence.Occurences.Add(new MaintenanceItem(name, desc, issueDate, property, status, tenantsInvolved, requestedBy, estimatedCost, ealiestDue, latestDue, priority, estimatedTimeTaken,false)); }
private string getPriorityUrl(Priorities priority) { StringBuilder sb = new StringBuilder(); sb.Append(POSTURL); switch (priority) { case Priorities.Top: sb.Append("topPrio"); break; case Priorities.Bottom: sb.Append("bottomPrio"); break; case Priorities.Increase: sb.Append("increasePrio"); break; case Priorities.Decrease: sb.Append("decreasePrio"); break; default: throw new KeyNotFoundException($@"The qBitTorrent priority ""{priority}"" was not recognized."); break; } return sb.ToString(); }
public Task<object> Ask(object message, ActorReference source, Priorities priority = Priorities.Normal) { return ActorSystem.Ask (this, message, source, priority); }
/// <summary> /// Initializes a new instance of the <see cref="TestTrackItem"/> class. /// </summary> /// <param name="SoapRow"> /// The soap row. /// </param> public TestTrackItem(CRecordRowSoap SoapRow) { if (SoapRow.row[0].value == null) { this._RecordId = 0; } else { this._RecordId = Convert.ToInt64(SoapRow.row[0].value); } if (SoapRow.row[1].value == null) { this.Number = 0; } else { this.Number = Convert.ToInt64(SoapRow.row[1].value); } this._Priority = SoapToTestTrack.GetPriorityFromString(SoapRow.row[2].value); this._Status = SoapToTestTrack.GetDefectStatusFromString(SoapRow.row[3].value); if (SoapRow.row[5].value == null) { this._Origin = string.Empty; } else { this._Origin = SoapRow.row[5].value; } if (SoapRow.row[6].value == null) { this._Team = string.Empty; } else { this._Team = SoapRow.row[6].value; } if (SoapRow.row[7].value == null) { this._DateEntered = string.Empty; } else { this._DateEntered = SoapRow.row[7].value; } if (SoapRow.row[8].value == null) { this._DateModified = string.Empty; } else { this._DateModified = SoapRow.row[8].value; } if (SoapRow.row[9].value == null) { this._DateAssigned = string.Empty; } else { this._DateAssigned = SoapRow.row[9].value; } if (SoapRow.row[10].value == null) { this._Summary = string.Empty; } else { this._Summary = SoapRow.row[10].value; } if (SoapRow.row[11].value == null) { this._Type = string.Empty; } else { this._Type = SoapRow.row[11].value; } this._ReleaseBlocker = SoapToTestTrack.GetReleaseBlockerFromString(SoapRow.row[12].value); if (SoapRow.row[13].value == null) { this._Segment = string.Empty; } else { this._Segment = SoapRow.row[13].value; } }