public virtual void Update() { if (DeleteStarted) { return; } RemoveList.Clear(); RemoveList = SimpleTimers.ToList().Where(tmr => tmr?.IsCompleted).Select(tmr => { SimpleTimers.Remove(tmr); return(tmr); }).ToList(); if (PlayerObjects.Count > 0) { Time = 60000; } if (Closeable && PlayerObjects.Count == 0 && !(this is Realm)) { Time -= 1000 / Program.Manager.LogicTicker.TPS; if (Time <= 0) { Time = 60000; Delete(); // another method whose i'm clueless what is this } } HandleObjects(); }
public ActionResult ConfirmRemoval() { List <String> removelistname = new List <String>(); List <String> removelistid = new List <String>(); TempData["StudentRemovalID"] = TempData["StudentRemovalID"]; TempData["StudentRemovalName"] = TempData ["StudentRemovalName"]; foreach (var i in (dynamic)TempData["StudentRemovalName"]) { removelistname.Add(i.ToString()); } foreach (var i in (dynamic)TempData["StudentRemovalID"]) { removelistid.Add(i.ToString()); } List <ConfirmRemoval> Student = new List <ConfirmRemoval>(); for (int i = 0; i < removelistid.Count; i++) { Student.Add(new ConfirmRemoval() { StudentID = removelistid[i], StudentName = removelistname[i] }); } RemoveList CL = new RemoveList(); CL.ViewRemoveList = Student; return(View(CL)); }
public ActionResult ConfirmRemove() { Session["LecID"] = Session["LecID"]; List <String> removelistname = new List <String>(); List <String> removelistid = new List <String>(); TempData["RemovalPuzzleID"] = TempData["RemovalPuzzleID"]; TempData["RemovalPuzzleName"] = TempData["RemovalPuzzleName"]; foreach (var i in (dynamic)TempData["RemovalPuzzleName"]) { removelistname.Add(i.ToString()); } foreach (var i in (dynamic)TempData["RemovalPuzzleID"]) { removelistid.Add(i.ToString()); } List <ConfirmRemoval> Puzzle = new List <ConfirmRemoval>(); for (int i = 0; i < removelistid.Count; i++) { Puzzle.Add(new ConfirmRemoval() { StudentID = removelistid[i], StudentName = removelistname[i] }); } RemoveList CL = new RemoveList(); CL.ViewRemoveList = Puzzle; return(View(CL)); }
public void Update(Object[] args) { if (StartMethod != null) { foreach (var instance in StartList) { var node = instance.Node; if (node != null && node.IsEnabled()) { if (node.Scene != null) { StartMethod.Invoke(instance, null); } } } // TODO: need to handle delayed starts when node isn't enabled StartList.Clear(); } if (UpdateMethod != null) { foreach (var instance in Instances) { bool remove = false; var node = instance.Node; if (node != null && node.IsEnabled()) { if (node.Scene != null) { UpdateMethod.Invoke(instance, args); } else { remove = true; } } else { remove = true; } if (remove) { RemoveList.Add(instance); } } } foreach (var instance in RemoveList) { Instances.Remove(instance); } RemoveList.Clear(); }
public ActionResult ConfirmRemoval(String action, RemoveList cl) { if (action.Equals("home")) { return(RedirectToAction("HomeLec", "HomeLec")); } else if (action.Equals("back")) { return(RedirectToAction("ManageClass")); } else if (action.Equals("remove")) { List <String> removelistname = new List <String>(); List <String> removelistid = new List <String>(); foreach (var item in cl.ViewRemoveList) { removelistid.Add(item.StudentID); } string connectionString = @"Data Source=msi;Initial Catalog=SEFASSIGNMENT;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"; System.Data.SqlClient.SqlConnection sqlConnection = new System.Data.SqlClient.SqlConnection(connectionString); System.Data.SqlClient.SqlCommand sqlCommand; int tempcounter; sqlConnection.Open(); for (int i = 0; i < removelistid.Count; i++) { sqlCommand = new System.Data.SqlClient.SqlCommand("Delete from [SEFASSIGNMENT].[dbo].[Comment] WHERE \"STU_ID\" = '" + removelistid[i] + "'"); sqlCommand.Connection = sqlConnection; tempcounter = sqlCommand.ExecuteNonQuery(); sqlCommand = new System.Data.SqlClient.SqlCommand("Delete from [SEFASSIGNMENT].[dbo].[Topic] WHERE \"STU_ID\" = '" + removelistid[i] + "'"); sqlCommand.Connection = sqlConnection; tempcounter = sqlCommand.ExecuteNonQuery(); sqlCommand = new System.Data.SqlClient.SqlCommand("Delete from [SEFASSIGNMENT].[dbo].[Attempt] WHERE \"STU_ID\" = '" + removelistid[i] + "'"); sqlCommand.Connection = sqlConnection; tempcounter = sqlCommand.ExecuteNonQuery(); sqlCommand = new System.Data.SqlClient.SqlCommand("Delete from [SEFASSIGNMENT].[dbo].[Student] WHERE \"STU_ID\" = '" + removelistid[i] + "'"); sqlCommand.Connection = sqlConnection; tempcounter = sqlCommand.ExecuteNonQuery(); } TempData["AlertMessage"] = "Removal successful"; return(RedirectToAction("ManageClass")); } return(View()); }
// BULLET MOVEMENT void MoveBullets() { foreach (Bullet b in Bullets) { b.LastPos = b.Pos; b.Pos += b.Direction * GunStats.Speed; b.TimeAlive -= Time.deltaTime; if (b.TimeAlive < 0) { RemoveList.Add(b); } } }
protected void Page_Init(object sender, EventArgs e) { using (WebhostEntities db = new WebhostEntities()) { StudentSelector.DataSource = StudentListItem.GetDataSource(db.Students.Where(s => s.isActive).Select(s => s.ID).ToList()); StudentSelector.DataTextField = "Text"; StudentSelector.DataValueField = "ID"; StudentSelector.DataBind(); RemoveList.DataSource = StudentListItem.GetDataSource(GroupIds); RemoveList.DataTextField = "Text"; RemoveList.DataValueField = "ID"; RemoveList.DataBind(); } }
public string[] DumpToStringArray() { var list = new List <string>(); list.Add($"AccountName={AccountName}"); list.Add($"AccountKey={AccountKey}"); list.Add($"FileSystem={FileSystem}"); list.Add($"StartingPath={StartingPath}"); list.Add($"ExitAfter={ExitAfter}"); list.Add($"Parallelism={Parallelism}"); list.Add($"ACL:"); ACL?.ToList().ForEach(x => list.Add($" - {x}")); list.Add($"RemoveList:"); RemoveList?.ToList().ForEach(x => list.Add($" - {x}")); return(list.ToArray()); }
protected void LoadTable() { using (WebhostEntities db = new WebhostEntities()) { SelectedTable.Rows.Clear(); if (GroupIds.Count == 0) { RemoveBtn.Visible = false; RemoveList.Visible = false; return; } foreach (int id in GroupIds) { Faculty faculty = db.Faculties.Where(f => f.ID == id).Single(); TableRow row = new TableRow(); TableCell cell = new TableCell(); Label lbl = new Label() { Text = String.Format("{0} {1}", faculty.FirstName, faculty.LastName) }; cell.Controls.Add(lbl); row.Cells.Add(cell); SelectedTable.Rows.Add(row); } RemoveList.Visible = true; RemoveBtn.Visible = true; /* RemoveList.DataSource = (from faculty in db.Faculties.Where(f => GroupIds.Contains(f.ID)) * orderby faculty.LastName, faculty.FirstName * select new * { * Name = faculty.FirstName + " " + faculty.LastName, * ID = faculty.ID * }).ToList();*/ RemoveList.DataSource = FacultyListItem.GetDataSource(GroupIds); RemoveList.DataTextField = "Text"; RemoveList.DataValueField = "ID"; RemoveList.DataBind(); } }
public void AddList(string listName) { listName = listName.Trim(); Debug.Log(listName + "yelp"); if (listName != "" && !IsDuplicateListName(listName) && listName != "\n") { GameObject temp = Instantiate(listPrefab, parentList.transform); SelectList selectListComp = temp.GetComponent <SelectList>(); RemoveList removeListComp = temp.GetComponentInChildren <RemoveList>(); List <string> list = new List <string>(); SpellingList newSpellList = new SpellingList(list, listName, masterList.Count); temp.GetComponentInChildren <Text>().text = listName; selectListComp.spellList = newSpellList; removeListComp.spellList = newSpellList; masterList.Add(newSpellList); gameData.UpdateMasterList(masterList); SelectList(newSpellList, temp); SaveLoadManager.Save(gameData); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { using (WebhostEntities db = new WebhostEntities()) { TagSelectionCB.DataSource = db.WebPageTags.ToList(); TagSelectionCB.DataTextField = "Name"; TagSelectionCB.DataValueField = "id"; TagSelectionCB.DataBind(); RemoveList.DataSource = db.WebPageTags.Where(p => GroupIds.Contains(p.id)).ToList(); RemoveList.DataTextField = "Name"; RemoveList.DataValueField = "id"; RemoveList.DataBind(); } } LoadTable(); }
// BULLET COLLISION void CheckColisions() { foreach (Bullet b in Bullets) { Ray ray = new Ray(b.LastPos, b.Direction); RaycastHit hit; if (Physics.Raycast(ray, out hit, Vector3.Distance(b.LastPos, b.Pos), CollisionLayer.value)) { b.Collision = hit.point; GameObject colParticle = Player_Controller.GetColParticle; colParticle.transform.position = hit.point; colParticle.transform.rotation = Quaternion.LookRotation(hit.normal); RemoveList.Add(b); if (hit.collider.GetComponent <Damageable>()) { hit.collider.GetComponent <Damageable>().Damage(); } } } RemoveBullet(); }
public virtual void Update() { if (DeleteStarted) { return; //delete tolereance } RemoveList.Clear(); //Handle timers RemoveList = SimpleTimers.ToList().Where(x => x != null && x.Update()).ToList(); if (RemoveList.Count > 0) { foreach (SimpleTimer timer in RemoveList) { try { SimpleTimers.Remove(timer); } catch { } } } if (PlayerObjects.Count > 0) { Time = 60000; } if (Closeable && PlayerObjects.Count == 0 && !(this is Realm)) { Time -= 1000 / Program.Manager.LogicTicker.TPS; if (Time <= 0) { Time = 60000; Delete(); } } HandleObjects(); }
protected void LoadTable() { using (WebhostEntities db = new WebhostEntities()) { SelectedTable.Rows.Clear(); if (GroupIds.Count == 0) { RemoveBtn.Visible = false; RemoveList.Visible = false; return; } foreach (int id in GroupIds) { WebPageTag tag = db.WebPageTags.Where(f => f.id == id).Single(); TableRow row = new TableRow(); TableCell cell = new TableCell(); Label lbl = new Label() { Text = tag.Name }; cell.Controls.Add(lbl); row.Cells.Add(cell); SelectedTable.Rows.Add(row); } RemoveList.Visible = true; RemoveBtn.Visible = true; RemoveList.DataSource = db.WebPageTags.Where(p => GroupIds.Contains(p.id)).ToList(); RemoveList.DataTextField = "Name"; RemoveList.DataValueField = "id"; RemoveList.DataBind(); } }
protected void LoadTable() { using (WebhostEntities db = new WebhostEntities()) { SelectedTable.Rows.Clear(); if (GroupIds.Count == 0) { RemoveBtn.Visible = false; RemoveList.Visible = false; return; } foreach (int id in GroupIds) { Student Student = db.Students.Where(f => f.ID == id).Single(); TableRow row = new TableRow(); TableCell cell = new TableCell(); Label lbl = new Label() { Text = String.Format("{0} {1} ({2})", Student.FirstName, Student.LastName, Student.GraduationYear) }; cell.Controls.Add(lbl); row.Cells.Add(cell); SelectedTable.Rows.Add(row); } RemoveList.Visible = true; RemoveBtn.Visible = true; RemoveList.DataSource = StudentListItem.GetDataSource(GroupIds); RemoveList.DataTextField = "Text"; RemoveList.DataValueField = "ID"; RemoveList.DataBind(); } }
public bool BorrarDeLista(DescripcionAlarma da) { if (lstAlarms.InvokeRequired) { RemoveList d = new RemoveList(BorrarDeLista); if (parent.Status != UBSLib.UBSModuleStatus.Closing && parent.Status != UBSLib.UBSModuleStatus.Closed) { return((bool)this.Invoke(new Func <bool>(() => d(da)))); } else { return(true); } } else { try { if (parent.Status != UBSLib.UBSModuleStatus.Closing && parent.Status != UBSLib.UBSModuleStatus.Closed) { if (lstAlarms.Items.Contains(da)) { lstAlarms.Items.Remove(da); return(true); } return(false); } return(true); } catch (Exception e) { parent.Error("Error al borrar la alarma de la lista. " + e.Message, true, false); return(false); } } }