Exemple #1
0
        //Int32 _NumberEventsProcessed;
        //String _EventTimeCursor;


        public MainForm()
        {
            InitializeComponent();

            DialogResult myDlgResult;

            //Gets the AF database and PI System instances
            try
            {
                _AFDB     = OSIsoft.AF.UI.AFOperations.ConnectToDatabase(this, "", "", true, out myDlgResult);
                _AFServer = _AFDB.PISystem;
                afElementFindCtrl1.Database = _AFDB;
            } catch (Exception ex)
            {
                MessageBox.Show("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void btnDatabase_Click(object sender, EventArgs e)
        {
            OSIsoft.AF.AFDatabase dbSelected = OSIsoft.AF.UI.AFOperations.SelectDatabase(this, _AFServer, _AFDB);

            if (dbSelected == null)
            {
                MessageBox.Show("Database was not changed", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                _AFDB = dbSelected;

                afElementFindCtrl1.Text     = "";
                _TargetElement              = null;
                afElementFindCtrl1.Database = _AFDB;

                this.Text = _AFDB.GetPath() + " - PI Analysis Output Bulk Deleter";
            }
        }