Example #1
0
        private void LoadIdsFromFile_Button_Click(object sender, EventArgs e)
        {
            var streamReader = new StreamReader(_savedIdsFile);
            var guids        = streamReader.ReadToEnd();

            Ids_TextBox.AppendText(guids);
            streamReader.Close();
            //Ids_TextBox.AppendText(File.ReadAllText(@_savedIdsFile));
        }
Example #2
0
        private void FindButton_Click(object sender, EventArgs e)
        {
            var value = Input_TextBox.Text;

            if (value == null || value.Equals(""))
            {
                return;
            }
            var parameter = (string)FindByComboBox.SelectedItem;

            Console.WriteLine(parameter);

            switch (parameter)
            {
            case "UUID":
                break;

            case "UUIDs":

                break;

            case "words":

                Console.WriteLine(value);
                var guids = _restClient.findByString(value);
                foreach (var guid in guids)
                {
                    Ids_TextBox.AppendText(guid.ToString() + Environment.NewLine);
                }

                break;

            case "-":

                break;
            }
        }
Example #3
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            // DocumentOpenFileDialog.ShowDialog();
            var size   = -1;
            var result = DocumentOpenFileDialog.ShowDialog();

            if (result == DialogResult.OK)
            //    var savedIdFile =
            {
                var file = DocumentOpenFileDialog.FileName; // returns absolute path

                try
                {
                    var content = File.ReadAllText(file);
                    size = content.Length;              // GetFileName returns file name from path
                    var guid = _restClient.addDocument(new Document(Path.GetFileName(file), content));
                    Console.WriteLine(file + " " + Path.GetFileName(file));
                    Ids_TextBox.AppendText(guid.ToString());
                }
                catch (IOException)
                {
                }
            }
        }