IEnumerator SpawnLevelPart(GameObject levelPart) { if (lInGameLevelsPart.Count < nbMaxLevelPartInGame) { GameObject LV; LV = Instantiate(levelPart); LV.transform.position = lInGameLevelsPart[lInGameLevelsPart.Count - 1].GetComponentInChildren <EndOfLevel>().transform.position; foreach (GameObject tilemap in LV.GetComponent <LevelPart>().TileMaps) { tilemap.GetComponent <Tilemap>().color = new Color(0.35f + brightness - blueness, 0.35f + brightness, 0.35f + brightness, 255f); } if (brightness + 0.025f <= 0.65f) { brightness += 0.025f; } else if (blueness < 0.5f) { blueness += 0.01f; brightness = 0.65f; } else { brightness = 0.65f; blueness = 0.5f; } SpawnEnemiesFollowingDifficulty(LV); lInGameLevelsPart.Add(LV); } isAlreadySpawning = false; yield return(null); }
private void ResetViewers() { // Clear the entire right-hand pane this.pnlNoViewers.Visible = false; this.tabViewers.Visible = false; // Reset the viewer tabs this.tabViewers.TabPages.Clear(); this.pnlGeneralContents.Controls.Clear(); if (this.ListViewTabs_ != null) { this.ListViewTabs_.TabPages.Clear(); } this.ListViewTabs_ = null; // Reset all applicable viewer tab contents foreach (ListView LV in this.ListViews_.Values) { LV.Clear(); } this.ListViews_.Clear(); this.ListIcons_.Images.Clear(); this.chkShowIcons.Checked = false; this.btnThingListSaveImages.Enabled = false; this.cmbItems.Items.Clear(); this.cmbImageChooser.Items.Clear(); this.picImageViewer.Image = null; this.picImageViewer.Tag = null; }
private void Find_Click(object sender, RoutedEventArgs e) { if (_findWindow == null) { if (LV.Items.Count == 0) { return; } _findWindow = new FindWindow(); _findWindow.Owner = this; _findWindow.Left = Left + App.Current.Settings.FindLeft; _findWindow.Top = Top + App.Current.Settings.FindTop; _findWindow.FindingNext += (s, e2) => DoFind(true); _findWindow.FindingPrev += (s, e2) => DoFind(false); _findWindow.LocationChanged += (s, e2) => SaveSettings(); _findWindow.IsVisibleChanged += (s, e2) => { if (false.Equals(e2.NewValue)) { LV.Focus(); } }; } _findWindow.Show(); _findWindow.Searches.Focus(); }
public void Disconnected() { if (LV != null) { Program.form1.Invoke((MethodInvoker)(() => { try { lock (Settings.LockListviewClients) LV.Remove(); if (LV2 != null) { lock (Settings.LockListviewThumb) LV2.Remove(); } } catch { } SoundPlayer sp = new SoundPlayer(Server.Properties.Resources.offline); sp.Load(); sp.Play(); new HandleLogs().Addmsg($"Client {Ip} disconnected.", Color.Red); })); } try { SslClient?.Dispose(); TcpClient?.Dispose(); } catch { } }
public void Disconnected() { try { if (LV != null) { if (Program.form1.listView1.InvokeRequired) { Program.form1.listView1.BeginInvoke((MethodInvoker)(() => { LV.Remove(); })); } lock (Settings.Online) Settings.Online.Remove(this); } } catch { } try { if (ClientSocket.Connected) { ClientSocket.Shutdown(SocketShutdown.Both); } } catch { } try { ClientSocket?.Dispose(); ClientMS?.Dispose(); } catch { } }
public void Disconnected() { if (LV != null) { Program.form1.Invoke((MethodInvoker)(() => { try { lock (Settings.LockListviewClients) LV.Remove(); if (LV2 != null) { lock (Settings.LockListviewThumb) LV2.Remove(); } } catch { } new HandleLogs().Addmsg($"Client {Ip} disconnected", Color.Red); })); } try { SslClient?.Dispose(); TcpClient?.Dispose(); } catch { } }
public void Disconnected() { if (LV != null) { Program.form1.BeginInvoke((MethodInvoker)(() => { try { lock (Settings.LockListviewClients) LV.Remove(); if (LV2 != null) { lock (Settings.LockListviewThumb) LV2.Remove(); } } catch { } })); new HandleLogs().Addmsg($"Client {TcpClient.RemoteEndPoint.ToString().Split(':')[0]} disconnected", Color.Red); } try { SslClient?.Dispose(); TcpClient?.Dispose(); ClientMS?.Dispose(); } catch { } }
public void AddTrace(TraceEvent evt) { if (evt == null || evt.ProcessName == null) { return; } if (App.Current.Settings.ExcludeLine(evt.Text, evt.ProcessName)) { return; } var last = _dataSource.LastOrDefault(); evt.PreviousTicks = last != null ? last.Ticks : evt.Ticks; _dataSource.Add(evt); if (_state.AutoScroll) { // only ask to scroll if nothing is scrolling _scrollTo = evt; if (Interlocked.CompareExchange(ref _scrollingTo, 1, 0) == 0) { Dispatcher.BeginInvoke(() => { var st = _scrollTo; if (st != null) { LV.ScrollIntoView(st); } Interlocked.Exchange(ref _scrollingTo, 0); }, DispatcherPriority.SystemIdle); } } }
public void RedrawFocusedItem() { if (LV.FocusedItem != null) { int focusedIndex = LV.FocusedItem.Index; LV.RedrawItems(focusedIndex, focusedIndex, false); } }
public Status(string n) { _name = n; _hp = new HP(100, 100, 0); _atc = new ATC(999, 10, 0); _exp = new EXP(100, 0, 0); _lv = new LV(99, 1, 0); }
protected void CreateUserWizard1_OnCreatedAdmin(object sender, EventArgs e) { var createAdminWizard = LV.FindControl("_CreateAdminWizard") as CreateUserWizard; if (createAdminWizard != null) { Roles.AddUserToRole(createAdminWizard.UserName, "Admin"); } }
private void OnColumnLayoutPropertyChanged(object sender, PropertyChangedEventArgs e) { var panel = LV.FindVisualChild <VirtualizingStackPanel>(); foreach (var item in panel.EnumerateVisualChildren(true).OfType <TraceEventElement>()) { item.InvalidateMeasure(); item.InvalidateVisual(); } }
private void SorotLV() { for (int i = 0; i < LV.Items.Count; i++) { if (LV.Items[i].Text == KendaliParameter.akunAktif) { LV.Items[i].Selected = true; LV.Select(); break; } } }
private void listview() { LV.Clear(); LV.View = View.Details; LV.Columns.Add("Name of process", 80); LV.Columns.Add("Arriving time", 80); LV.Columns.Add("Duration of Execution", 80); LV.Columns.Add("Start", 80); LV.Columns.Add("Done", 80); LV.Columns.Add("Wait", 80); LV.Columns.Add("TA", 80); LV.GridLines = true; }
void ScanOutput(IPAddressHelper.ScanResult result) { if (InvokeRequired) { BeginInvoke((MethodInvoker)(() => { ScanOutput(result); })); } else { LV.BeginUpdate(); LV.Items.Add(new ResultItem(result)); LV.EndUpdate(); } }
protected void AddActivityButton_OnClick(object sender, EventArgs e) { var calendar = LV.FindControl("GCalendar") as Calendar; Debug.Assert(calendar != null, nameof(calendar) + " != null"); if (calendar.SelectedDate == DateTime.MinValue) { StatusMsg.Text = "No date added!"; return; } var name = LV.FindControl("ANameTB") as TextBox; var desc = LV.FindControl("ADescTB") as TextBox; //StatusMsg.Text=calendar.SelectedDate.ToString(); string gid = Server.UrlDecode(Request.Params["gid"]); try { SqlConnection con = new SqlConnection( @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|Groups.mdf;Integrated Security=True;User Instance=False"); con.Open(); try { string cQuery = "INSERT INTO Activities" + " (ActivityName, ActivityDate, ActivityDescription, GroupId)" + " VALUES (@aname, @adate, @adesc, @gid)"; SqlCommand cmd = new SqlCommand(cQuery, con); Debug.Assert(name != null, nameof(name) + " != null"); cmd.Parameters.AddWithValue("aname", name.Text); cmd.Parameters.AddWithValue("adate", calendar.SelectedDate); Debug.Assert(desc != null, nameof(desc) + " != null"); cmd.Parameters.AddWithValue("adesc", desc.Text); cmd.Parameters.AddWithValue("gid", gid); cmd.ExecuteNonQuery(); } catch (Exception exception) { StatusMsg.Text = exception.Message; } finally { con.Close(); } } catch (Exception exception) { StatusMsg.Text = exception.Message; } Response.Redirect("GroupPage.aspx?gid=" + Server.UrlEncode(gid)); }
private void LV_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left && m_CanDrag) { m_CanDrag = false; var obj = new DataObject(); obj.SetText(m_CopyHelper.GetSelectedText(), TextDataFormat.UnicodeText); if (App.MainPages.CanSendToNewTab()) { obj.SetData(m_CopyHelper.GetType(), m_CopyHelper); } LV.DoDragDrop(obj, DragDropEffects.Copy); } }
private void DoFind(bool next) { if (_findWindow == null) { return; } var search = _findWindow.Searches.Text; if (string.IsNullOrWhiteSpace(search)) { return; } var focused = FocusManager.GetFocusedElement(_findWindow) is System.Windows.Controls.TextBox; int start = Math.Max(0, LV.SelectedIndex); var sc = _findWindow.CaseMatch ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; foreach (int i in EnumerateItems(start, next)) { var evt = (TraceEvent)LV.Items[i]; if (evt.Text == null) { continue; } if (evt.Text.IndexOf(search, sc) > 0) { LV.SelectedItem = evt; ((System.Windows.Controls.ListViewItem)LV.ItemContainerGenerator.ContainerFromItem(evt))?.Focus(); LV.ScrollIntoView(evt); if (focused) { if (next) { _findWindow.FindNext.Focus(); } else { _findWindow.FindPrev.Focus(); } } _findWindow.Searches.SelectedItem = search; return; } } _findWindow.ShowMessage("Cannot find '" + search + "'.", MessageBoxImage.Information); }
private void LV_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left && e.Clicks == 1) { var hitInfo = LV.HitTest(e.Location); if (hitInfo.Item != null && hitInfo.Item.Selected) { SetupCopyHelper(); if (m_CopyHelper.Indexes.Count > 0) { m_CanDrag = true; } } } }
public void MFSetup() { TestLingVars = new List <LinguisticVariable>(); UnityEngine.Object[] jsonLing = Resources.LoadAll( "TestLinguistics", typeof(TextAsset)); foreach (TextAsset asset in jsonLing) { TestLingVars.Add(LinguisticVariable.fromJson(asset.text)); } foreach (LinguisticVariable LV in TestLingVars) { LV.Fuzzification(fuzzificationTestValue); } }
List <List <int> > CreatedoubleConstraintsBetween3Param(List <Value> LV1, List <Value> LV2, List <Value> LV3) { List <List <int> > TmpdoubleConstraintsList = CreateSingleConstraintsBetween2Param(LV1, LV2); List <List <int> > DoubleConstraintsList = new List <List <int> >(); foreach (Value V3 in LV3) { foreach (List <int> LV in TmpdoubleConstraintsList) { LV.Add(V3.Val_id); List <int> TmpLV = new List <int>(); TmpLV.AddRange(LV); DoubleConstraintsList.Add(TmpLV); LV.Remove(V3.Val_id); } } return(DoubleConstraintsList); }
public void Disconnected() { if (LV != null) { if (Program.form1.listView1.InvokeRequired) { Program.form1.listView1.BeginInvoke((MethodInvoker)(() => { try { lock (Settings.Listview1Lock) LV.Remove(); if (LV2 != null) { lock (Settings.Listview3Lock) LV2.Remove(); } } catch { } })); } lock (Settings.Online) Settings.Online.Remove(this); } try { TcpClient.Shutdown(SocketShutdown.Both); } catch { } try { SslClient?.Close(); TcpClient?.Close(); SslClient?.Dispose(); TcpClient?.Dispose(); ClientMS?.Dispose(); } catch { } }
public void FocusListView() { ActiveControl = LV; if (LV.FocusedItem != null) { if (!LV.FocusedItem.Selected) { LV.FocusedItem.Selected = true; } } else if (LV.VirtualListSize > 0) { // TODO need select item with index 0 LV.Items[0].Selected = true; LV.Select(); } DoFocusedItemChanged(); }
public void Disconnected() { if (LV != null) { Program.form1.Invoke((MethodInvoker)(() => { try { lock (Settings.LockListviewClients) LV.Remove(); if (LV2 != null) { lock (Settings.LockListviewThumb) LV2.Remove(); } } catch { } new HandleLogs().Addmsg($"Client {Ip} disconnected.", Color.Red); TimeZoneInfo local = TimeZoneInfo.Local; if (local.Id == "China Standard Time" && Properties.Settings.Default.Notification == true) { SoundPlayer sp = new SoundPlayer(Server.Properties.Resources.offline); sp.Load(); sp.Play(); } foreach (AsyncTask asyncTask in Form1.getTasks.ToList()) { asyncTask.doneClient.Remove(ID); } })); } try { SslClient?.Dispose(); TcpClient?.Dispose(); } catch { } }
public void Disconnected() { if (LV != null) { if (Program.form1.listView1.InvokeRequired) { Program.form1.listView1.BeginInvoke((MethodInvoker)(() => { LV.Remove(); })); } } Settings.Online.Remove(this); try { MS?.Dispose(); Client?.Close(); Client?.Dispose(); } catch { } }
public void ShowData(bool SetFirstColumnAsPrimaryKey = false) { LV.Clear(); if (!CheckCondition()) { return; } MakeCommandText(); if (table != null) { table.Clear(); } adapter.Fill(dataset, "Tab"); table = dataset.Tables["Tab"]; if (SetFirstColumnAsPrimaryKey) { table.PrimaryKey = new DataColumn[] { table.Columns[0] } } ; GenerateHeader(); LoadData(); RenderRowColor(); }
public ActionResult Index(DateTime?beginTime, DateTime?endTime, string orgid, int pageIndex = 1, int pageSize = 20, bool export = false) { CHK_AUTH(); //判断权限 base.DateTimeInit(ref beginTime, ref endTime); //时间初始化 ViewBag.beginTime = beginTime == null ? "" : beginTime.Value.ToString("yyyy-MM-dd"); ViewBag.endTime = endTime == null ? "" : endTime.Value.ToString("yyyy-MM-dd"); ViewBag.NAM = LV.ToString(); var userorg = DalUser.GetUserORG(UserState.UserID); ViewBag.UserORG = new SelectList(userorg.Where(obj => obj.ORG_LEVEL == 4) , "ORG_ID", "ORG_NAM", orgid); if (LV == ENUM_STATLV.省市) { ViewBag.NAMLink = "/STAT/StatStaffCall?t=2";//如果是省级,点击进入市级 } if (LV == ENUM_STATLV.务厅) { ViewBag.NAMLink = "/STAT/StatStaffCall?t=3";//如果是省级,点击进入员工报表 } string subTitle = GetStatTitle(orgid, beginTime, endTime); ViewBag.subTitle = subTitle; List <dynamic> data = null; if (LV == ENUM_STATLV.省市) { data = new STAT_STAFF_BUSI_TOT_D_DAL().Q_STATDATA_GROUP_CITY(null, beginTime, endTime); } if (LV == ENUM_STATLV.务厅) { var halllist = new SYS_HALL_DAL().GetOrgHallAndChild(orgid).ToArray(); data = new STAT_STAFF_BUSI_TOT_D_DAL().Q_STATDATA_GROUP_HALL(halllist, beginTime, endTime); } if (LV == ENUM_STATLV.员工) { var halllist = new SYS_HALL_DAL().GetOrgHallAndChild(orgid).ToArray(); data = new STAT_STAFF_BUSI_TOT_D_DAL().Q_STATDATA_GROUP_STAFF(halllist, beginTime, endTime); } if (export)//导出 { return(ExportData(StatNAM + "-" + LV.ToString(), subTitle, data)); } else { DataSet ds = new DataSet(); DataTable dt = new DataTable(); ds.Tables.Add(dt); dt.Columns.Add("NAM", typeof(string)); dt.Columns.Add("呼叫量,P", typeof(string)); dt.Columns.Add("办理量,P", typeof(string)); dt.Columns.Add("弃号量,S", typeof(string)); foreach (var item in data) { DataRow r = dt.NewRow(); r["NAM"] = item.NAM; r["呼叫量,P"] = item.CALL_CNT + ";JavaScript:showCNT(\\\"CALLCNT\\\", \\\"" + Request.QueryString["orgid"] + "\\\")"; r["办理量,P"] = item.HANDLE_CNT + ";JavaScript:showCNT(\\\"HANDLECNT\\\", \\\"" + Request.QueryString["orgid"] + "\\\")"; r["弃号量,S"] = item.ABANDON_CNT + ";JavaScript:showCNT(\\\"ABANDONCNT\\\", \\\"" + Request.QueryString["orgid"] + "\\\")"; dt.Rows.Add(r); } subTitle = subTitle.Replace("<span style='font-size:12px;'>", "") .Replace("</span>", "").Replace(StatNAM, ""); ViewBag.ChartColumn3DXML = CreateMSColumn3DChart(StatNAM, ds.Tables[0], 420, subTitle, true); ViewBag.ChartSplineXML = CreateMSSplineChart(StatNAM, ds, 420, null, null, subTitle); var page = new Page <dynamic>() { Items = data.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(), ItemsPerPage = pageSize, CurrentPage = pageIndex, TotalItems = data.Count }; return(View("Index", page)); } }
public void RedrawItem(int index) { LV.RedrawItems(index, index, true); }
protected void btnUpdateImageSpecs_Click(object sender, EventArgs e) { Image_Physical_Specs ips = new Image_Physical_Specs(); try { ips = JsonConvert.DeserializeObject <Image_Physical_Specs>(image.ClientSize); } catch { return; } int rowCounter = 0; foreach (GridViewRow row in gvHDs.Rows) { CheckBox box = row.FindControl("chkHDActive") as CheckBox; if (box.Checked) { ips.hd[rowCounter].active = "1"; } else { ips.hd[rowCounter].active = "0"; } GridView gvParts = (GridView)row.FindControl("gvParts"); int partCounter = 0; foreach (GridViewRow partRow in gvParts.Rows) { CheckBox boxPart = partRow.FindControl("chkPartActive") as CheckBox; if (boxPart.Checked) { ips.hd[rowCounter].partition[partCounter].active = "1"; } else { ips.hd[rowCounter].partition[partCounter].active = "0"; } TextBox txtCustomSize = partRow.FindControl("txtCustomSize") as TextBox; if (!string.IsNullOrEmpty(txtCustomSize.Text)) { string customSize_BLK = (Convert.ToInt64(txtCustomSize.Text) * 1024 * 1024 / Convert.ToInt32(ips.hd[rowCounter].lbs)).ToString(); ips.hd[rowCounter].partition[partCounter].size_override = customSize_BLK; } GridView gvVG = (GridView)partRow.FindControl("gvVG"); foreach (GridViewRow vg in gvVG.Rows) { GridView gvLVS = (GridView)vg.FindControl("gvLVS"); int lvCounter = 0; foreach (GridViewRow LV in gvLVS.Rows) { CheckBox boxLv = LV.FindControl("chkPartActive") as CheckBox; if (boxLv.Checked) { ips.hd[rowCounter].partition[partCounter].vg.lv[lvCounter].active = "1"; } else { ips.hd[rowCounter].partition[partCounter].vg.lv[lvCounter].active = "0"; } TextBox txtCustomSizeLv = LV.FindControl("txtCustomSize") as TextBox; if (!string.IsNullOrEmpty(txtCustomSizeLv.Text)) { string customSize_BLK = (Convert.ToInt64(txtCustomSizeLv.Text) * 1024 * 1024 / Convert.ToInt32(ips.hd[rowCounter].lbs)).ToString(); ips.hd[rowCounter].partition[partCounter].vg.lv[lvCounter].size_override = customSize_BLK; } lvCounter++; } } partCounter++; } rowCounter++; } if (image.UpdateSpecs(image.Name, JsonConvert.SerializeObject(ips))) { Master.Msgbox("Successfully Updated Image Specs"); } else { Master.Msgbox("Could Not Update Image Specs"); } }
protected void Page_Load(object sender, EventArgs e) { int gid2 = 0; try { gid2 = int.Parse(Server.UrlDecode(Request.Params["gid"]) ?? throw new InvalidOperationException()); } catch (Exception exception) { Response.Redirect("~/UserPages/MyGroups.aspx"); Console.WriteLine(exception.Message + "\n"); } if (Request.Params["gid"] != null) { string gid = Server.UrlDecode(Request.Params["gid"]); int catId = 0; bool isMod = false; bool isMem = false; bool mem = false; try { SqlConnection con = new SqlConnection( @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|Groups.mdf;Integrated Security=True;User Instance=False"); con.Open(); try { // luam date despre grup din baza de date string groupQuery = "SELECT [GroupName], [GroupDescription], [CategoryId] " + "FROM [Groups] WHERE GroupId = @gid"; SqlCommand cmd = new SqlCommand(groupQuery, con); cmd.Parameters.AddWithValue("gid", gid); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { TitleLiteral.Text = reader["GroupName"].ToString(); GNameLiteral.Text = reader["GroupName"].ToString(); GDescLiteral.Text = reader["GroupDescription"].ToString(); catId = int.Parse(reader["CategoryId"].ToString()); } reader.Close(); // afisam categoria string cQuery = "SELECT [CategoryName] FROM [Categories] WHERE CategoryId = @catid"; SqlCommand cmd2 = new SqlCommand(cQuery, con); cmd2.Parameters.AddWithValue("catid", catId); reader = cmd2.ExecuteReader(); while (reader.Read()) { CategoryLiteral.Text = reader["CategoryName"].ToString(); } reader.Close(); // acum vedem daca userul este membru al grupului string glist = "SELECT [IsModerator], [IsMember] FROM GroupsLists WHERE UserName = @uname AND GroupId = @gid"; SqlCommand cmd3 = new SqlCommand(glist, con); cmd3.Parameters.AddWithValue("uname", User.Identity.Name); cmd3.Parameters.AddWithValue("gid", gid); reader = cmd3.ExecuteReader(); while (reader.Read()) { //var modCB = LV.FindControl("ModCB") as CheckBox; //var memberCB = LV.FindControl("MemberCB") as CheckBox; //modCB.Checked = mem = true; isMod = bool.Parse(reader["IsModerator"].ToString()); //memberCB.Checked = isMem = bool.Parse(reader["IsMember"].ToString()); } reader.Close(); if (isMem) { hidIsMem.Value = "true"; } // else { hidIsMem.Value = "false"; } if (isMod) { hidIsMod.Value = "true"; } // else { hidIsMod.Value = "false"; } if (mem) { hidMem.Value = "true"; } //LoadPosts(con, gid); // apoi afisam postarile, fisierele, activitatile var calendar = LV.FindControl("GCalendar") as Calendar; Debug.Assert(calendar != null, nameof(calendar) + " != null"); string aQuery = "SELECT ActivityDate" + " FROM Activities" + " WHERE GroupId = @gid"; SqlCommand acmd = new SqlCommand(aQuery, con); acmd.Parameters.AddWithValue("gid", gid); reader = acmd.ExecuteReader(); while (reader.Read()) { calendar.SelectedDates.Add(DateTime.Parse(reader["ActivityDate"].ToString())); } reader.Close(); } catch (Exception exception) { StatusMsg.Text += "\n" + exception.Message; } finally { con.Close(); } } catch (Exception ex) { StatusMsg.Text += "\n" + ex.Message; } HLMembers.NavigateUrl = "~/GroupMembers.aspx?gid=" + Server.UrlEncode(gid2.ToString()); } }