Esempio n. 1
0
        private void KomıtSatiriIzleyicisi_FormClosed(object sender, FormClosedEventArgs e)
        {
            using (StreamWriter sr = new StreamWriter(pak + "Girdi_Uygulama.txt", false))
            {
                foreach (string biri in Girdi_Uygulama.Items)
                {
                    sr.WriteLine(biri);
                }
            }

            using (StreamWriter sr = new StreamWriter(pak + "Girdi_Başlar.txt", false))
            {
                foreach (string biri in Girdi_Başlar.Items)
                {
                    sr.WriteLine(biri);
                }
            }

            using (StreamWriter sr = new StreamWriter(pak + "Girdi_İçerir.txt", false))
            {
                foreach (string biri in Girdi_İçerir.Items)
                {
                    sr.WriteLine(biri);
                }
            }

            using (StreamWriter sr = new StreamWriter(pak + "Girdi_Hariç.txt", false))
            {
                foreach (string biri in Girdi_Hariç.Items)
                {
                    sr.WriteLine(biri);
                }
            }

            Ayarlar.Yaz("Etkin", Etkin.Checked.ToString());
            Ayarlar.Yaz("TekSatırda", TekSatırda.Checked.ToString());
            Ayarlar.Yaz("Çıktı", Çıktı.Font.Size.ToString());

            Ayarlar.Yaz("Girdi_Uygulama_i", Girdi_Uygulama.Text);
            Ayarlar.Yaz("Girdi_Başlar_i", Girdi_Başlar.Text);
            Ayarlar.Yaz("Girdi_İçerir_i", Girdi_İçerir.Text);
            Ayarlar.Yaz("Girdi_Hariç_i", Girdi_Hariç.Text);

            if (Uygulama != null)
            {
                Uygulama.Dispose();
            }
        }
Esempio n. 2
0
        private void EkleGüncelle_Click(object sender, EventArgs e)
        {
            string Tablo = "";

            for (int i = 0; i < Liste.RowCount; i++)
            {
                if (string.IsNullOrEmpty((string)Liste[0, i].Value) &&
                    string.IsNullOrEmpty((string)Liste[1, i].Value) &&
                    string.IsNullOrEmpty((string)Liste[2, i].Value) &&
                    string.IsNullOrEmpty((string)Liste[4, i].Value))
                {
                    continue;
                }

                if (Liste[0, i].Value == null)
                {
                    Liste[0, i].Value = "";
                }
                if (Liste[1, i].Value == null)
                {
                    Liste[1, i].Value = "";
                }
                if (Liste[2, i].Value == null)
                {
                    Liste[2, i].Value = "";
                }
                if (Liste[3, i].Tag == null)
                {
                    Liste[3, i].Tag = (double)0;
                }
                if (Liste[4, i].Value == null)
                {
                    Liste[4, i].Value = "";
                }

                try
                {
                    string Satır = "";
                    Ayarlar.Yaz_AltDal(ref Satır, "Akım", Liste[0, i].Value.ToString());
                    Ayarlar.Yaz_AltDal(ref Satır, "Etkin", Liste[1, i].Value.ToString());
                    Ayarlar.Yaz_AltDal(ref Satır, "Durgun", Liste[2, i].Value.ToString());
                    Ayarlar.Yaz_AltDal(ref Satır, "Tüketim", ((double)(Liste[3, i].Tag)).ToString());
                    Ayarlar.Yaz_AltDal(ref Satır, "Açıklama", Liste[4, i].Value.ToString());

                    Ayarlar.Yaz_AltDal(ref Tablo, "Satir" + i, Satır);
                }
                catch (Exception) { }
            }

            Ayarlar.Yaz_AltDal(ref Tablo, "PilKapasitesi", PilKapasitesi.Text);
            Ayarlar.Yaz_AltDal(ref Tablo, "PilVerimliliği", PilVerimliliği.Text);
            Ayarlar.Yaz_AltDal(ref Tablo, "Notlar", Notlar.Text);

            //ana listeye ekle
            İşler.Add(new Depo.Biri(Liste_İşler.Text, Tablo));
            string xml = "";

            Ayarlar.ListeyiEkle_AltDal(ref xml, İşler);
            Ayarlar.Yaz("İşler", xml);
            İşler = Ayarlar.Listele_AltDal(Ayarlar.Oku("İşler"));

            //menuye ekle
            if (!Liste_İşler.Items.Contains(Liste_İşler.Text))
            {
                Liste_İşler.Items.Add(Liste_İşler.Text);
            }
        }