static void Main(string[] args) { //Lav instans af struct Koordinat k = new Koordinat(10, 50); k.Vis(); }
public Lokalitet(string kommunenavn, int kommunenummer, string stedsnavn, int nameType, string språk, string product, string typeDescription, Koordinat koordinat) { Kommunenavn = kommunenavn; Kommunenummer = kommunenummer; Stedsnavn = stedsnavn; NameType = nameType; Språk = språk; Product = product; TypeDescription = typeDescription; Navn = stedsnavn; Koordinat = koordinat; Beskrivelse = product; }
private void dtgBoard_CellContentClick(object sender, DataGridViewCellEventArgs e) { Koordinat Wall; for (int i = 0; i < dtgBoard.SelectedCells.Count; i++) { Wall = new Koordinat(); Wall.X = dtgBoard.SelectedCells[i].ColumnIndex; Wall.Y = dtgBoard.SelectedCells[i].RowIndex; Board[Wall.X, Wall.Y].isWall = true; dtgBoard.SelectedCells[i].Value = Bitmap.FromFile(SolutionPath + @"\Content\duvar.jpg"); } }
static void Main(string[] args) { BasicHttpBinding bind = new BasicHttpBinding(); ChannelFactory<IMatematika> objChannel = new ChannelFactory<IMatematika>(bind, "http://localhost:1907"); IMatematika obj = objChannel.CreateChannel(); double hasilTambah = obj.Tambah(1, 2); Console.WriteLine("1 + 2 = " + hasilTambah); double hasilKurang = obj.Kurang(3, 2); Console.WriteLine("3 - 2 = " + hasilKurang); double hasilKali = obj.Kali(2, 2); Console.WriteLine("2 x 2 = " + hasilKali); double hasilBagi = obj.Bagi(2, 2); Console.WriteLine("2 / 2 = " + hasilBagi); Console.ReadLine(); Koordinat objk = new Koordinat(); }
private void Form1_Load(object sender, EventArgs e) { BasicHttpBinding bind = new BasicHttpBinding(); ChannelFactory <IMatematika> objChannel = new ChannelFactory <IMatematika>(bind, "http://localhost:1907"); IMatematika obj = objChannel.CreateChannel(); double hasilTambah = obj.Tambah(1, 2); // Console.WriteLine("1 + 2 = " + hasilTambah); double hasilKurang = obj.Kurang(3, 2); // Console.WriteLine("3 - 2 = " + hasilKurang); double hasilKali = obj.Kali(2, 2); // Console.WriteLine("2 x 2 = " + hasilKali); double hasilBagi = obj.Bagi(2, 2); // Console.WriteLine("2 / 2 = " + hasilBagi); // Console.ReadLine(); Koordinat objk = new Koordinat(); }
private void Form1_Load(object sender, EventArgs e) { BasicHttpBinding bind = new BasicHttpBinding(); ChannelFactory <IMatematika> objChannel = new ChannelFactory <IMatematika>(bind, "http://localhost:1907"); IMatematika obj = objChannel.CreateChannel(); double hasilTambah = obj.Tambah(1, 2); double hasilKurang = obj.Kurang(3, 2); double hasilKali = obj.Kali(2, 2); double hasilBagi = obj.Bagi(2, 2); Koordinat objk = new Koordinat(); label2.Text = "1 + 2 = " + hasilTambah + Environment.NewLine + "3 - 2 = " + hasilKurang + Environment.NewLine + "2 x 2 = " + hasilKali + Environment.NewLine + "2 / 2 = " + hasilBagi + Environment.NewLine; }
public static Koordinat TransformCoordinate( Koordinat sourceKoordinat, int nyttKoordinatsystem) { if (sourceKoordinat.Koordinatsystem == nyttKoordinatsystem) { return(sourceKoordinat); } var coordinateSystemCombination = new Tuple <int, int>( sourceKoordinat.Koordinatsystem, nyttKoordinatsystem); var coordinateTransformation = GetCoordinateTransformation(coordinateSystemCombination); var point = coordinateTransformation.MathTransform.Transform(sourceKoordinat.Point); Koordinat result; switch (nyttKoordinatsystem) { case (int)Koordinatsystem.Wgs84LatLon: result = new LatLonKoordinat { Point = point }; break; case (int)Koordinatsystem.GoogleMercator: result = new GoogleMercatorKoordinat { Point = point }; break; default: result = new UtmKoordinat(nyttKoordinatsystem) { Point = point }; break; } result.MetricCoordinatePrecision = sourceKoordinat.MetricCoordinatePrecision; return(result); }
public Koordinat TKoordinat(Koordinat a, Koordinat b) { try { Koordinat hasil = new Koordinat(); hasil.X = a.X + b.X; hasil.Y = a.Y + b.Y; return(hasil); } catch (Exception ex) { Console.WriteLine(ex.Message); //secara default //trow new Exception(ex.Message) // pesan eror default // throw new FaultException("Pesan Salah"); //untuk meloloskan pesan order yang dikirim ke client MathFault mf = new MathFault(); mf.Kode = "Inputan Yang Anda Masukkan Salah"; mf.Pesan = "Masukkan Input Yang Benar"; throw new FaultException <MathFault>(mf); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); BasicHttpBinding bind = new BasicHttpBinding(); ChannelFactory <IMatematika> objChannel = new ChannelFactory <IMatematika>(bind, "http://localhost:1907"); IMatematika obj = objChannel.CreateChannel(); double hasilTambah = obj.Tambah(1, 2); Console.WriteLine("1 + 2 = " + hasilTambah); double hasilKurang = obj.Kurang(3, 2); Console.WriteLine("3 - 2 = " + hasilKurang); double hasilKali = obj.Kali(2, 2); Console.WriteLine("2 x 2 = " + hasilKali); double hasilBagi = obj.Bagi(2, 2); Console.WriteLine("2 / 2 = " + hasilBagi); Console.ReadLine(); Koordinat objk = new Koordinat(); }
static void Main(string[] args) { Insan i1 = new Insan(); Insan i2 = new Insan(); Insan i3 = new Insan(); Insan i4 = new Insan(); Insan i5 = new Insan(); Insan i6 = new Insan(); i1.yas = 25; i2.yas = 30; i3.yas = 21; i4.yas = 24; i5.yas = 27; i6.yas = 31; Koordinat p1 = new Koordinat(); Console.WriteLine(Koordinat.X + " " + Koordinat.Y); Console.WriteLine(Insan.InsanSayisiniSoyle() + " " + Insan.PI); Console.ReadLine(); }
public Kuzey(Koordinat koordinat) : base(koordinat) { }
public Yon(Koordinat koordinat) { Koordinat = koordinat; }
public async Task <IActionResult> Edit(int id, [Bind("KoordId,Xid,Yid," + "TidakKeX,TidakKeY," + "SbgAwalX,SbgAwalY," + "SbgAkhirX,SbgAkhirY," + "MiringAtas,MiringBawah," + "LengkungAtas,LengkungBawah," + "KiriBawahSemu," + "PermintaanDariGambar,Skala, IsiPolaId" )] OKoordTambahan koordTambah) { if (id != koordTambah.KoordId) { return(NotFound()); } var koord = new Koordinat() { KoordId = koordTambah.KoordId, //PolaId = koordTambah.PolaId, Xid = koordTambah.Xid, Yid = koordTambah.Yid, TidakKeX = koordTambah.TidakKeX, TidakKeY = koordTambah.TidakKeY, SbgAwalX = koordTambah.SbgAwalX, SbgAwalY = koordTambah.SbgAwalY, SbgAkhirX = koordTambah.SbgAkhirX, SbgAkhirY = koordTambah.SbgAkhirY, MiringAtas = koordTambah.MiringAtas, MiringBawah = koordTambah.MiringBawah, LengkungAtas = koordTambah.LengkungAtas, LengkungBawah = koordTambah.LengkungBawah, KiriBawahSemu = koordTambah.KiriBawahSemu }; if (ModelState.IsValid) { if (id == koordTambah.KoordId) { try { _context.Update(koord); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KoordinatExists(koord.KoordId)) { return(NotFound()); } else { throw; } } } if (koordTambah.PermintaanDariGambar) { // kembali ke index gambar return(RedirectToAction(nameof(Index), "Gambar", new { id = koordTambah.IsiPolaId, skl = koordTambah.Skala })); } else { return(RedirectToAction(nameof(Index), new { id = koordTambah.IsiPolaId })); } } if (koordTambah.PermintaanDariGambar) { //kembali ke action gambar garis di gambar return(RedirectToAction(nameof(Index), "Gambar", new { id = koordTambah.IsiPolaId, skl = koordTambah.Skala })); } return(View(koord)); }
private void frmBoard_Load(object sender, EventArgs e) { Yol = ""; boyut = frmGame.boyut; Board = new Node[boyut, boyut]; //DataTable dt = new DataTable(); //for (int i = 0; i < boyut; i++) // dt.Columns.Add(); //for (int i = 0; i < boyut; i++) // dt.Rows.Add(); //dtgBoard.DataSource = dt; DataTable dt = new DataTable(); for (int i = 0; i < boyut; i++) { Image image = Image.FromFile(SolutionPath + @"\Content\arkaplan.jpg"); dtgBoard.Columns.Add(new DataGridViewImageColumn() { Image = image, ImageLayout = DataGridViewImageCellLayout.Stretch }); } for (int i = 0; i < boyut; i++) { dtgBoard.Rows.Add(); } //Koordinatları belirleme for (int i = 0; i < boyut; i++) { for (int j = 0; j < boyut; j++) { Board[i, j] = new Node(i, j); } } //Node Komşu Tanımlama for (int i = 0; i < boyut; i++) { for (int j = 0; j < boyut; j++) { if (i - 1 >= 0) { Board[i, j].Neighbors.Add(Board[i - 1, j]); } if (i + 1 < boyut) { Board[i, j].Neighbors.Add(Board[i + 1, j]); } if (j - 1 >= 0) { Board[i, j].Neighbors.Add(Board[i, j - 1]); } if (j + 1 < boyut) { Board[i, j].Neighbors.Add(Board[i, j + 1]); } } } baslangic = frmGame.Baslangic; bitis = frmGame.Bitis; MessageBox.Show("Başlangıç Koordinatlar: " + (baslangic.X + 1).ToString() + "," + (baslangic.Y + 1).ToString() + "\n" + "Bitiş Koordinatlar: " + (bitis.X + 1).ToString() + "," + (bitis.Y + 1).ToString()); dtgBoard.Rows[baslangic.Y].Cells[baslangic.X].Value = Bitmap.FromFile(SolutionPath + @"\Content\fare.jpg"); dtgBoard.Rows[bitis.Y].Cells[bitis.X].Value = Bitmap.FromFile(SolutionPath + @"\Content\peynir.jpg"); string path = SolutionPath + @"\Content\Fare_Sesi.wav"; // Müzik adresi player.SoundLocation = path; }
public Bati(Koordinat koordinat) : base(koordinat) { }
public Dikdortgen(int yukseklik, int genislik, Koordinat solUst) { this.yukseklik = yukseklik; this.genislik = genislik; this.solUst = solUst; }
public Lokalitet(string stedsnavn, string product, Koordinat koordinat) { Navn = stedsnavn; Koordinat = koordinat; Beskrivelse = product; }
public Dogu(Koordinat koordinat) : base(koordinat) { }
public System.Threading.Tasks.Task <Koordinat> TKoordinatAsync(Koordinat a, Koordinat b) { return(base.Channel.TKoordinatAsync(a, b)); }
public Koordinat TKoordinat(Koordinat a, Koordinat b) { return(base.Channel.TKoordinat(a, b)); }
public static void Dosyalar(string yol, EKlasor yer, EOzelDurum ozelDurum = 0) { List <string> dosyalar = Directory.GetFiles(yol).ToList(); foreach (string dosya in dosyalar) { Koordinat krd = new Koordinat(); FileInfo dosyaBilgi = new FileInfo(dosya); krd.DosyaAdi = dosyaBilgi.Name; if (krd.DosyaAdi?.IndexOf("Koordinat.txt") > 0 || krd.DosyaAdi?.IndexOf("Koordinat.txt") > 0) { break; } else { using (FileStream dosyaAc = dosyaBilgi.OpenRead()) { using (StreamReader dosyaOku = new StreamReader(dosya)) { string satir; int satirSay = 1; while ((satir = dosyaOku.ReadLine()) != null) { switch (satirSay) { case 14: if (EKlasor.CSRS_PPP == yer && EOzelDurum.TABL != ozelDurum) { krd.X = satir.Substring(1, 12); krd.XM = satir.Substring(13, 6); } break; case 15: if (EKlasor.CSRS_PPP == yer && EOzelDurum.TABL != ozelDurum) { krd.Y = satir.Substring(2, 12); krd.YM = satir.Substring(14, 6); } else { krd.X = satir.Substring(2, 12); krd.XM = satir.Substring(14, 6); } break; case 16: if (EKlasor.CSRS_PPP == yer && EOzelDurum.TABL != ozelDurum) { krd.Z = satir.Substring(2, 12); krd.ZM = satir.Substring(14, 6); } else { krd.Y = satir.Substring(2, 12); krd.YM = satir.Substring(14, 6); } break; case 17: if (EKlasor.CSRS_PPP == yer && EOzelDurum.TABL == ozelDurum) { krd.Z = satir.Substring(2, 12); krd.ZM = satir.Substring(14, 6); } break; case 22: if (EKlasor.OPUS == yer) { krd.X = satir.Substring(17, 12); krd.XM = satir.Substring(34, 5); } break; case 23: if (EKlasor.OPUS == yer) { krd.Y = satir.Substring(17, 12); krd.YM = satir.Substring(34, 5); } break; case 24: if (EKlasor.OPUS == yer) { krd.Z = satir.Substring(17, 12); krd.ZM = satir.Substring(34, 5); } break; } satirSay++; } _koordinat.Add(krd); _testList.Add(krd); } } } } List <string> klasorler = Directory.GetDirectories(yol).ToList(); foreach (var klasor in klasorler) { _koordinat = new List <Koordinat>(); string kontrol = klasor.Substring((klasor.Length - 4), 4); switch (kontrol) { case "TABL": Dosyalar(klasor, yer, EOzelDurum.TABL); break; default: Dosyalar(klasor, yer); break; } if (_koordinat.Any()) { string yenidosyaKordinat = $@"{klasor}\\{kontrol}-Koordinat.txt"; using (FileStream dosyaOlustur = new FileStream(yenidosyaKordinat, FileMode.OpenOrCreate, FileAccess.Write)) { using (StreamWriter sw = new StreamWriter(dosyaOlustur)) { _koordinat.ForEach(v => { sw.WriteLine($"{v.DosyaAdi?.Replace(".txt", "")} \t {v.X?.Replace("\t", "").Replace("(", "")} \t {v.Y?.Replace("\t", "").Replace("(", "")} \t {v.Z?.Replace("\t", "").Replace("(", "")}"); }); sw.Flush(); } } string yenidosyaSapma = $@"{klasor}\\{kontrol}-Sapma.txt"; using (FileStream dosyaOlustur = new FileStream(yenidosyaSapma, FileMode.OpenOrCreate, FileAccess.Write)) { using (StreamWriter sw = new StreamWriter(dosyaOlustur)) { _koordinat.ForEach(v => { sw.WriteLine($"{v.DosyaAdi?.Replace(".txt", "")} \t {v.XM?.Replace("\t", "").Replace("�", "±")} \t {v.YM?.Replace("\t", "").Replace("�", "±")} \t {v.ZM?.Replace("\t", "").Replace("�", "±")}"); }); sw.Flush(); } } } } }
public Guney(Koordinat koordinat) : base(koordinat) { }
public Daire(Koordinat solUst, int r) { this.solUst = solUst; this.r = r; }