Exemplo n.º 1
0
        public FrmMain()
        {
            /*  ANNOTATION
             *  The software should be able to read pdf,doc,txt and odf
             *  The software should take all files in the input folder and read them one at a time
             *  The software should prepare lists of words with their frequencie
             *  The software should be awesome
             *
             *  TODO:
             *  1.v  Import doc, docx reader library
             *  2.v  Import pdf reader library
             *  3.v  Import odf reader library
             *  4.v  Create functions for each supporting format
             *  5.v  Create open file dialog to show the location of files
             *  6.v  List the files filtering the extension
             *  7.v  Take a file, read all of its contents
             *  8.v  Scan through file and create a list of frequencies for each file
             *  9.v  Sum-up the frequency files
             *  10.v  Percentage
             *  11.v  Percentage in export and in selection
             *  12.v  Общая частотность
             *  13.v  Add date from and date to, to SELECT for all history requests
             *  14.v  Окно со статистикой сразу после Начать
             *  15.v  Excel выгружать числа как числа а не текст!
             *  16.v  Статистика по слову
             *  17.   Import DB
             *  18.   Read line by line
             *  19.   Embed a log
             */

            InitializeComponent();

            // Load settings
            if (Utils.StgGetString("WorkingDir") == "")
            {
                Utils.WorkDirPath = Environment.CurrentDirectory;
            }
            else
            {
                Utils.WorkDirPath = Utils.StgGetString("WorkingDir");
            }

            Utils.StgSet("TxtCodepage", Convert.ToInt32(Properties.Settings.Default["TxtCodepage"]));
            chkSubdirectories.Checked = Utils.StgGetBool("ChkSubdirectories");
        }
Exemplo n.º 2
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            // Do not allow the user to create new files via the FolderBrowserDialog.
            fbWorkingDir.ShowNewFolderButton = false;
            fbWorkingDir.SelectedPath        = txtWorkingDir.Text;

            DialogResult result = fbWorkingDir.ShowDialog();

            if (result == DialogResult.OK)
            {
                Utils.WorkDirPath  = fbWorkingDir.SelectedPath;
                txtWorkingDir.Text = Utils.WorkDirPath;

                // Save to settings
                Utils.StgSet("WorkingDir", Utils.WorkDirPath);

                // Load files list
                loadFiles();
            }
        }
Exemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            /*----------------------------------------
            * 0 Такой же как в программе
            * 1 Синий
            * 2 Зеленый
            * 3 Оранжевый
            * 4 Без стиля
            *  ----------------------------------------*/

            if (comboBox1.SelectedIndex == 0)
            {
                Utils.StgSet("TxtCodepage", 0);
            }
            else
            {
                Utils.StgSet("TxtCodepage", Encoding.GetEncoding(comboBox1.Text).CodePage);
            }

            Utils.StgSet("ExStyle", comboBox2.SelectedIndex);
            Utils.StgSet("TxtRegExp", txtRegExp.Text.Replace(@"\\", @"\"));

            Close();
        }
Exemplo n.º 4
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     Utils.StgSet("ShowResultsImmediately", checkBox1.Checked);
 }
Exemplo n.º 5
0
 private void chkSubdirectories_CheckedChanged(object sender, EventArgs e)
 {
     Utils.StgSet("ChkSubdirectories", chkSubdirectories.Checked);
     loadFiles();
 }