public void CanCreateAutoShortConstructor() { var x = new Auto("schwarz", "BMW"); Assert.IsTrue(x.Farbe == "schwarz"); Assert.IsTrue(x.Marke == "BMW"); }
void SortShell(ref Auto [] array, int length) { int i; int j; int step = 3; Auto aux; while (step > 0) { for (i = 0; i < length; i++) { j = i; aux = array[i]; while ((j >= step) && (array[j - step].situation > aux.situation)) { array[j] = array[j - step]; j = j - step; } array[j] = aux; } if (step / 2 != 0) step = step / 2; else if (step == 1) step = 0; else step = 1; } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public SchedulerLifecycleManager(IFramework framework, AutofacJobFactory jobFactory, IEnumerable<IJobDetail> jobDetails, Auto<IJobLogger> logger) { _framework = framework; _logger = logger.Instance; _jobDetails = jobDetails.ToArray(); _jobFactory = jobFactory; }
protected void Page_Init(Object sender, EventArgs e) { blogic = new BLAutot(MapPath("~/App_Data/WanhatAutot.xml")); edit = Request.QueryString["id"] != null ? true : false; if (edit) { int id = int.Parse(Request.QueryString["id"]); header.Text = "Muokkaa auton tietoja"; auto = blogic.getCar(id); tbId.Text = auto.ID.ToString(); tbMerkki.Text = auto.Merkki; tbMalli.Text = auto.Malli; tbVuosiMalli.Text = auto.VuosiMalli.ToString(); tbMyyntiHinta.Text = auto.MyyntiHinta.ToString(); tbSisaanOstoHinta.Text = auto.SisaanOstoHinta.ToString(); tbRekkari.Text = auto.Rekkari; tbId.Enabled = false; } else { btnDelete.Visible = false; header.Text = "Lisää uusi auto"; auto = new Auto(); } }
public void CannotCreateAutowithEmptyColor2SC() { Assert.Catch(() => { var x = new Auto(null, "BMW"); }); }
public void CannotCreateAutowithEmptyColor2() { Assert.Catch(() => { var x = new Auto(10000, null, true, "BMW"); }); }
public void CannotCreateAutowithEmptyMarke1() { Assert.Catch(() => { var x = new Auto(10000, "schwarz", true, ""); }); }
public void CannotCreateAutowithEmptyMarke1SC() { Assert.Catch(() => { var x = new Auto("schwarz", ""); }); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public WebApplicationComponent(IWebAppEndpoint endpoint, Auto<ILogger> logger, IComponentContext componentContext) { _app = endpoint.Contract; _address = endpoint.Address; _logger = logger.Instance; _container = (ILifetimeScope)componentContext; }
string Display(Auto [] array) { SortShell(ref array, array.Length); string result = ""; for (int i = 0; i < array.Length; i++) result += array[i].brand + " "; return result; }
public void CanCreateAutoFullConstructor() { var x = new Auto(10000, "schwarz", true, "BMW"); Assert.IsTrue(x.Preis == 10000); Assert.IsTrue(x.Farbe == "schwarz"); Assert.IsTrue(x.hatAllrad == true); Assert.IsTrue(x.Marke == "BMW"); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public XmlConfigurationLoader(IFramework framework, Auto<IConfigurationLogger> logger, IEnumerable<IConfigurationSection> configurationSections) { _framework = framework; _logger = logger.Instance; _sectionsByXmlName = configurationSections.Cast<IInternalConfigurationObject>().ToDictionary( s => s.GetXmlName(), StringComparer.InvariantCultureIgnoreCase); }
public void method_13() { foreach (Control control in this.panel1.Controls) { control.Dispose(); } this.panel1.Controls.Clear(); Auto auto = new Auto(); auto.TopLevel = false; auto.FormBorderStyle = FormBorderStyle.None; auto.Visible = true; this.panel1.Controls.Add(auto); }
public void Test3Auto() { Auto[] Moto = new Auto[5]; Moto[0].situation = Priority.High; Moto[1].situation = Priority.Low; Moto[2].situation = Priority.High; Moto[3].situation = Priority.Medium; Moto[4].situation = Priority.Low; Moto[0].brand = "Audi"; Moto[1].brand = "BMw"; Moto[2].brand = "Opel"; Moto[3].brand = "Dacia"; Moto[4].brand = "Volvo"; Assert.AreEqual("Audi Opel Dacia BMw Volvo ", Display(Moto)); }
static void Main(string[] args) { Vehiculo v = new Vehiculo(); Auto a = new Auto(); Avion p = new Avion(); v.DoblarDerecha(); v.DoblarIzquierda(); a.DoblarDerecha(); a.DoblarIzquierda(); p.DoblarDerecha(); p.DoblarIzquierda(); Console.ReadLine(); }
public static void AddAuto(Auto newAuto) { using (CarsEntity autorentEntityContext = new CarsEntity()) { try { Models.Auto.Auto auto = new Models.Auto.Auto { Number = newAuto.CarNumber, ModelId = newAuto.ModelID, BodyType = (int)newAuto.BodyType, InsuaranceId = newAuto.InsuranceNumber, Year = newAuto.CreationYear, Mileage = newAuto.CurrentMilage, Engine = newAuto.Engine, ColorGroup = newAuto.CarColor, DayRate = newAuto.DayRate, KmRate = newAuto.KmRate, Status = (short)newAuto.Status, Advance = newAuto.Advance }; if (!ReferenceEquals(newAuto.PhotoFileName, null)) { Models.Auto.AutoPhoto autoPhotos = new AutoPhoto { AutoNumber = newAuto.CarNumber, DoDate = DateTime.UtcNow, PhotoFileName = newAuto.PhotoFileName }; auto.AutoPhotos.Add(autoPhotos); } autorentEntityContext.Autoes.AddObject(auto); autorentEntityContext.SaveChanges(); } catch (InvalidOperationException ex) { throw ex; } } }
protected void btnUusiAuto_Click(object sender, EventArgs e) { if ((String)Session["logged"] == "true") { Regex rekkari = new Regex(@"^[A-Z]{3}-[0-9]{3}$"); if (rekkari.IsMatch(txtRekkari.Text)) { try { Auto a = new Auto(); a.Aid = txtAid.Text; a.Rekkari = txtRekkari.Text; a.Merkki = txtMerkki.Text; a.Malli = txtMalli.Text; a.Vm = int.Parse(txtVm.Text); a.MyyntiHinta = int.Parse(txtMyyntiHinta.Text); a.SisaanOstoHinta = int.Parse(txtSisaanOstoHinta.Text); autoLista.Add(a); autoLista = BLAutot.jarjestaLista(autoLista, "Malli", "ASC"); contentToGridView(autoLista); } catch (Exception) { } } } else { Response.Redirect("logon.aspx"); } }
public void T7() { Guid guid = Auto.Make <Guid>(); Assert.That(guid, Is.Not.Null); }
public void T11() { Exception value = Auto.Make <Exception>(); Assert.That(value, Is.Not.Null); }
public void CannotCreateAutoWithNegativePrice() { Assert.Catch(() => { var x = new Auto(-10000, "schwarz", true, "BMW"); }); }
public void T10() { Regex value = Auto.Make <Regex>(); Assert.That(value, Is.Not.Null); }
public static void Run() { int numberofruns = 0; var ts = new CancellationTokenSource(); CancellationToken ct = ts.Token; var task = Task.Factory.StartNew(() => { ct.ThrowIfCancellationRequested(); while (!ct.IsCancellationRequested) { numberofruns++; Thread.Sleep(100); } }, ts.Token); Console.ReadKey(); ts.Cancel (); Console.WriteLine("\n"+numberofruns+" seconds running"); string json = ""; var o = Observable.Start(() => { var autotest = new Auto(9999, "blau", true, "Lamborg"); var autoSubscription = autotest.Subscribe(autotest); Console.ReadKey(); autoSubscription.Dispose(); }).Finally(() => Console.WriteLine("Main Thread")); var fahrzeuge = new IAusgabe[] { new Auto(10000, "schwarz", true, "BMW"), new Auto(30000, "rot", true, "Audi"), new Auto("silber","Mercedes"), new Auto("gelb", "Ferrari"), new Motorrad(8000, "Mazda", "grün"), new Motorrad(30000, "Lamborghini", "gelb"), new Motorrad("Ferrari", "rot"), new Motorrad("Mitsubishi", "grün"), }; var Autos = new Auto[] { new Auto(10000, "schwarz", true, "BMWA"), new Auto(30000, "rot", true, "Audi"), new Auto("silber","Mercedes"), new Auto("gelb", "Ferrari") }; foreach (var x in fahrzeuge) { json = JsonConvert.SerializeObject (x); x.printProperties (); Console.WriteLine (json); Console.WriteLine(""); } using (StreamWriter file = File.CreateText(@"./Auto.json")) { JsonSerializer serializer = new JsonSerializer (); List<Auto> autoin = new List<Auto> (); foreach (var x in Autos) { autoin.Add (x); } serializer.Serialize(file, autoin); } List<Auto> auto1 = new List<Auto>(); using (StreamReader file2 = File.OpenText(@"./Auto.json")) { JsonSerializer serializer2 = new JsonSerializer(); // List<Auto> auto1= new List<Auto>(); auto1 = (List<Auto>)serializer2.Deserialize(file2, typeof(List<Auto>)); //auto1.printProperties (); } foreach (Auto x in auto1) { x.printProperties (); } o.Wait(); }
static void Main(string[] args) { Lavadero lavadero = new Lavadero(1, 2, 3); Auto auto1 = new Auto("AB", 4, EMarcas.Fiat, 4); Auto auto2 = new Auto("BC", 4, EMarcas.Iveco, 4); Camion camion1 = new Camion("JK", 18, EMarcas.Iveco, 30); Camion camion2 = new Camion("JL", 8, EMarcas.Iveco, 56); Moto moto1 = new Moto("FG", 2, EMarcas.Honda, 50); /*Console.WriteLine(lavadero.LavaderoAll); * * Console.WriteLine("Añadir vehiculo y mostrar"); * lavadero += auto1; * Console.WriteLine(lavadero.LavaderoAll); * * Console.WriteLine("Intentar añadir vehiculo ya ingresado y mostrar"); * lavadero += auto1; * Console.WriteLine(lavadero.LavaderoAll); * * Console.WriteLine("Quitar Vehiculo y mostrar"); * lavadero -= auto1; * Console.WriteLine(lavadero.LavaderoAll);*/ Console.WriteLine("Añade todos los vehiculos"); lavadero += auto1; lavadero += auto2; lavadero += camion1; lavadero += camion2; lavadero += moto1; Console.WriteLine(lavadero.LavaderoAll); /*Console.WriteLine("\nMostrar ganancias total"); * Console.WriteLine(lavadero.MostrarTotalFacturado()); * * Console.WriteLine("\nMostrar ganancias de auto"); * Console.WriteLine(lavadero.MostrarTotalFacturado(EVehiculo.Auto)); * * Console.WriteLine("\nMostrar ganancias de camion"); * Console.WriteLine(lavadero.MostrarTotalFacturado(EVehiculo.Camion)); * * Console.WriteLine("\nMostrar ganancias de moto"); * Console.WriteLine(lavadero.MostrarTotalFacturado(EVehiculo.Moto)); * * Console.WriteLine("\nMostrar Return Ordenar de por patente"); * Console.WriteLine(Lavadero.OrdenarVehiculosPorPatentes(auto1, auto2)); * Console.WriteLine(Lavadero.OrdenarVehiculosPorPatentes(auto2, auto2)); * Console.WriteLine(Lavadero.OrdenarVehiculosPorPatentes(auto2, auto1)); * * Console.WriteLine("\nMostrar Return Ordenar por marca"); * Console.WriteLine(Lavadero.OrdenarVehiculosPorMarca(auto1, auto2)); * Console.WriteLine(Lavadero.OrdenarVehiculosPorMarca(auto2, auto2)); * Console.WriteLine(Lavadero.OrdenarVehiculosPorMarca(auto2, auto1)); * * Console.WriteLine("\nMostrar Ordenar por patente"); * lavadero.OrdenarPorPatente(); * Console.WriteLine(lavadero.LavaderoAll); * * Console.WriteLine("\nMostrar Ordenar por Marca"); * lavadero.OrdenarPorMarca(); * Console.WriteLine(lavadero.LavaderoAll);*/ /* * Console.Write(auto1); * Console.Write(auto2); * * Console.WriteLine("\nComparacion de Auto"); * if (auto2.Equals(auto1)) * { * Console.WriteLine("El mismo auto"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * if (auto2.Equals(auto2)) * { * Console.WriteLine("El mismo auto"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * if (auto2.Equals(moto1)) * { * Console.WriteLine("Son del mismo tipo"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * Console.WriteLine("\nComparación de Camion"); * if (camion1.Equals(camion1)) * { * Console.WriteLine("El mismo Camion"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * if (camion1.Equals(camion2)) * { * Console.WriteLine("El mismo Camion"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * if (camion1.Equals(moto1)) * { * Console.WriteLine("Son del mismo tipo"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * Console.WriteLine("\nComparación de Moto"); * if (moto1.Equals(auto1)) * { * Console.WriteLine("Son del mismo tipo"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * if (moto1.Equals(camion1)) * { * Console.WriteLine("Son del mismo tipo"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * } * * if (moto1.Equals(moto1)) * { * Console.WriteLine("La misma moto"); * } * else * { * Console.WriteLine("Son de diferentes tipos"); * }*/ Console.ReadLine(); }
private void TextBox25_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.D54 = Auto.CheckTextBoxChange(textBox25, 122.5);
static void Main() { var bmw=new Auto(30000); bmw.OutPrice(); }
private void TextBox18_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.H5 = Auto.CheckTextBoxChange(textBox18, 205);
private void TextBox21_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.D52 = Auto.CheckTextBoxChange(textBox21, 245);
private void TextBox16_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.D4d = Auto.CheckTextBoxChange(textBox16, 20);
public ActionResult Create(Auto u) { if (!ModelState.IsValid) { return(View()); } try { int res = repositorio.Alta(u); if (u.Foto1File != null && u.IdAuto > 0) { string wwwPath = environment.WebRootPath; string path = Path.Combine(wwwPath, "Uploads"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } //Path.GetFileName(u.AvatarFile.FileName);//este nombre se puede repetir string fileName = "Foto1_" + u.IdAuto + Path.GetExtension(u.Foto1File.FileName); string pathCompleto = Path.Combine(path, fileName); u.Foto1 = Path.Combine("/Uploads", fileName); using (FileStream stream = new FileStream(pathCompleto, FileMode.Create)) { u.Foto1File.CopyTo(stream); } if (u.Foto2File != null && u.IdAuto > 0) { wwwPath = environment.WebRootPath; path = Path.Combine(wwwPath, "Uploads"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } //Path.GetFileName(u.AvatarFile.FileName);//este nombre se puede repetir fileName = "Foto2_" + u.IdAuto + Path.GetExtension(u.Foto2File.FileName); pathCompleto = Path.Combine(path, fileName); u.Foto2 = Path.Combine("/Uploads", fileName); using (FileStream stream = new FileStream(pathCompleto, FileMode.Create)) { u.Foto2File.CopyTo(stream); } } else { u.Foto2 = ""; } repositorio.Modificacion(u); } TempData["Mensaje"] = RepositorioBase.mensajeExitoso("create"); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { return(View()); } }
public ActionResult Edit(int id, Auto u) { try { u.IdAuto = id; if (u.Foto1File != null) { string wwwPath = environment.WebRootPath; string path = Path.Combine(wwwPath, "Uploads"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } //Path.GetFileName(u.AvatarFile.FileName);//este nombre se puede repetir string fileName = "Foto1_" + u.IdAuto + Path.GetExtension(u.Foto1File.FileName); string pathCompleto = Path.Combine(path, fileName); u.Foto1 = Path.Combine("/Uploads", fileName); using (FileStream stream = new FileStream(pathCompleto, FileMode.Create)) { u.Foto1File.CopyTo(stream); } } else { var us = repositorio.ObtenerPorId(id); u.Foto1 = us.Foto1; } if (u.Foto2File != null) { string wwwPath = environment.WebRootPath; string path = Path.Combine(wwwPath, "Uploads"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } //Path.GetFileName(u.AvatarFile.FileName);//este nombre se puede repetir string fileName = "Foto2_" + u.IdAuto + Path.GetExtension(u.Foto2File.FileName); string pathCompleto = Path.Combine(path, fileName); u.Foto2 = Path.Combine("/Uploads", fileName); using (FileStream stream = new FileStream(pathCompleto, FileMode.Create)) { u.Foto2File.CopyTo(stream); } } else { var us = repositorio.ObtenerPorId(id); u.Foto2 = us.Foto2; } repositorio.Modificacion(u); TempData["Mensaje"] = RepositorioBase.mensajeExitoso("edit"); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { TempData["Error"] = RepositorioBase.mensajeError("edit"); return(View()); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public EntityServiceComponent(IDataRepositoryEndpoint endpoint, Auto<ILogger> logger, IComponentContext componentContext) { _repository = endpoint.Contract; _logger = logger.Instance; _container = (ILifetimeScope)componentContext; }
private void TextBox26_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.L54 = Auto.CheckTextBoxChange(textBox26, 35);
private void TextBox10_TextChanged(object sender, EventArgs e) => Model.Parts.MainBody.Ds = Auto.CheckTextBoxChange(textBox10, (Model.Parts.MainBody.D / 2 - Model.Parts.MainBody.B) / 2);
private Auto createCar(XElement element) { Auto auto = new Auto(); auto.ID = int.Parse(element.Element("aid").Value); auto.Rekkari = element.Element("rekkari").Value; auto.Merkki = element.Element("merkki").Value; auto.Malli = element.Element("malli").Value; auto.VuosiMalli = int.Parse(element.Element("vm").Value); auto.MyyntiHinta = int.Parse(element.Element("myyntiHinta").Value); auto.SisaanOstoHinta = int.Parse(element.Element("sisaanOstoHinta").Value); return auto; }
static void OnLoadingComplete(EventArgs args) { if (!_Player.ChampionName.Contains("Hecarim")) { return; } Chat.Print("Hecarim7 Loaded!", Color.GreenYellow); Chat.Print("Good Luck!", Color.Yellow); Bootstrap.Init(null); Q = new Spell.Active(SpellSlot.Q, 350); W = new Spell.Active(SpellSlot.W, 525); E = new Spell.Active(SpellSlot.E, 450); R = new Spell.Skillshot(SpellSlot.R, 1000, SkillShotType.Linear, 250, 800, 200); R.AllowedCollisionCount = int.MaxValue; if (_Player.GetSpellSlotFromName("summonerdot") != SpellSlot.Unknown) { Ignite = new Spell.Targeted(ObjectManager.Player.GetSpellSlotFromName("summonerdot"), 600); } Menu = MainMenu.AddMenu("Hecarim7", "Hecarim"); Menu.AddSeparator(); ComboMenu = Menu.AddSubMenu("Combo Settings", "Combo"); ComboMenu.AddSeparator(); ComboMenu.AddLabel("Combo Settings"); ComboMenu.Add("ComboQ", new CheckBox("Spell [Q]")); ComboMenu.Add("ComboW", new CheckBox("Spell [W]")); ComboMenu.Add("ComboE", new CheckBox("Spell [E]")); ComboMenu.AddSeparator(); ComboMenu.Add("ComboR", new CheckBox("Spell [R]")); ComboMenu.AddSeparator(); ComboMenu.Add("MinR", new Slider("Min Enemies Use [R]", 3, 0, 5)); HarassMenu = Menu.AddSubMenu("Harass Settings", "Harass"); HarassMenu.AddLabel("Harass Settings"); HarassMenu.Add("HarassQ", new CheckBox("Spell [Q]")); HarassMenu.Add("ManaQ", new Slider("Min Mana Harass [Q]", 40)); HarassMenu.AddSeparator(); HarassMenu.Add("HarassW", new CheckBox("Spell [W]", false)); HarassMenu.Add("ManaW", new Slider("Min Mana Harass [W]<=", 40)); Auto = Menu.AddSubMenu("Auto Harass Settings", "Auto Harass"); Auto.AddLabel("Auto Harass Settings"); Auto.Add("AutoQ", new CheckBox("Auto [Q]")); Auto.Add("ManaQ", new Slider("Min Mana Auto [Q]", 60)); LaneClearMenu = Menu.AddSubMenu("LaneClear Settings", "LaneClear"); LaneClearMenu.AddLabel("LastHit Settings"); LaneClearMenu.Add("LastQ", new CheckBox("Spell [Q] LastHit")); LaneClearMenu.Add("LhMana", new Slider("Min Mana Lasthit [Q]", 60)); LaneClearMenu.AddSeparator(); LaneClearMenu.AddLabel("Lane Clear Settings"); LaneClearMenu.Add("LastQLC", new CheckBox("LaneClear With [Q]")); LaneClearMenu.Add("ManaLC", new Slider("Min Mana [Q] LaneClear", 50)); LaneClearMenu.Add("LastWLC", new CheckBox("LaneClear With [W]")); LaneClearMenu.Add("ManaLCW", new Slider("Min Mana [W] LaneClear", 70)); KillStealMenu = Menu.AddSubMenu("KillSteal Settings", "KillSteal"); KillStealMenu.AddLabel("KillSteal Settings"); KillStealMenu.Add("KsQ", new CheckBox("Use [Q] KillSteal")); KillStealMenu.Add("KsW", new CheckBox("Use [W] KillSteal")); KillStealMenu.Add("ign", new CheckBox("Use [Ignite] KillSteal")); KillStealMenu.AddSeparator(); KillStealMenu.AddLabel("Ultimate Settings"); KillStealMenu.Add("KsR", new CheckBox("Use [R] KillSteal")); KillStealMenu.Add("minKsR", new Slider("Min [R] Range KillSteal", 500, 1, 700)); Skin = Menu.AddSubMenu("Skin Changer", "SkinChanger"); Skin.Add("checkSkin", new CheckBox("Use Skin Changer")); Skin.Add("skin.Id", new ComboBox("Skin Mode", 8, "Default", "1", "2", "3", "4", "5", "6", "7", "8")); Drawings = Menu.AddSubMenu("Draw Settings", "Draw"); Drawings.AddGroupLabel("Drawing Settings"); Drawings.Add("DrawQ", new CheckBox("Q Range")); Drawings.Add("DrawW", new CheckBox("W Range", false)); Drawing.OnDraw += Drawing_OnDraw; Game.OnTick += Game_OnTick; }
static int Main(string[] args) { Auto auto = new Auto(); //return -1; //Sql c = new Sql(); //Правила аргументов командной строки такие.... // - outfile имя_файла - имя выходного файла // - readXSD имя_файла - имя входной схемы XSD // - WriteXSD имя_файла - если надо создать XSD схему // - readSQL имя_файла - фаил с SQL // - ? - помощь // // TODO: Add code to start application here // string URI = null; string URIText = null; string inXSD = null; string inSQL = null; string inXML = null; string outXSL = null; string outXSD = null; string outXML = null; string Manifest = null; for (int i=0;i<args.Length;i++) { if (args[i].ToLower().Trim('/','-') == "?") { Console.WriteLine("Правила аргументов командной строки такие...."); Console.WriteLine(" - outfile имя_файла - имя выходного XSL файла"); Console.WriteLine(" - readXSD имя_файла - имя входной схемы XSD"); Console.WriteLine(" - WriteXSD имя_файла - если надо создать XSD схему"); Console.WriteLine(" - readSQL имя_файла - фаил с SQL"); Console.WriteLine(" - readXML имя_файла - входной XML фаил данных из Natural-e"); Console.WriteLine(" - writeXML имя_файла - XML фаил данных для Word-a"); Console.WriteLine(" - URI имя_схемы - URI"); Console.WriteLine(" - URIText Текст - Текст который будет отображаться в Word-e"); Console.WriteLine(" - Manifest имя_файла - Имя манифеста"); Console.WriteLine(" - ? - помощь"); return -1; } if (args[i].ToLower().Trim('/','-') == "outfile" && i+1 < args.Length) { outXSL = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "readxsd" && i+1 < args.Length) { inXSD = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "uri" && i+1 < args.Length) { URI = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "uritext" && i+1 < args.Length) { URIText = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "manifest" && i+1 < args.Length) { Manifest = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "writexsd" && i+1 < args.Length) { outXSD = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "readsql" && i+1 < args.Length) { inSQL = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "readxml" && i+1 < args.Length) { inXML = args[i+1].Trim('\"','\'','`'); i++; continue; } if (args[i].ToLower().Trim('/','-') == "writexml" && i+1 < args.Length) { outXML = args[i+1].Trim('\"','\'','`'); i++; continue; } } //вводим данные по умолчанию //c.Output = "transform.xsl"; //c.inXSDFileName = "sampledoc.xsd"; //c.OutXsd = "schema.xsd"; //c.SQLFile = "sql.txt"; if (!auto.Create(inXSD, inSQL, outXSL, outXSD, URI, URIText, Manifest)) { Console.WriteLine("Ошибка. не задан 1 из параметров."); return 1; } try { auto.Run(); } catch (System.Exception e) { Console.WriteLine("Ошибка при компиляции :" + e.Message); Console.ReadLine(); return 1; } try { //c.Execute(c.inXmlFile, c.Output, c.outXmlFile); if (inXML != null && outXML != null) { auto.Execute(inXML, outXML); } } catch (System.Exception e) { Console.WriteLine("Ошибка при выполнении :" + e.Message); Console.ReadLine(); return 1; } // return 0; }
public void removeCar(Auto auto) { XDocument doc = XDocument.Load(dataFile); IEnumerable<XElement> elements = (from el in doc.Root.Elements("Auto") where (string)el.Element("aid").Value == auto.ID.ToString() select el); if (elements.Count() > 0) elements.First().Remove(); doc.Save(dataFile); }
private void btn_upnew_Click(object sender, System.EventArgs e) { webBrowser3.Navigate("https://myseller.taobao.com/seller_admin.htm"); webBrowser3.Focus(); if (Browser.WaitWebPageLoad(" getElementsByDataSpm('d48')[0] ", webBrowser3)) { //点击发布新品 Browser.MouseLeftByHtmlElement(" getElementsByDataSpm('d48')[0] ", webBrowser3); if (Browser.WaitWebPageLoad(" document.getElementsByClassName('cc-tree-item')[3] ", webBrowser3)) { //Browser.Delay(100); //点击“箱包皮具/热卖女包/男包”类目 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('cc-tree-item')[3].click() ", webBrowser3); Browser.Delay(500); if (Browser.WaitWebPageLoad(" document.getElementsByClassName('cc-cbox-group')[4].getElementsByTagName('li')[1] ", webBrowser3)) { //点击“双肩背包”类目 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('cc-cbox-group')[4].getElementsByTagName('li')[1].click(); ", webBrowser3); //Browser.MouseLeftByHtmlElement(" document.getElementsByClassName('cc-cbox-group')[4].getElementsByTagName('li')[1] ", webBrowser3); //等待刷新数据 Browser.Delay(100); //点击发布 if (Browser.WaitWebPageLoad(" document.getElementById('J_CatePubBtn') ", webBrowser3)) { Browser.MouseLeftByHtmlElement(" document.getElementById('J_CatePubBtn') ", webBrowser3); //打开发布页面,设置默认选项 if (Browser.WaitWebPageLoad(" document.getElementsByName('radio0')[0] ", webBrowser3)) { Browser.Delay(200); //点击宝贝类型为全新 //Browser.MouseLeftByHtmlElement_Wait(" document.getElementsByName('radio0')[0] ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByName('radio0')[0].click(); ", webBrowser3); //宝贝卖点 string maidian = XMLHelper.GetValue("TaoBao_MaiDian"); Auto.Clipboard_In(maidian); Browser.MouseLeftByHtmlElement(" document.getElementById('subTitle').getElementsByTagName('textarea')[0]", webBrowser3); Auto.Ctrl_V(); //Browser.JS_WebBrowser_NoReturn(" document.getElementById('subTitle').getElementsByTagName('textarea')[0].value='" + maidian + "' ", webBrowser3); //货号 string huohao = "ZZD" + DateTime.Now.ToString("MMdd");//+ Manager.RandomNumber(1, 9).ToString(); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('inputbox')[2].getElementsByTagName('input')[0].value='" + huohao + "' ", webBrowser3); //大小:小 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[1].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[1].getElementsByTagName('li')[3].click(); ", webBrowser3); //容纳电脑尺寸:8寸 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[2].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[2].getElementsByTagName('li')[1].click(); ", webBrowser3); //是否有背部缓冲棉:否 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[3].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[3].getElementsByTagName('li')[1].click(); ", webBrowser3); //适用对象:儿童 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[4].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[4].getElementsByTagName('li')[4].click(); ", webBrowser3); //防水程度:防泼水 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[5].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[5].getElementsByTagName('li')[3].click(); ", webBrowser3); //性别:女 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[6].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[6].getElementsByTagName('li')[2].click(); ", webBrowser3); //质地:帆布 //Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[7].click(); ", webBrowser3); //Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[7].getElementsByTagName('li')[11].click(); ", webBrowser3); //质地:PU Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[7].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[7].getElementsByTagName('li')[1].click(); ", webBrowser3); Browser.Delay(1500); //材质工艺:软面 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[8].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[8].getElementsByTagName('li')[5].click(); ", webBrowser3); //提拎部件类型:软把 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[9].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[9].getElementsByTagName('li')[3].click(); ", webBrowser3); //闭合方式:拉链 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[10].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[10].getElementsByTagName('li')[1].click(); ", webBrowser3); //箱包外袋种类:内贴袋 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[11].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[11].getElementsByTagName('li')[2].click(); ", webBrowser3); //流行元素:绣花 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[12].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[12].getElementsByTagName('li')[14].click(); ", webBrowser3); //图案:纯色 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[13].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[13].getElementsByTagName('li')[1].click(); ", webBrowser3); //夹层:无 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[14].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[14].getElementsByTagName('li')[2].click(); ", webBrowser3); //箱包软硬:软 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[15].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[15].getElementsByTagName('li')[1].click(); ", webBrowser3); //是否可折叠:否 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[16].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[16].getElementsByTagName('li')[2].click(); ", webBrowser3); //成色:全新 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[17].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[17].getElementsByTagName('li')[1].click(); ", webBrowser3); //适用场景:校园 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[18].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[18].getElementsByTagName('li')[2].click(); ", webBrowser3); //风格:日韩 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[19].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[19].getElementsByTagName('li')[2].click(); ", webBrowser3); //形状: Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[20].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[20].getElementsByTagName('li')[14].click(); ", webBrowser3); //肩带样式:双根 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[21].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[21].getElementsByTagName('li')[2].click(); ", webBrowser3); //里料素材:软把 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[22].click(); ", webBrowser3); Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[22].getElementsByTagName('li')[8].click(); ", webBrowser3); //************************************************ //采购地:国内 Browser.JS_WebBrowser_NoReturn(" document.getElementsByName('radio3')[0].click(); ", webBrowser3); //手机端描述:使用神笔模板编辑 Browser.JS_WebBrowser_NoReturn(" document.getElementsByName('radio11')[1].click(); ", webBrowser3); //电脑端描述 string miaoshu = XMLHelper.GetValue("TaoBao_MiaoShu"); Browser.MouseLeftByHtmlElement(" document.getElementsByClassName('ks-editor')[0].innerHTML=" + miaoshu, webBrowser3); //******************************************** //品牌选择其他*** Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-inputbox')[0].click(); ", webBrowser3); //点选品牌查询框 //Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-search')[0].getElementsByTagName('input')[0].focus(); ", webBrowser3); Browser.MouseLeftByHtmlElement_Wait(" document.getElementsByClassName('combobox-search')[0].getElementsByTagName('input')[0] ", webBrowser3); Browser.Delay(500); //系统粘贴 Auto.Clipboard_In("其他"); Auto.Clipboard_Out(); Browser.Delay(800); //选择“other/其他”选项 Browser.JS_WebBrowser_NoReturn(" document.getElementsByClassName('combobox-opts')[0].getElementsByTagName('li')[0].click(); ", webBrowser3); //******************************************** MessageBox.Show("可以开始上架新品了!"); } } } } } }
public void addCar(Auto auto, bool update = false) { XDocument doc = XDocument.Load(dataFile); //Poistetaan olemassa oleava auto jos pävitetään vanhan auton tietoja if (update == true) { IEnumerable<XElement> elements = (from el in doc.Root.Elements("Auto") where (string)el.Element("aid").Value == auto.ID.ToString() select el); if (elements.Count() > 0) elements.First().Remove(); } XElement element = new XElement("Auto", new XElement("aid", auto.ID), new XElement("rekkari", auto.Rekkari), new XElement("merkki", auto.Merkki), new XElement("malli", auto.Malli), new XElement("vm", auto.VuosiMalli), new XElement("myyntiHinta", auto.MyyntiHinta), new XElement("sisaanOstoHinta", auto.SisaanOstoHinta) ); doc.Root.Add(element); doc.Save(dataFile); }
public static IList<Auto> GetAutos(string field, string descOrAsc, int startIndex, int count) { IList<Auto> autos = new List<Auto>(); using (CarsEntity autorentEntityContext = new CarsEntity()) { try { var queryAutosJoin = from a in autorentEntityContext.Autoes join photo in autorentEntityContext.AutoPhotos on a.Number equals photo.AutoNumber orderby a.DayRate descending select new { Autos = a, photo.PhotoFileName }; foreach (var item in queryAutosJoin) { Auto auto = new Auto(); auto.Advance = item.Autos.Advance; auto.BodyType = (e_BodyType)item.Autos.BodyType; auto.CarColor = item.Autos.ColorGroup; auto.CarNumber = item.Autos.Number; auto.CreationYear = item.Autos.Year; auto.CurrentMilage = item.Autos.Mileage; auto.Status = (CurrentStatus)item.Autos.Status; auto.KmRate = item.Autos.KmRate; auto.DayRate = item.Autos.DayRate; auto.Engine = item.Autos.Engine; auto.ModelID = item.Autos.ModelId; auto.PhotoFileName = item.PhotoFileName.FirstOrDefault().ToString(); autos.Add(auto); } } catch (InvalidOperationException ex) { throw ex; } } return autos; }
private void btnAgregarAuto_Click(object sender, EventArgs e) { _miAuto = new Auto(this.txtNombrePiloto.Text, (EFabricante)this.cmbFabricante.SelectedItem); this._miCarrera += _miAuto; MostrarListado(); }
/// <summary> /// Chargement du jeu /// </summary> private void FormRushHour_Load(object sender, EventArgs e) { for (int i = 0; i < tlpRushHour.ColumnCount; i++) { for (int j = 0; j < tlpRushHour.RowCount; j++) { PictureBox boite = new PictureBox(); boite.Width = tlpRushHour.Width / tlpRushHour.ColumnCount; boite.Height = tlpRushHour.Height / tlpRushHour.RowCount; boite.BackColor = Color.Gray; boite.Margin = new Padding(0, 0, 0, 0); tlpRushHour.Controls.Add(boite, i, j); boite.Click += new System.EventHandler(Case_Click); } } jeu = new Partie(1); Actualiser(); caseXselectionne = 0; caseYselectionne = 0; autoSelectionne = new Auto(0, 0, 0, 0, 0); }
static void OnLoadingComplete(EventArgs args) { if (!_Player.ChampionName.Contains("Ezreal")) { return; } Chat.Print("Ezreal7 Loaded!", Color.GreenYellow); Chat.Print("Please Setting Target Harass Before Playing", Color.Yellow); Bootstrap.Init(null); Q = new Spell.Skillshot(SpellSlot.Q, 1150, SkillShotType.Linear, 250, 2000, 60); W = new Spell.Skillshot(SpellSlot.W, 1000, SkillShotType.Linear, 250, 1550, 80); W.AllowedCollisionCount = int.MaxValue; E = new Spell.Skillshot(SpellSlot.E, 475, SkillShotType.Linear, 250, 2000, 100); R = new Spell.Skillshot(SpellSlot.R, 5000, SkillShotType.Linear, 1000, 2000, 160); R.AllowedCollisionCount = int.MaxValue; Botrk = new Item(ItemId.Blade_of_the_Ruined_King); Bil = new Item(3144, 475f); Ignite = new Spell.Targeted(ObjectManager.Player.GetSpellSlotFromName("summonerdot"), 600); Menu = MainMenu.AddMenu("Ezreal7", "Ezreal"); Menu.AddSeparator(); ComboMenu = Menu.AddSubMenu("Combo Settings", "Combo"); ComboMenu.AddSeparator(); ComboMenu.AddGroupLabel("Combo Settings"); ComboMenu.Add("ComboQ", new CheckBox("Spell [Q]")); ComboMenu.Add("ComboW", new CheckBox("Spell [W]")); ComboMenu.AddSeparator(); ComboMenu.Add("ComboR", new CheckBox("Spell [R]")); ComboMenu.AddSeparator(); ComboMenu.Add("MinRangeR", new Slider("Min Range Cast [R]", 1000, 0, 5000)); ComboMenu.AddSeparator(); ComboMenu.Add("MaxRangeR", new Slider("Max Range Cast [R]", 3000, 0, 5000)); ComboMenu.AddSeparator(); ComboMenu.Add("MinR", new Slider("Min Enemies Use [R]", 2, 0, 5)); HarassMenu = Menu.AddSubMenu("Harass Settings", "Harass"); HarassMenu.AddGroupLabel("Harass Settings"); HarassMenu.Add("HarassQ", new CheckBox("Spell [Q]")); HarassMenu.Add("ManaQ", new Slider("Min Mana Harass [Q]", 40)); HarassMenu.AddSeparator(); HarassMenu.Add("HarassW", new CheckBox("Spell [W]", false)); HarassMenu.Add("ManaW", new Slider("Min Mana Harass [W]<=", 40)); HarassMenu.AddSeparator(); HarassMenu.AddGroupLabel("Harass On"); foreach (var enemies in EntityManager.Heroes.Enemies) { HarassMenu.Add("haras" + enemies.ChampionName, new CheckBox("" + enemies.ChampionName)); } Auto = Menu.AddSubMenu("Auto Harass Settings", "Auto Harass"); Auto.AddGroupLabel("Auto Harass Settings"); Auto.Add("AutoQ", new CheckBox("Auto [Q]")); Auto.Add("AutomanaQ", new Slider("Min Mana Auto [Q]", 60)); Auto.AddSeparator(); Auto.Add("AutoW", new CheckBox("Auto [W]", false)); Auto.Add("AutomanaW", new Slider("Min Mana Auto [W]", 60)); Auto.AddSeparator(); Auto.AddGroupLabel("Auto Harass On"); foreach (var enemies in EntityManager.Heroes.Enemies) { Auto.Add("harass" + enemies.ChampionName, new CheckBox("" + enemies.ChampionName)); } LaneClearMenu = Menu.AddSubMenu("LaneClear Settings", "LaneClear"); LaneClearMenu.AddGroupLabel("LastHit Settings"); LaneClearMenu.Add("LastQ", new CheckBox("Always [Q] LastHit")); LaneClearMenu.Add("LhMana", new Slider("Min Mana Lasthit [Q]", 60)); LaneClearMenu.AddSeparator(); LaneClearMenu.Add("LhAA", new CheckBox("Only [Q] LastHit If Out Range AA", false)); LaneClearMenu.Add("AAMana", new Slider("Min Mana Lasthit [Q] If Out Range AA", 50)); LaneClearMenu.AddSeparator(); LaneClearMenu.AddGroupLabel("Lane Clear Settings"); LaneClearMenu.Add("LastQLC", new CheckBox("Always LastHit With [Q]", false)); LaneClearMenu.Add("ManaLC", new Slider("Min Mana LaneClear With [Q]", 70)); LaneClearMenu.AddSeparator(); LaneClearMenu.Add("LastAA", new CheckBox("Only [Q] LastHit If Out Range AA")); LaneClearMenu.Add("ManaLA", new Slider("Min Mana LastHit [Q] If Out Range AA", 50)); JungleClearMenu = Menu.AddSubMenu("JungleClear Settings", "JungleClear"); JungleClearMenu.AddGroupLabel("JungleClear Settings"); JungleClearMenu.Add("QJungle", new CheckBox("Spell [Q]")); JungleClearMenu.Add("MnJungle", new Slider("Min Mana JungleClear [Q]", 30)); Misc = Menu.AddSubMenu("Misc Settings", "Misc"); Misc.AddGroupLabel("AntiGap Settings"); Misc.Add("AntiGap", new CheckBox("Use [E] AntiGapcloser")); Misc.AddSeparator(); Misc.AddGroupLabel("Ultimate On CC Settings"); Misc.Add("Rstun", new CheckBox("Use [R] If Enemy Has CC")); Misc.Add("MinR", new Slider("Min Range Use [R]", 800, 300, 2000)); Misc.Add("MaxR", new Slider("Max Range Use [R]", 2200, 300, 30000)); Misc.AddSeparator(); Misc.AddGroupLabel("Auto Stacks Settings"); Misc.Add("Stack", new CheckBox("Auto Stacks In Shop")); Misc.AddGroupLabel("Items Settings"); Misc.Add("BOTRK", new CheckBox("Use [Botrk]")); Misc.Add("ihp", new Slider("My HP Use BOTRK <=", 50)); Misc.Add("ihpp", new Slider("Enemy HP Use BOTRK <=", 50)); KillStealMenu = Menu.AddSubMenu("KillSteal Settings", "KillSteal"); KillStealMenu.AddGroupLabel("KillSteal Settings"); KillStealMenu.Add("KsQ", new CheckBox("Use [Q] KillSteal")); KillStealMenu.Add("KsW", new CheckBox("Use [W] KillSteal")); KillStealMenu.Add("ign", new CheckBox("Use [Ignite] KillSteal")); KillStealMenu.AddSeparator(); KillStealMenu.AddGroupLabel("Ultimate Settings"); KillStealMenu.Add("KsR", new CheckBox("Use [R] KillSteal")); KillStealMenu.Add("minKsR", new Slider("Min [R] Range KillSteal", 900, 1, 5000)); KillStealMenu.Add("maxKsR", new Slider("Max [R] Range KillSteal", 4000, 1, 5000)); Skin = Menu.AddSubMenu("Skin Changer", "SkinChanger"); Skin.Add("checkSkin", new CheckBox("Use Skin Changer")); Skin.Add("skin.Id", new ComboBox("Skin Mode", 8, "Default", "1", "2", "3", "4", "5", "6", "7", "8")); Drawings = Menu.AddSubMenu("Draw Settings", "Draw"); Drawings.AddGroupLabel("Drawing Settings"); Drawings.Add("DrawQ", new CheckBox("Q Range")); Drawings.Add("DrawW", new CheckBox("W Range", false)); Drawings.Add("DrawE", new CheckBox("E Range", false)); Drawing.OnDraw += Drawing_OnDraw; Game.OnTick += Game_OnTick; Gapcloser.OnGapcloser += Gapcloser_OnGapcloser; }
static void Main(string[] args) { Console.WriteLine("1-decorator,2-adapter,3-composite"); int number = 1; while (number != 0) { Console.WriteLine("enter pattern number"); number = Convert.ToInt32(Console.ReadLine()); switch (number) { case 1: Console.WriteLine("enter pizza number"); Console.WriteLine("1-итальянская пицца с томатами,2- итальянская пиццы с сыром,3-итальянская пиццы с томатами и сыром"); int number1 = 1; if (number1 != 0) { number1 = Convert.ToInt32(Console.ReadLine()); switch (number1) { case 1: Console.WriteLine("итальянская пицца с томатами"); Pizza pizza1 = new ItalianPizza(); pizza1 = new TomatoPizza(pizza1); Console.WriteLine("Название: {0}", pizza1.Name); Console.WriteLine("Цена: {0}", pizza1.GetCost()); break; case 2: Console.WriteLine(" итальянская пиццы с сыром"); Pizza pizza2 = new ItalianPizza(); pizza2 = new CheesePizza(pizza2); Console.WriteLine("Название: {0}", pizza2.Name); Console.WriteLine("Цена: {0}", pizza2.GetCost()); break; case 3: Console.WriteLine("итальянская пиццы с томатами и сыром"); Pizza pizza3 = new ItalianPizza(); pizza3 = new TomatoPizza(pizza3); pizza3 = new CheesePizza(pizza3); Console.WriteLine("Название: {0}", pizza3.Name); Console.WriteLine("Цена: {0}", pizza3.GetCost()); break; default: Console.WriteLine("error"); break; } } break; case 2: // путешественник Driver driver = new Driver(); // машина Auto auto = new Auto(); // отправляемся в путешествие driver.Travel(auto); // встретились пески, надо использовать верблюда Camel camel = new Camel(); // используем адаптер ITransport camelTransport = new CamelToTransportAdapter(camel); // продолжаем путь по пескам пустыни driver.Travel(camelTransport); break; case 3: Component fileSystem = new Directory("Файловая система"); // определяем новый диск Component diskC = new Directory("Диск С"); // новые файлы Component pngFile = new File("12345.png"); Component docxFile = new File("Document.docx"); // добавляем файлы на диск С diskC.Add(pngFile); diskC.Add(docxFile); // добавляем диск С в файловую систему fileSystem.Add(diskC); // выводим все данные fileSystem.Print(); Console.WriteLine(); // удаляем с диска С файл diskC.Remove(pngFile); // создаем новую папку Component docsFolder = new Directory("Мои Документы"); // добавляем в нее файлы Component txtFile = new File("readme.txt"); Component csFile = new File("Program.cs"); docsFolder.Add(txtFile); docsFolder.Add(csFile); diskC.Add(docsFolder); fileSystem.Print(); break; default: Console.WriteLine("error"); break; } number = 1; } }
public void T8() { object value = Auto.Make <object>(); Assert.That(value, Is.Not.Null); }
private void TextBox7_TextChanged(object sender, EventArgs e) => Model.Parts.MainBody.Rb = Auto.CheckTextBoxChange(textBox7, 730);
public void T12() { DataTable value = Auto.Make <DataTable>(); Assert.That(value, Is.Not.Null); }
private void TextBox4_TextChanged(object sender, EventArgs e) => Model.Parts.MainBody.A = Auto.CheckTextBoxChange(textBox4, 15);
void ToonDetails(Auto auto) { }
private void TextBox3_TextChanged(object sender, EventArgs e) => Model.Parts.MainBody.B = Auto.CheckTextBoxChange(textBox3, Model.Parts.MainBody.D / 2 / 2);
private void Save_Click(object sender, EventArgs e) => Auto.SavePart(app, saveFileDialog1, this, api);
private void TextBox8_TextChanged(object sender, EventArgs e) => Model.Parts.MainBody.Rm = Auto.CheckTextBoxChange(textBox8, 24);
public static IList<Auto> GetAutos(Guid modelID, string carColor, int creationYear, CurrentStatus status) { IList<Auto> autos = new List<Auto>(); using (CarsEntity autorentEntityContext = new CarsEntity()) { try { var queryAutosJoin = from a in autorentEntityContext.Autoes join photo in autorentEntityContext.AutoPhotos on a.Number equals photo.AutoNumber where a.ModelId == modelID && a.ColorGroup == carColor && a.Year == creationYear && a.Status == (short)status select new { Autos = a, photo.PhotoFileName }; foreach (var item in queryAutosJoin) { Auto auto = new Auto(); auto.Advance = item.Autos.Advance; auto.BodyType = (e_BodyType)item.Autos.BodyType; auto.CarColor = item.Autos.ColorGroup; auto.CarNumber = item.Autos.Number; auto.CreationYear = item.Autos.Year; auto.CurrentMilage = item.Autos.Mileage; auto.Status = (CurrentStatus)item.Autos.Status; auto.KmRate = item.Autos.KmRate; auto.DayRate = item.Autos.DayRate; auto.Engine = item.Autos.Engine; auto.ModelID = item.Autos.ModelId; auto.PhotoFileName = item.PhotoFileName.FirstOrDefault().ToString(); autos.Add(auto); } } catch (InvalidOperationException ex) { throw ex; } } return autos; }
private void TextBox2_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.D1 = Auto.CheckTextBoxChange(textBox2, 440);
/// <summary> /// Clic sur une case du jeu /// </summary> private void Case_Click(object sender, EventArgs e) { int nbauto = 0; nbauto = jeu.NbAutodifficulte[jeu.Difficulte]; Control caseClic = (Control)sender; int positionX = tlpRushHour.GetColumn(caseClic); int positionY = tlpRushHour.GetRow(caseClic); for (int i = 0; i < nbauto; i++) { if (jeu.LesAutos[i].PositionX == positionX && jeu.LesAutos[i].PositionY == positionY) { caseXselectionne = positionX; caseYselectionne = positionY; autoSelectionne = jeu.LesAutos[i]; } } for (int i = 0; i < nbauto; i++) { if (jeu.LesAutos[i] == autoSelectionne) { if (autoSelectionne.Orientation == (int)CodeOrientation.Droite) { if (positionX == caseXselectionne + 1 && positionY == caseYselectionne) { if (jeu.PeutAvancer(jeu.LesAutos[i].Couleur)) { jeu.LesAutos[jeu.TabJeu[caseXselectionne, caseYselectionne]].Avancer(); AutoBouger(positionX, positionY, i); } } else if (positionX == caseXselectionne - 1 && positionY == caseYselectionne) { if (jeu.PeutReculer(jeu.LesAutos[i].Couleur)) { jeu.LesAutos[jeu.TabJeu[caseXselectionne, caseYselectionne]].Reculer(); AutoBouger(positionX, positionY, i); } } } else if (autoSelectionne.Orientation == (int)CodeOrientation.Bas) { if (positionY == caseYselectionne + 1 && positionX == caseXselectionne) { if (jeu.PeutAvancer(jeu.LesAutos[i].Couleur)) { jeu.LesAutos[jeu.TabJeu[caseXselectionne, caseYselectionne]].Avancer(); AutoBouger(positionX, positionY, i); } } else if (positionY == caseYselectionne - 1 && positionX == caseXselectionne) { if (jeu.PeutReculer(jeu.LesAutos[i].Couleur)) { jeu.LesAutos[jeu.TabJeu[caseXselectionne, caseYselectionne]].Reculer(); AutoBouger(positionX, positionY, i); } } } } } Actualiser(); }
private void TextBox3_TextChanged(object sender, EventArgs e) { Model.Parts.Bottom.H1 = Auto.CheckTextBoxChange(textBox3, 30); textBox1.Text = Convert.ToString(Model.Parts.Bottom.H1 + Model.Parts.Bottom.H2 + Model.Parts.Bottom.HB + Model.Parts.Bottom.H3); }
/// <summary> /// Met à jour quelle voiture est sélectionner avec les bonnes positions /// </summary> /// <param name="positionX">Position en X de la nouvelle case seletionnée</param> /// <param name="positionY">Position en Y de la nouvelle case seletionnée</param> /// <param name="autoBouger">Couleur de l'auto bouger</param> private void AutoBouger(int positionX, int positionY, int autoBouger) { caseXselectionne = positionX; caseYselectionne = positionY; autoSelectionne = jeu.LesAutos[autoBouger]; }
private void TextBox4_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.DR = Auto.CheckTextBoxChange(textBox4, 395);
private void TextBox5_TextChanged(object sender, EventArgs e) => Model.Parts.Bottom.Or = Auto.CheckTextBoxChange(textBox5, 11);
public static void Execute() { Menuini = MainMenu.AddMenu("KappAzir", "KappAzir"); Auto = Menuini.AddSubMenu("Auto Settings"); JumperMenu = Menuini.AddSubMenu("Jumper Settings"); ComboMenu = Menuini.AddSubMenu("Combo Settings"); HarassMenu = Menuini.AddSubMenu("Harass Settings"); LaneClearMenu = Menuini.AddSubMenu("LaneClear Settings"); JungleClearMenu = Menuini.AddSubMenu("JungleClear Settings"); KillstealMenu = Menuini.AddSubMenu("KillSteal Settings"); DrawMenu = Menuini.AddSubMenu("Drawings Settings"); ColorMenu = Menuini.AddSubMenu("ColorPicker"); Auto.AddGroupLabel("Settings"); Auto.Add("gap", new CheckBox("Anti-GapCloser")); Auto.Add("int", new CheckBox("Interrupter")); Auto.Add("danger", new ComboBox("Interrupter DangerLevel", 1, "High", "Medium", "Low")); Auto.AddGroupLabel("Turret Settings"); Auto.Add("tower", new CheckBox("Create Turrets")); Auto.Add("Tenemy", new Slider("Create Turret If [{0}] Enemies Near", 3, 1, 6)); Auto.AddGroupLabel("Anti GapCloser Spells"); foreach (var spell in from spell in Gapcloser.GapCloserList from enemy in EntityManager.Heroes.Enemies.Where(enemy => spell.ChampName == enemy.ChampionName) select spell) { Auto.Add(spell.SpellName, new CheckBox(spell.ChampName + " " + spell.SpellSlot)); } if (EntityManager.Heroes.Enemies.Any(e => e.Hero == Champion.Rengar)) { Auto.Add("rengar", new CheckBox("Rengar Leap")); } JumperMenu.Add("jump", new KeyBind("WEQ Flee Key", false, KeyBind.BindTypes.HoldActive, 'A')); JumperMenu.Add("normal", new KeyBind("Normal Insec Key", false, KeyBind.BindTypes.HoldActive, 'S')); JumperMenu.Add("new", new KeyBind("New Insec Key", false, KeyBind.BindTypes.HoldActive, 'Z')); JumperMenu.Add("flash", new CheckBox("Use Flash for Possible AoE")); JumperMenu.Add("delay", new Slider("Delay EQ", 200, 0, 500)); JumperMenu.Add("range", new Slider("Check for soldiers Range", 800, 0, 1000)); ComboMenu.AddGroupLabel("Combo Settings"); ComboMenu.Add("key", new KeyBind("Combo Key", false, KeyBind.BindTypes.HoldActive, 32)); ComboMenu.AddSeparator(0); ComboMenu.AddGroupLabel("Q Settings"); ComboMenu.Add("Q", new CheckBox("Use Q")); ComboMenu.Add("WQ", new CheckBox("Use W > Q")); ComboMenu.Add("Qaoe", new CheckBox("Use Q Aoe", false)); ComboMenu.Add("QS", new Slider("Soldiers To Use Q", 1, 1, 3)); ComboMenu.AddSeparator(0); ComboMenu.AddGroupLabel("W Settings"); ComboMenu.Add("W", new CheckBox("Use W")); ComboMenu.Add("Wsave", new CheckBox("Save 1 W Stack", false)); ComboMenu.Add("WS", new Slider("Soldier Limit To Create", 3, 1, 3)); ComboMenu.AddSeparator(0); ComboMenu.AddGroupLabel("E Settings"); ComboMenu.Add("E", new CheckBox("Use E")); ComboMenu.Add("Ekill", new CheckBox("E Killable Enemy Only")); ComboMenu.Add("Edive", new CheckBox("E Dive Turrets", false)); ComboMenu.Add("EHP", new Slider("Only E if my HP is more than [{0}%]", 50)); ComboMenu.Add("Esafe", new Slider("Dont E Into [{0}] Enemies", 3, 1, 6)); ComboMenu.AddSeparator(0); ComboMenu.AddGroupLabel("R Settings"); ComboMenu.Add("R", new CheckBox("Use R")); ComboMenu.Add("Rkill", new CheckBox("R Finisher")); ComboMenu.Add("insec", new CheckBox("Try to insec in Combo")); ComboMenu.Add("Raoe", new Slider("R AoE Hit [{0}] Enemies", 3, 1, 6)); ComboMenu.Add("Rsave", new CheckBox("R Save Self")); ComboMenu.Add("RHP", new Slider("Push Enemy If my health is less than [{0}%]", 35)); HarassMenu.AddGroupLabel("Harass Settings"); HarassMenu.Add("key", new KeyBind("Harass Key", false, KeyBind.BindTypes.HoldActive, 'C')); HarassMenu.Add("toggle", new KeyBind("Auto Harass Key", false, KeyBind.BindTypes.PressToggle, 'H')); HarassMenu.AddSeparator(0); HarassMenu.AddGroupLabel("Q Settings"); HarassMenu.Add("Q", new CheckBox("Use Q")); HarassMenu.Add("WQ", new CheckBox("Use W > Q")); HarassMenu.Add("QS", new Slider("Soldiers To Use Q", 1, 1, 3)); HarassMenu.Add("Qmana", new Slider("Stop using Q if Mana < [{0}%]", 65)); HarassMenu.AddSeparator(0); HarassMenu.AddGroupLabel("W Settings"); HarassMenu.Add("W", new CheckBox("Use W")); HarassMenu.Add("Wsave", new CheckBox("Save 1 W Stack")); HarassMenu.Add("WS", new Slider("Soldier Limit To Create", 3, 1, 3)); HarassMenu.Add("Wmana", new Slider("Stop using W if Mana < [{0}%]", 65)); HarassMenu.AddSeparator(0); HarassMenu.AddGroupLabel("E Settings"); HarassMenu.Add("E", new CheckBox("Use E")); HarassMenu.Add("Edive", new CheckBox("E Dive Turrets", false)); HarassMenu.Add("EHP", new Slider("Only E if my HP is more than [{0}%]", 50)); HarassMenu.Add("Esafe", new Slider("Dont E Into [{0}] Enemies", 3, 1, 6)); HarassMenu.Add("Emana", new Slider("Stop using E if Mana < [{0}%]", 65)); LaneClearMenu.AddGroupLabel("LaneClear Settings"); LaneClearMenu.Add("key", new KeyBind("LaneClear Key", false, KeyBind.BindTypes.HoldActive, 'V')); LaneClearMenu.Add("Q", new CheckBox("Use Q")); LaneClearMenu.Add("Qmana", new Slider("Stop using Q if Mana < [{0}%]", 65)); LaneClearMenu.Add("W", new CheckBox("Use W")); LaneClearMenu.Add("Wsave", new CheckBox("Save 1 W Stack")); LaneClearMenu.Add("Wmana", new Slider("Stop using W if Mana < [{0}%]", 65)); JungleClearMenu.AddGroupLabel("JungleClear Settings"); JungleClearMenu.Add("key", new KeyBind("JungleClear Key", false, KeyBind.BindTypes.HoldActive, 'V')); JungleClearMenu.Add("Q", new CheckBox("Use Q")); JungleClearMenu.Add("Qmana", new Slider("Stop using Q if Mana < [{0}%]", 65)); JungleClearMenu.Add("W", new CheckBox("Use W")); JungleClearMenu.Add("Wsave", new CheckBox("Save 1 W Stack")); JungleClearMenu.Add("Wmana", new Slider("Stop using W if Mana < [{0}%]", 65)); KillstealMenu.AddGroupLabel("KillSteal Settings"); KillstealMenu.Add("Q", new CheckBox("Use Q")); KillstealMenu.Add("E", new CheckBox("Use E")); KillstealMenu.Add("R", new CheckBox("Use R")); foreach (var spell in Azir.SpellList) { DrawMenu.Add(spell.Slot.ToString(), new CheckBox(spell.Slot + " Range")); ColorMenu.Add(spell.Slot.ToString(), new ColorPicker(spell.Slot + " Color", System.Drawing.Color.Chartreuse)); } DrawMenu.Add("insec", new CheckBox("Draw Insec Helpers")); }