Example #1
0
        static void TirnakKontrol(MainDashboard md)
        {
            try
            {
                string asd   = "“";
                Regex  rx    = new Regex(@asd, RegexOptions.Compiled | RegexOptions.IgnoreCase);
                Match  match = rx.Match(text);

                List <String> dizi2 = new List <String>();
                while (match.Success)
                {
                    dizi2.Add(match.Value);
                    match = match.NextMatch();
                }

                if (dizi2.Count > 0)
                {
                    md.lblDurumTirnak.Text = "(“) " + " ifadesi metinde " + (dizi2.Count) * 2 + " defa geçiyor.";
                }
            }
            catch (Exception Ex)
            {
                Console.WriteLine("HATA OLUŞTU:" + Ex.Message);
            }
        }
Example #2
0
        static void GenelKontrol(MainDashboard md)
        {
            #region Old Method
            //bool flag = true;

            //string genelkontrol = "";
            //string[] kontrolindexof = { "BEYAN", "ÖNSÖZ", "İÇİNDEKİLER" };
            //for (int i = 0; i < kontrolindexof.Length; i++)
            //{
            //    if (text.IndexOf(kontrolindexof[i]) == -1)
            //    {
            //        genelkontrol = "\n" + genelkontrol + " " + kontrolindexof[i] + " EKSİK!\n";
            //        flag = false;
            //    }
            //}

            //string[] kontrollastindex = { "ÖZET", "ABSTRACT", "ŞEKİLLER LİSTESİ", "TABLOLAR LİSTESİ", "EKLER LİSTESİ", "SİMGELER VE KISALTMALAR", "1. GİRİŞ", "SONUÇLAR", "ÖNERİLER", "KAYNAKLAR", "EKLER", "ÖZGEÇMİŞ" };
            //for (int i = 0; i < kontrollastindex.Length; i++)
            //{
            //    if (text.IndexOf(kontrollastindex[i]) == -1)
            //    {
            //        genelkontrol = genelkontrol + " " + kontrollastindex[i] + " EKSİK!\n";
            //        flag = false;
            //    }
            //}

            //if (flag == false)
            //{
            //    MessageBox.Show("Tez formatı uygun değildir.\n" + genelkontrol, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    path = null;
            //    md.lblLocation.Text = "//Lütfen kontrol etmek istediğniz tezin PDF dosyası ekleyiniz.";
            //    md.lblLocation.ForeColor = Color.DarkGray;
            //    text = null;
            //}
            #endregion
            //Commented

            anaBaslik = new string[] { "BEYAN \n", "ÖNSÖZ \n", "İÇİNDEKİLER \n", "ÖZET \n", "ABSTRACT \n", "ŞEKİLLER LİSTESİ \n",
                                       "TABLOLAR LİSTESİ \n", "EKLER LİSTESİ \n", "SİMGELER VE KISALTMALAR \n", "1. GİRİŞ \n",
                                       "SONUÇLAR \n", "ÖNERİLER \n", "KAYNAKLAR \n", "EKLER \n", "ÖZGEÇMİŞ \n" };

            for (int i = 0; i < anaBaslik.Length; i++)
            {
                if (i < 3)
                {
                    if (text.IndexOf(anaBaslik[i]) != -1)
                    {
                        genelKontrol[i] = true;
                    }
                }

                else
                {
                    if (text.LastIndexOf(anaBaslik[i]) != -1)
                    {
                        genelKontrol[i] = true;
                    }
                }
            }

            StringBuilder eksikKisimlar = new StringBuilder();
            bool          eksik         = false;
            for (int i = 0; i < genelKontrol.Length; i++)
            {
                if (genelKontrol[i] == false)
                {
                    eksikKisimlar.Append(anaBaslik[i].Trim('\n') + " KISMSI BULUNMADI!! PROGRAM DOĞRU ÇALIŞMAYABİLİR\n");
                    eksik = true;
                }
            }

            if (eksik)
            {
                MessageBox.Show(eksikKisimlar.ToString(), "Eksik Kısımlar Bulundu.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }