private void NameBox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { LB.PerformClick(); } }
// Update is called once per frame void Update() { if (passedInfo.lb && !casting && LBset) { LB.SendMessage("setStartCast"); LBset = false; casting = true; } else if (passedInfo.lt > .9 && !casting && LTset) { LT.SendMessage("setStartCast"); LTset = false; casting = true; } else if (passedInfo.rb && !casting && RBset) { RB.SendMessage("setStartCast"); RBset = false; casting = true; } else if (passedInfo.rt < -.9 && !casting && RTset) { RT.SendMessage("setStartCast"); RTset = false; casting = true; } }
/// <summary> /// Called when an object needs to removed from a list box /// </summary> /// <param name="selected"></param> /// <param name="listBox"></param> private void removeObject(object selected, LB listBox) { // Try... try { //listBox_unselected.Items.Remove(selected); // If the user has removed an object from the unselected list box... if (listBox == LB.UNSELECTED) { // Remove the selected object from unselected list box listBox_unselected.Items.Remove(selected); } // Otherwise they remove an object from the selected list box else { // Remove the selected object from selected list box listBox_selected.Items.Remove(selected); } } // Catch... catch (Exception) { } }
void FillEntrySubstitutions(Hashtable substitutions, DayEntry d, string blog_base, bool single_entry) { string category_paths = GetCategoryPaths(d, blog_base); string entry_path = LB.GetEntryPath(blog_base, d); substitutions.Add("@ENTRY_ID@", d.Id); substitutions.Add("@ENTRY_PATH@", entry_path); substitutions.Add("@ENTRY_PERMALINK@", d.PermaLink); substitutions.Add("@ENTRY_CAPTION@", d.Caption); substitutions.Add("@ENTRY_CAPTION_ENC@", HttpUtility.UrlEncode(d.Caption)); substitutions.Add("@BASEDIR@", config.BlogWebDirectory); substitutions.Add("@BASEIMAGES@", config.BlogImageBasedir); substitutions.Add("@COPYRIGHT@", config.Copyright); substitutions.Add("@ENTRY_CATEGORY@", d.Category); substitutions.Add("@ENTRY_DATECAPTION@", d.DateCaption); substitutions.Add("@ENTRY_CATEGORY_PATHS@", category_paths); substitutions.Add("@BLOGWEBDIR@", config.BlogWebDirectory); substitutions.Add("@ENTRY_URL_PERMALINK@", Path.Combine(config.BlogWebDirectory, d.PermaLink)); if (d.Comments && single_entry) { StringWriter rendered_comment = new StringWriter(new StringBuilder(comments.Length)); Translate(comments, rendered_comment, substitutions); substitutions.Add("@COMMENTS@", rendered_comment.ToString()); d.RenderedComment = rendered_comment.ToString(); } else { substitutions.Add("@COMMENTS@", ""); } }
public MessageControl() { InitializeComponent(); LB.SetBinding(ListBox.ItemsSourceProperty, new Binding { Source = this.MessageCollection }); }
private void UpdateButtons() { LT.UpdateState(CheckPressureActive(NativeState.Triggers.Left)); RT.UpdateState(CheckPressureActive(NativeState.Triggers.Right)); LT_Value = FilterPressureValue(NativeState.Triggers.Left); RT_Value = FilterPressureValue(NativeState.Triggers.Right); LB.UpdateState(NativeState.Buttons.LeftShoulder == ButtonState.Pressed); RB.UpdateState(NativeState.Buttons.RightShoulder == ButtonState.Pressed); DPad_Left.UpdateState(NativeState.DPad.Left == ButtonState.Pressed); DPad_Right.UpdateState(NativeState.DPad.Right == ButtonState.Pressed); DPad_Down.UpdateState(NativeState.DPad.Down == ButtonState.Pressed); DPad_Up.UpdateState(NativeState.DPad.Up == ButtonState.Pressed); A.UpdateState(NativeState.Buttons.A == ButtonState.Pressed); B.UpdateState(NativeState.Buttons.B == ButtonState.Pressed); X.UpdateState(NativeState.Buttons.X == ButtonState.Pressed); Y.UpdateState(NativeState.Buttons.Y == ButtonState.Pressed); StickL.UpdateState(NativeState.Buttons.LeftStick == ButtonState.Pressed); StickR.UpdateState(NativeState.Buttons.RightStick == ButtonState.Pressed); StickL_Value = new AxisValue(FilterPressureValue(NativeState.ThumbSticks.Left.X), FilterPressureValue(NativeState.ThumbSticks.Left.Y)); StickR_Value = new AxisValue(FilterPressureValue(NativeState.ThumbSticks.Right.X), FilterPressureValue(NativeState.ThumbSticks.Right.Y)); Start.UpdateState(NativeState.Buttons.Start == ButtonState.Pressed); Back.UpdateState(NativeState.Buttons.Back == ButtonState.Pressed); Guide.UpdateState(NativeState.Buttons.Guide == ButtonState.Pressed); }
/// <summary> /// Computes the next value of the following sub-indicators from the given state: /// StandardDeviation, MiddleBand, UpperBand, LowerBand, BandWidth, %B /// </summary> /// <param name="input">The input given to the indicator</param> /// <returns>The input is returned unmodified.</returns> protected override decimal ComputeNextValue(IndicatorDataPoint input) { BB.Update(input); LB.Add(BB.LowerBand); UB.Add(BB.UpperBand); return(BB.MiddleBand); }
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (LB.SelectedItem != null) { LB.ScrollIntoView(LB.SelectedItem); } }
private void RefreshFloor(int id = 0) { if (currentFloor == null) { currentFloor = bridge.DownloadFloor(2); } else if (id == 0) { currentFloor = bridge.DownloadFloor(currentFloor.GetId()); } else { currentFloor = bridge.DownloadFloor(id); } Scheme = currentFloor.Scheme; OriginalScheme = new Bitmap(currentFloor.Scheme); Floore_Scheme.Image = Scheme; DrawScheme(); Floor_Name.Text = currentFloor.FloorName; floors = Bridge.GiveValidFloor(); RefreshAllUseableFloor(); LB.Hide(); RefreshAllFloorList(); }
private void LB_SelectedIndexChanged(object sender, EventArgs e) { switch (LB.SelectedItem.ToString()) { case empty: { LB.Hide(); break; } case DeletePoint: { bridge.DeleteExhibitSpase(currentSpace.GetId()); LB.Hide(); RefreshFloor(); break; } case AddExhibit: { SetExhibit SE = new SetExhibit(currentSpace.GetId()); this.Hide(); SE.ShowDialog(); this.Show(); RefreshFloor(); break; } case ResetExhibit: { ResetExhibit RE = new ResetExhibit(currentSpace); this.Hide(); RE.ShowDialog(); this.Show(); RefreshFloor(); break; } default: { int id = GetSelectedItemID(LB.SelectedItem.ToString()); if (id == -1) { MessageBox.Show("Возникла ошибка!"); } else { Exponat exhib = new Exponat(new Exhibit(id), isAdmin); this.Hide(); exhib.ShowDialog(); if (isAdmin) { RefreshFloor(); } this.Show(); } break; } } }
public void RenderArchive() { for (int i = 0; i < Entries; i++) { DayEntry d = (DayEntry)entries [i]; string parent_dir = "../.."; if (d.Category.Length > 0) { parent_dir += Regex.Replace(d.Category, "[^/]+", ".."); } RenderHtml(Path.Combine(config.Prefix, d.PermaLink), entries.Count - i - 1, entries.Count - i, parent_dir, false); if (d.Images == null) { continue; } foreach (string filename in d.Images) { string file = Path.GetFileName(filename); string thumbnail = Path.Combine(LB.GetEntryPath(config.Prefix + "/", d), LB.GetThumbnailName(file)); string thumbnail_target = Path.Combine( LB.GetEntryPath(config.Prefix + "/", d), file); file = Path.Combine(config.ImageDirectory, filename); if (!File.Exists(file)) { Console.Error.WriteLine("lb: Missing file for #thumbnail {0}, ({1}).", filename, file); continue; } if (!File.Exists(thumbnail_target)) { File.Copy(file, thumbnail_target); } if (!File.Exists(thumbnail)) { ProcessStartInfo psi = new ProcessStartInfo(config.ThumbnailCommandFileName); psi.Arguments = string.Format(config.ThumbnailCommandArguments, file, thumbnail); Process p = Process.Start(psi); p.WaitForExit(); if (p.ExitCode != 0) { Console.Error.WriteLine("lb: error running command: {0} {1}", psi.FileName, psi.Arguments); } } } } foreach (DictionaryEntry de in category_entries) { string category = de.Key.ToString(); IList entries = (IList)de.Value; string parent_dir = ".." + Regex.Replace(category, "[^/]+", ".."); RenderHtml(Path.Combine(config.Prefix, "archive" + category + config.BlogFileName), parent_dir, entries, 0, entries.Count, false); } }
public ControllerXbox360(params int[] joystickId) { AddButton(Controls.A); AddButton(Controls.B); AddButton(Controls.X); AddButton(Controls.Y); AddButton(Controls.RB); AddButton(Controls.LB); AddButton(Controls.LStickClick); AddButton(Controls.RStickClick); AddButton(Controls.Start); AddButton(Controls.Back); AddButton(Controls.RT); AddButton(Controls.LT); AddButton(Controls.Up); AddButton(Controls.Down); AddButton(Controls.Left); AddButton(Controls.Right); AddAxis(Controls.LStick); AddAxis(Controls.RStick); AddAxis(Controls.DPad); AddAxis(Controls.Triggers); foreach (var joy in joystickId) { A.AddJoyButton(0, joy); B.AddJoyButton(1, joy); X.AddJoyButton(2, joy); Y.AddJoyButton(3, joy); LB.AddJoyButton(4, joy); RB.AddJoyButton(5, joy); Back.AddJoyButton(6, joy); Start.AddJoyButton(7, joy); LeftStickClick.AddJoyButton(8, joy); RightStickClick.AddJoyButton(9, joy); RT.AddAxisButton(AxisButton.ZMinus, joy); LT.AddAxisButton(AxisButton.ZPlus, joy); LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy); RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy); DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy); Triggers.AddJoyAxis(JoyAxis.Z, JoyAxis.Z, joy); Up .AddAxisButton(AxisButton.YMinus, joy) .AddAxisButton(AxisButton.PovYMinus, joy); Down .AddAxisButton(AxisButton.YPlus, joy) .AddAxisButton(AxisButton.PovYPlus, joy); Right .AddAxisButton(AxisButton.XPlus, joy) .AddAxisButton(AxisButton.PovXPlus, joy); Left .AddAxisButton(AxisButton.XMinus, joy) .AddAxisButton(AxisButton.PovXMinus, joy); } }
/// <summary> /// Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand, BandWidth, %B) /// </summary> public override void Reset() { BB.Reset(); LB.Reset(); UB.Reset(); base.Reset(); }
public void LoadLevels(Model_SaveData data) { levelBehaviors = transform.GetComponentsInChildren <Script_SaveLoadLevelBehavior>(true); foreach (Script_SaveLoadLevelBehavior LB in levelBehaviors) { LB.Load(data.runData); } }
//反填 public LB FanLB(int Id) { string sql = $"select * from HDliebiao where HDlbid={Id}"; var dt = DBHelper.ExecuteQuery(sql, System.Data.CommandType.Text); string str = JsonConvert.SerializeObject(dt); LB z = JsonConvert.DeserializeObject <List <LB> >(str).FirstOrDefault(); return(z); }
// Use this for initialization void Start() { LTset = RTset = LBset = RBset = true; casting = false; RT.SendMessage("setReturnTo", (int)setReturn.rt); LB.SendMessage("setReturnTo", (int)setReturn.lb); RB.SendMessage("setReturnTo", (int)setReturn.rb); LT.SendMessage("setReturnTo", (int)setReturn.lt); }
private void Floore_Scheme_MouseClick(object sender, MouseEventArgs e) { mainSpace = currentSpace; if (!isChange) { LB.Items.Clear(); if (isManager) { LB.Items.Add(DeletePoint); } if (currentSpace != null) { LB.SetBounds(currentSpace.XCoord, currentSpace.YCoord, 150, 65); for (int pos = 0; pos < currentSpace.GetExhibits().Count; pos++) { LB.Items.Add(currentSpace.GetExhibits()[pos].exhibit_name); } if (isManager) { if (LB.Items.Count == 1) { LB.Items.Add(empty); } } else if (LB.Items.Count == 0) { LB.Items.Add(empty); } if (isManager) { LB.Items.Add(AddExhibit); LB.Items.Add(ResetExhibit); } Scheme_Panel.Controls.Add(LB); LB.Show(); LB.BringToFront(); System.Threading.Thread.Sleep(1000); } else { LB.Hide(); } } else { bridge.AddNewExhibitSpace(e.X, e.Y, currentFloor.GetId()); CanselFunction(); RefreshFloor(); } }
private void LBMouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { int i = LB.IndexFromPoint(e.X, e.Y); if (i == ListBox.NoMatches) { return; } LB.SelectedIndex = i; } }
public void CheckVictory() { string currentAdv = ""; foreach (var LB in LettersBoxes.Value) { currentAdv += LB.GetComponentInChildren <Text>().text; Debug.Log(currentAdv); } if (currentAdv == SelectedWord.Value) { EndTheGame(0); } }
public Client() { root = 0; bridge = new Bridge(); isManager = false; isAdmin = false; InitializeComponent(); Cansel.Hide(); LB.Hide(); ManagerPanel.Hide(); AdministratorPanel.Hide(); RefreshAllUseableFloor(); Scheme = new Bitmap(Floore_Scheme.Width, Floore_Scheme.Height); RefreshFloor(); }
private void listBox1_MouseMove(object sender, MouseEventArgs e) { if (DragOn) { if (dragBoxFromMouseDown.Contains(e.X, e.Y)) { return; } if (LB.SelectedItem == null) { return; } LB.DoDragDrop(LB.SelectedItem, DragDropEffects.Move); DragOn = false; lbLine.ClearLine(); } }
public ILB Create( ImmutableList <ILBParameterElement> value) { ILB parameter = null; try { parameter = new LB( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(parameter); }
string GetPageNavigation(int start, int end) { StringBuilder nav = new StringBuilder(); if (start != 0) { nav.Append(string.Format("<a href=\"{0}\">« Newer entries</a>", LB.GetOutputFileAtOffset(start))); } if (end + Config.EntriesPerPage < entries.Count) { if (nav.Length > 0) { nav.Append(" | "); } nav.Append(string.Format("<a href=\"{0}\">Older entries »</a>", LB.GetOutputFileAtOffset(end + 1))); } return(nav.ToString()); }
private void Launch(object sender, EventArgs e) { if (!File.Exists(Common.ffmpeg)) { MessageBox.Show("ffmpeg est introuvable, vérifiez qu'il se trouve bien dans le répertoire de l'application"); return; } LockUI(); RuningTaskIndex = 0; foreach (VideoTask task in Tasks) { LB.Refresh(); task.Log += Log; task.Execute(); task.Log -= Log; RuningTaskIndex++; } UnlockUI(); Log("\r\n############################################################"); Log("Opérations terminées"); Log("############################################################\r\n"); if (MessageBox.Show("Voulez vous supprimer les tâches effectuées ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes) { LB.Items.Clear(); Tasks.Clear(); } LB.Refresh(); if (cbShutdown.Checked) { Process.Start("shutdown.exe", "-s -t 30 -c \"Fin de l'opération d'encodage.\""); Application.Exit(); } }
//修改 public int LBUpd(LB l) { string sql = $"update HDliebiao set HDtitle='{l.HDtitle}',HDdizhi='{l.HDdizhi}',HDkaishi='{l.HDkaishi}',HDjieshu='{l.HDjieshu}',HDjiezhi='{l.HDjiezhi}',HDZt='{l.HDZt}',HDimg='{l.HDimg}',HDnei='{l.HDnei}' where HDlbid={l.HDlbid}"; return(DBHelper.ExecuteNonQuery(sql, System.Data.CommandType.Text)); }
void Load(TextReader i, bool is_html, string file) { bool caption_found = false; bool in_pre = false; StringBuilder sb = new StringBuilder(); string s; while ((s = i.ReadLine()) != null) { if (!caption_found) { if (is_html) { if (s.StartsWith("<h1>")) { Caption = s.Replace("<h1>", "").Replace("</h1>", ""); caption_found = true; continue; } else if (s.StartsWith("#include")) { sb.Append(Include(s.Substring(9), out Caption)); caption_found = true; continue; } } else { if (s.StartsWith("@") && !caption_found) { Caption = s.Substring(1); caption_found = true; continue; } } } // '#date' followed by the output of: // LC_TIME=C date -u +"%a, %d %b %Y %T GMT" // will set the publication date. // Example: // #date Thu, 09 Feb 2006 18:42:56 GMT if (s.StartsWith("#date ")) { try { Date = DateTime.ParseExact(s.Substring(6), "r", null); } catch (Exception e) { Console.WriteLine("Error parsing: '{0}'\n{1} on {2}", s.Substring(5), e, file); Environment.Exit(1); } continue; } if (!is_html) { if (s == "" && !in_pre) { sb.Append("<p>"); } else if (s.StartsWith("@")) { sb.Append(String.Format("<h1>{0}</h1>", s.Substring(1))); } else if (s.StartsWith("#pre")) { in_pre = true; } else if (s.StartsWith("#endpre")) { in_pre = false; } else { sb.Append(s); } } else { if (s.StartsWith("#include")) { string c; sb.Append(Include(s.Substring(9), out c)); continue; } else if (s.StartsWith("#pic")) { int idx = s.IndexOf(","); if (idx == -1) { Console.WriteLine("Wrong #pic command on {0}", file); continue; } string filename = s.Substring(5, idx - 5); string caption = s.Substring(idx + 1); sb.Append(String.Format("<p><center><a href=\"{0}pic.php?name={1}&caption={2}\"><img border=0 src=\"{3}/pictures/small-{1}\"></a><p>{2}</center></p>", blog_base, filename, caption, blog.config.BlogImageBasedir)); continue; } else if (s.StartsWith("#comment")) { Comments = true; continue; } else if (s.StartsWith("#nocomment")) { Comments = false; continue; } else if (s.StartsWith("#thumbnail")) { Match m = Regex.Match(s, @"^#thumbnail\s+(?<filename>[^\s]+)\s+(?<desc>.*)$"); if (m.Groups.Count > 0) { string filename = Path.GetFileName(m.Groups ["filename"].Value); string thumbnail = LB.GetThumbnailName(filename); sb.AppendFormat("<blockquote><p><a href=\"@ENTRY_PATH@{0}\"><img " + "src=\"@ENTRY_PATH@{1}\" title=\"{2}\" " + "alt=\"{2}\" /></a></p></blockquote>\n", filename, thumbnail, m.Groups.Count == 1 ? "" : m.Groups ["desc"].Value); Images = Images ?? new List <string> (); Images.Add(m.Groups ["filename"].Value); continue; } } sb.Append(s); } sb.Append("\n"); } Body = sb.ToString(); }
static void Main(string[] args) { Player.PlayersIntoTeams(); Teams.TeamsIntoDivisions(); string space17 = " "; string space16 = " "; string space15 = " "; string space14 = " "; string space13 = " "; string space12 = " "; string space11 = " "; string space10 = " "; string space7 = " "; string space6 = " "; string space5 = " "; string space4 = " "; string space3 = " "; string space = " "; Console.Clear(); System.Console.WriteLine("Check players or teams"); string choice = Console.ReadLine(); // Hur man lägger till personer i listan Player.playerData.Add(new Player("Boing boing", "Outside Hitter", "Kristoffer", "See", 69, 18, "righ", 182, 80, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99)); Player.playerData.RemoveAt(Player.playerData.ToArray().Length - 1); Player.playerData.Add(new Player("Test", "Outside Hitter", "Bertil", "Chemnitz", 69, 18, "righ", 182, 80, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99)); Player.playerData.RemoveAt(Player.playerData.ToArray().Length - 1); while (choice == "players" || choice == "1") { Console.Clear(); for (int tellMeBoutYou = 0; tellMeBoutYou < Player.playerData.ToArray().Length; tellMeBoutYou++) { Console.WriteLine("Name" + space16 + Player.playerData[tellMeBoutYou].name + space + Player.playerData[tellMeBoutYou].surname + "\n" + "Team" + space16 + Player.playerData[tellMeBoutYou].tName + "\n" + "Position" + space12 + Player.playerData[tellMeBoutYou].position + "\n" + "Favorite Number" + space5 + Player.playerData[tellMeBoutYou].number + space5 + (tellMeBoutYou + 1) + "\n" + "Age" + space17 + Player.playerData[tellMeBoutYou].age + "\n" + "Height" + space14 + Player.playerData[tellMeBoutYou].height + "\n" + "Weight" + space14 + Player.playerData[tellMeBoutYou].weight + "\n" + "Attack Overall" + space6 + Player.playerData[tellMeBoutYou].attackingStats + space5 + "Passing Overall" + space5 + Player.playerData[tellMeBoutYou].passingStats + space5 + "Pyhsic Overall" + space6 + Player.playerData[tellMeBoutYou].physicStats + space5 + "Defense Overall" + space5 + Player.playerData[tellMeBoutYou].defenseStats + space5 + "Mentality Overall" + space3 + Player.playerData[tellMeBoutYou].mentalityStats + "\n" + "Power" + space15 + Player.playerData[tellMeBoutYou].power + space5 + "Sett" + space16 + Player.playerData[tellMeBoutYou].sett + space5 + "Stamina" + space13 + Player.playerData[tellMeBoutYou].stamina + space5 + "Marking" + space13 + Player.playerData[tellMeBoutYou].marking + space5 + "Attack Position" + space5 + Player.playerData[tellMeBoutYou].atkP + "\n" + "Spike" + space15 + Player.playerData[tellMeBoutYou].spike + space5 + "Vision" + space14 + Player.playerData[tellMeBoutYou].vision + space5 + "Balance" + space13 + Player.playerData[tellMeBoutYou].balance + space5 + "Blocking" + space12 + Player.playerData[tellMeBoutYou].blocking + space5 + "Defense Position" + space4 + Player.playerData[tellMeBoutYou].defP + "\n" + "Serve" + space15 + Player.playerData[tellMeBoutYou].serve + space5 + "Under Arm Pass" + space6 + Player.playerData[tellMeBoutYou].uAPass + space5 + "Speed" + space15 + Player.playerData[tellMeBoutYou].speed + space5 + "Reading" + space13 + Player.playerData[tellMeBoutYou].reading + space5 + "Timing" + space14 + Player.playerData[tellMeBoutYou].timing + "\n" + "Direct" + space14 + Player.playerData[tellMeBoutYou].direct + space5 + "Over Arm Pass" + space7 + Player.playerData[tellMeBoutYou].oAPass + space5 + "Mobility" + space12 + Player.playerData[tellMeBoutYou].mobility + space5 + "Dig" + space17 + Player.playerData[tellMeBoutYou].dig + space5 + "Composure" + space11 + Player.playerData[tellMeBoutYou].coolness + "\n" + "Backrow" + space13 + Player.playerData[tellMeBoutYou].backrow + space5 + "Ball Controll" + space7 + Player.playerData[tellMeBoutYou].controll + space5 + "Elasticity" + space10 + Player.playerData[tellMeBoutYou].elasticity + space5 + "Reaction" + space12 + Player.playerData[tellMeBoutYou].reaction + " \n"); } choice = Console.ReadLine(); } while (choice == "team" || choice == "2") { Console.Clear(); System.Console.WriteLine("What League?\n\n\tDivision 1\n\tDivision 2\n\tDivision 3"); string choice2 = Console.ReadLine(); List <String> div1 = new List <string>(); List <String> div2 = new List <string>(); List <String> div3 = new List <string>(); bool lookingAtD1 = false; bool lookingAtD2 = false; bool lookingAtD3 = false; int choice2p; if (choice2 == "1" || choice2 == "div1") { for (int div1Teams = 0; div1Teams < 20; div1Teams++) { div1.Add(League.divTeam[0, div1Teams].name); } div1.Sort(); lookingAtD1 = true; while (lookingAtD1 == true) { Console.Clear(); for (int div1Teams = 0; div1Teams < div1.ToArray().Length; div1Teams++) { System.Console.WriteLine("[" + (div1Teams + 1) + "] " + div1.ToArray()[div1Teams]); } string Choice2p1 = Console.ReadLine(); for (int whatTeam = 0; whatTeam < div1.ToArray().Length; whatTeam++) { if (Choice2p1 == (whatTeam + 1).ToString() || Choice2p1 == div1.ToArray()[(whatTeam)].ToString()) { Console.Clear(); choice2p = whatTeam; CheckD1Team(choice2p, space16, space12, div1); Console.ReadLine(); } } if (Choice2p1 == "back" || Choice2p1 == "b") { break; } } } else if (choice2 == "2" || choice2 == "div2") { for (int div2Teams = 0; div2Teams < 20; div2Teams++) { div2.Add(League.divTeam[1, div2Teams].name); } div2.Sort(); lookingAtD2 = true; while (lookingAtD2 == true) { Console.Clear(); for (int div2Teams = 0; div2Teams < div2.ToArray().Length; div2Teams++) { System.Console.WriteLine("[" + (div2Teams + 1) + "] " + div2.ToArray()[div2Teams]); } string Choice2p2 = Console.ReadLine(); for (int whatTeam = 0; whatTeam < div2.ToArray().Length; whatTeam++) { if (Choice2p2 == (whatTeam + 1).ToString() || Choice2p2 == div2.ToArray()[(whatTeam)].ToString()) { Console.Clear(); choice2p = whatTeam; CheckD2Team(choice2p, space16, space12, div2); Console.ReadLine(); } } if (Choice2p2 == "back" || Choice2p2 == "b") { break; } } } else if (choice2 == "3" || choice2 == "div3") { for (int div3Teams = 0; div3Teams < 20; div3Teams++) { div3.Add(League.divTeam[2, div3Teams].name); } div3.Sort(); lookingAtD3 = true; while (lookingAtD3 == true) { Console.Clear(); for (int div3Teams = 0; div3Teams < div3.ToArray().Length; div3Teams++) { System.Console.WriteLine("[" + (div3Teams + 1) + "] " + div3.ToArray()[div3Teams]); } string Choice2p3 = Console.ReadLine(); for (int whatTeam = 0; whatTeam < div3.ToArray().Length; whatTeam++) { if (Choice2p3 == (whatTeam + 1).ToString() || Choice2p3 == div3.ToArray()[whatTeam].ToString()) { Console.Clear(); choice2p = whatTeam; CheckD3Team(choice2p, space16, space12, div3); Console.ReadLine(); } } if (Choice2p3 == "back" || Choice2p3 == "b") { break; } } } choice = Console.ReadLine(); Console.Clear(); } HubDesign centralTab = new HubDesign(); HubDesign squadTab = new HubDesign(); HubDesign transferTab = new HubDesign(); HubDesign officeTab = new HubDesign(); HubDesign myClubTab = new HubDesign(); SimulateButton simulate = new SimulateButton(); HubDesign news = new HubDesign(); HubDesign cHubs = new HubDesign(); HubDesign league = new HubDesign(); HubDesign cTraining = new HubDesign(); HubDesign cInbox = new HubDesign(); HubDesign lineUp = new HubDesign(); HubDesign training = new HubDesign(); HubDesign squadHub = new HubDesign(); HubDesign youthSquad = new HubDesign(); HubDesign teamSheet = new HubDesign(); HubDesign searchPlayer = new HubDesign(); HubDesign transferHub = new HubDesign(); HubDesign transferHistory = new HubDesign(); HubDesign finances = new HubDesign(); HubDesign scouts = new HubDesign(); HubDesign recommended = new HubDesign(); HubDesign inbox = new HubDesign(); HubDesign vision = new HubDesign(); HubDesign contracts = new HubDesign(); HubDesign manageStaff = new HubDesign(); HubDesign browseJobs = new HubDesign(); HubDesign kits = new HubDesign(); HubDesign arrangeFriendlies = new HubDesign(); HubDesign trophies = new HubDesign(); HubDesign otherLeagues = new HubDesign(); HubDesign top25 = new HubDesign(); Platform.PrintHubMenu(centralTab, squadTab, transferTab, officeTab, myClubTab, simulate, news, cHubs, league, cTraining, cInbox, lineUp, squadHub, youthSquad, teamSheet, training, searchPlayer, transferHub, transferHistory, finances, recommended, scouts, inbox, vision, contracts, manageStaff, browseJobs, kits, arrangeFriendlies, trophies, otherLeagues, top25); HubDesign current = simulate; Raylib.InitWindow(1200, 750, ""); Raylib.SetTargetFPS(60); while (!Raylib.WindowShouldClose()) { DateTime dtStart = new DateTime(2020, 6, 1); DateTime dtCurrent = dtStart.AddDays(simulate.nextDay); string dtString = dtCurrent.ToString("dd MMMM yyyy"); // (current, simulate, news, cHubs, league, cTraining, cInbox, lineUp, squadHub, youthSquad, training, teamSheet, serachPlayer, transferHub, transferHistory, finances, scouts, recommended, vision, inbox, contracts, manageStaff, browseJobs, kits, arrangeFriendlies, trophies, otherLeagues, top25); // (HubDesign current, HubDesign simulate, HubDesign news, HubDesign cHubs, HubDesign league, HubDesign cTraining, HubDesign cInbox, HubDesign lineUp, HubDesign squadHub, HubDesign youthSquad, HubDesign training, HubDesign teamSheet, HubDesign serachPlayer, HubDesign transferHub, HubDesign transferHistory, HubDesign finances, HubDesign scouts, HubDesign recommended, HubDesign vision, HubDesign inbox, HubDesign contracts, HubDesign manageStaff, HubDesign browseJobs, HubDesign kits, HubDesign arrangeFriendlies, HubDesign trophies, HubDesign otherLeagues, HubDesign top25) if (Raylib.IsKeyPressed(KeyboardKey.KEY_W)) { current = current.toUp; } else if (Raylib.IsKeyPressed(KeyboardKey.KEY_A)) { current = current.toLeft; } else if (Raylib.IsKeyPressed(KeyboardKey.KEY_S)) { current = current.toDown; } else if (Raylib.IsKeyPressed(KeyboardKey.KEY_D)) { current = current.toRight; } else if (Raylib.IsKeyPressed(KeyboardKey.KEY_Q)) { current = current.visable[0]; } else if (Raylib.IsKeyPressed(KeyboardKey.KEY_E)) { current = current.visable[1]; } else if (Raylib.IsKeyPressed(KeyboardKey.KEY_ENTER)) { current.action(); } foreach (HubDesign LB in current.visable) { LB.DrawBox(); } foreach (HubDesign wut in current.whatTab) { wut.DrawTab(); } HubDesign.currentBox(current); if (current == simulate) { Raylib.DrawText(dtString, simulate.x, simulate.y + 50, 30, Color.ORANGE); } else if (current.visable.Contains(simulate)) { Raylib.DrawText(dtString, simulate.x + 15, simulate.y + 45, 20, Color.ORANGE); } Raylib.BeginDrawing(); Raylib.ClearBackground(Color.BLUE); Raylib.EndDrawing(); } }
//添加 public int LBAdd(LB l) { string sql = $"insert into HDliebiao(HDtitle,HDdizhi,HDkaishi,HDjieshu,HDjiezhi,HDZt,HDimg,HDnei) values('{l.HDtitle}','{l.HDdizhi}','{l.HDkaishi}','{l.HDjieshu}','{l.HDjiezhi}','{l.HDZt}','{l.HDimg}','{l.HDnei}')"; return(DBHelper.ExecuteNonQuery(sql, System.Data.CommandType.Text)); }
/// <summary> /// 绑定数据返回只读,不包含TB控件 /// </summary> /// <param name="attrs"></param> /// <param name="pa"></param> public void BindAttrsForHtml(Attrs attrs, AtPara pa) { this.Add("<table width='100%' id='a1' border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' >"); bool isLeft = true; object val = null; bool isAddTR = true; foreach (Attr attr in attrs) { if (attr.UIVisible == false) { continue; } if (attr.Key == "MyNum") { continue; } if (isLeft) { isAddTR = true; this.AddTR(); } val = pa.GetValStrByKey(attr.Key); if (attr.UIContralType == UIContralType.TB) { if (attr.MyFieldType == FieldType.RefText) { //this.SetValByKey(attr.Key, val.ToString()); continue; } else if (attr.MyFieldType == FieldType.MultiValues) { /* 如果是多值的.*/ LB lb = new LB(attr); lb.Visible = true; lb.Height = 128; lb.SelectionMode = ListSelectionMode.Multiple; Entities ens = ClassFactory.GetEns(attr.UIBindKey); ens.RetrieveAll(); this.Controls.Add(lb); } else { if (attr.UIVisible == false) { continue; } else { switch (attr.MyDataType) { case DataType.AppMoney: val = decimal.Parse(val.ToString()).ToString("0.00"); break; default: val = val.ToString(); break; } this.Add("<td class='FDesc' nowrap width=1% > " + attr.Desc + "</td>"); this.Add("<td class='TD' nowrap width='30%'>"); this.Add(val.ToString()); this.Add("</td>"); } } } else if (attr.UIContralType == UIContralType.CheckBok) { CheckBox cb = new CheckBox(); if (attr.DefaultVal.ToString() == "1") { cb.Checked = true; } else { cb.Checked = false; } cb.ID = "CB_RD_" + attr.Key; this.AddContral(attr.Desc, cb); } else if (attr.UIContralType == UIContralType.DDL) { /* 如果是 DDLIsEnable 的, 就要找到. */ if (attr.MyFieldType == FieldType.Enum) { /* 如果是 enum 类型 */ int enumKey = 0; try { enumKey = int.Parse(val.ToString()); } catch { throw new Exception("默认值错误:" + attr.Key + " = " + val.ToString()); } BP.Sys.SysEnum enEnum = new BP.Sys.SysEnum(attr.UIBindKey, "CH", enumKey); this.Add("<td class='FDesc' nowrap width=1% > " + attr.Desc + "</td>"); this.Add("<td class='TD' nowrap width='30%'>"); this.Add(enEnum.Lab); this.Add("</td>"); } else { /* 如果是 ens 类型 */ Entities ens = ClassFactory.GetEns(attr.UIBindKey); Entity en1 = ens.GetNewEntity; en1.SetValByKey(attr.UIRefKeyValue, val.ToString()); string lab = ""; try { en1.Retrieve(); lab = en1.GetValStringByKey(attr.UIRefKeyText); } catch { if (SystemConfig.IsDebug == false) { lab = "" + val.ToString(); } else { lab = "" + val.ToString(); } } this.Add("<td class='FDesc' nowrap width=1% > " + attr.Desc + "</td>"); this.Add("<td class='TD' nowrap width='30%'>"); this.Add(lab); this.Add("</td>"); } } else if (attr.UIContralType == UIContralType.RadioBtn) { // Sys.SysEnums enums = new BP.Sys.SysEnums(attr.UIBindKey); // foreach(SysEnum en in enums) // { // return ; // } } if (isLeft == false) { isAddTR = false; this.AddTREnd(); } isLeft = !isLeft; } // 结束循环. //补充TR if (isAddTR == true) { this.AddTD(""); this.AddTD(""); this.AddTREnd(); } this.Add("</TABLE>"); }
public void BindAttrs(Attrs attrs) { //this.HisEn =en; bool isReadonly = false; this.IsReadonly = false; this.IsShowDtl = false; this.Attributes["visibility"] = "hidden"; this.Add("<table width='100%' id='a1' border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' >"); bool isLeft = true; object val = null; bool isAddTR = true; foreach (Attr attr in attrs) { if (attr.UIVisible == false) { continue; } if (attr.Key == "MyNum") { continue; } if (isLeft) { isAddTR = true; this.AddTR(); } val = attr.DefaultVal; if (attr.UIContralType == UIContralType.TB) { if (attr.MyFieldType == FieldType.RefText) { this.SetValByKey(attr.Key, val.ToString()); continue; } else if (attr.MyFieldType == FieldType.MultiValues) { /* 如果是多值的.*/ LB lb = new LB(attr); lb.Visible = true; lb.Height = 128; lb.SelectionMode = ListSelectionMode.Multiple; Entities ens = ClassFactory.GetEns(attr.UIBindKey); ens.RetrieveAll(); this.Controls.Add(lb); } else { if (attr.UIVisible == false) { //不可见控件 TB tb = new TB(); tb.LoadMapAttr(attr); tb.ID = "TB_" + attr.Key; tb.Attributes["Visible"] = "false"; this.Controls.Add(tb); continue; } else { if (attr.UIHeight != 0) { TB area = new TB(); area.LoadMapAttr(attr); area.ID = "TB_" + attr.Key; area.Text = val.ToString(); area.Rows = 8; area.TextMode = TextBoxMode.MultiLine; area.Attributes["onchange"] += "Change('TB_" + attr.Key + "');"; if (isReadonly) { area.Enabled = false; } this.AddContral(attr.Desc, area); } else { TB tb = new TB(); tb.LoadMapAttr(attr); tb.ID = "TB_" + attr.Key; if (isReadonly) { tb.Enabled = false; } switch (attr.MyDataType) { case DataType.AppMoney: tb.Text = decimal.Parse(val.ToString()).ToString("0.00"); break; default: tb.Text = val.ToString(); break; } tb.Attributes["width"] = "100%"; tb.Attributes["onchange"] += "Change('TB_" + attr.Key + "');"; this.AddContral(attr.Desc, tb); } } } } else if (attr.UIContralType == UIContralType.CheckBok) { CheckBox cb = new CheckBox(); if (attr.DefaultVal.ToString() == "1") { cb.Checked = true; } else { cb.Checked = false; } if (isReadonly) { cb.Enabled = false; } else { cb.Enabled = attr.UIVisible; } cb.ID = "CB_" + attr.Key; cb.Attributes["onmousedown"] = "Change('CB_" + attr.Key + "')"; this.AddContral(attr.Desc, cb); } else if (attr.UIContralType == UIContralType.DDL) { if (isReadonly || !attr.UIIsReadonly) { /* 如果是 DDLIsEnable 的, 就要找到. */ if (attr.MyFieldType == FieldType.Enum) { /* 如果是 enum 类型 */ int enumKey = 0; try { enumKey = int.Parse(val.ToString()); } catch { throw new Exception("默认值错误:" + attr.Key + " = " + val.ToString()); } BP.Sys.SysEnum enEnum = new BP.Sys.SysEnum(attr.UIBindKey, "CH", enumKey); //DDL ddl = new DDL(attr,text,en.Lab,false); DDL ddl = new DDL(); ddl.Items.Add(new ListItem(enEnum.Lab, val.ToString())); ddl.Items[0].Selected = true; ddl.Enabled = false; ddl.ID = "DDL_" + attr.Key; this.AddContral(attr.Desc, ddl, true); } else { /* 如果是 ens 类型 */ Entities ens = ClassFactory.GetEns(attr.UIBindKey); Entity en1 = ens.GetNewEntity; en1.SetValByKey(attr.UIRefKeyValue, val.ToString()); string lab = ""; try { en1.Retrieve(); lab = en1.GetValStringByKey(attr.UIRefKeyText); } catch { if (SystemConfig.IsDebug == false) { lab = "" + val.ToString(); } else { lab = "" + val.ToString(); } } DDL ddl = new DDL(attr, val.ToString(), lab, false, this.Page.Request.ApplicationPath); ddl.ID = "DDL_" + attr.Key; this.AddContral(attr.Desc, ddl, true); } } else { /* 可以使用的情况. */ DDL ddl1 = new DDL(attr, val.ToString(), "enumLab", true, this.Page.Request.ApplicationPath); ddl1.ID = "DDL_" + attr.Key; ddl1.Attributes["onchange"] = "Change('DDL_" + attr.Key + "')"; this.AddContral(attr.Desc, ddl1, true); } } else if (attr.UIContralType == UIContralType.RadioBtn) { // Sys.SysEnums enums = new BP.Sys.SysEnums(attr.UIBindKey); // foreach(SysEnum en in enums) // { // return ; // } } if (isLeft == false) { isAddTR = false; this.AddTREnd(); } isLeft = !isLeft; } // 结束循环. //补充TR if (isAddTR == true) { this.AddTD(""); this.AddTD(""); this.AddTREnd(); } this.Add("</TABLE>"); }