Exemplo n.º 1
0
        /*********************************** Button Ctrls ***********************************/
        // Open Log File
        private void buttonOpenLog_Click(object sender, EventArgs e)
        {
            try
            {
                DialogBox db = new DialogBox("log", "Siebel Log (*.log)|*.log");
                string auxLogFileName = db.OpenFile();

                _openLogFile = auxLogFileName != string.Empty ? auxLogFileName : null;

                // if not file to show leave
                if (string.IsNullOrEmpty(_openLogFile))
                {
                    MessageBox.Show(@"No file to load", @"Load Tree", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (MessageBox.Show(@"Build Tree ?", @"Open File", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    // Load TreeView
                    LoadTree();
                }
                else
                {
                    // clean old nodes if they exists, you are opening new file, you dont want to see old tree file
                    treeViewSiebelTree.Nodes.Clear();
                }

                // Load file to textbox in the end so that does not overload loading process
                LoadFileToTextBox();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, @"Open Dialog Box", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        // Open Config File
        private void buttonOpenConfig_Click(object sender, EventArgs e)
        {
            DialogBox db = new DialogBox("xml", "Siebel Event Config File (*.xml)|*.xml");
            string auxCfgFileName = db.OpenFile();

            if (auxCfgFileName != string.Empty) _openConfigFile = auxCfgFileName;
        }