public frmSAPData(CSAPInterface oSAPInterface, String sProjectID)
 {
     // Set our reference to CSAPInterface
     rSAPInterface = oSAPInterface;
     InitializeComponent();
     InitializeDataTables();
     // Set the selected project ID
     sProjectDef.Text = sProjectID;
     DisplayData();
 }
 //public frmProjectSelection(ref MSProject.Application oApplication, ref CSAPInterface oSAPInterface)
 public frmProjectSelection(ref MSProject.Application oApplication, ref CSAPInterface oSAPInterface)
 {
     InitializeComponent();
     // Set reference to MS Project Application object
     rApplication = oApplication;  //Used to set status bar from this form
     // Set reference to the CSAPInterface
     rSAPInterface = oSAPInterface;
     // Get the collection of SAP Project IDs to display
     oSAPInterface.GetProjDefList(ref oProjDefs);
     dataGridPrjDefs.DataSource = oProjDefs;
 }
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            oApplication = Application;
            // Set oProject as the current ActiveProject
            oProject = new CProject(ref Application);
            // Pass the project in for use in CSAPInterface
            oSAPInterface = new CSAPInterface(ref oProject);

            oApplication.StatusBar = "SAP AddIn loaded successfully.";

            Cursor.Current = Cursors.Default;
        }
        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
            // Clean up
            if (frmSAP != null)
            {
                frmSAP.Close();
                frmSAP = null;
            }
            //Disconnect from our SAP DB
            if (oSAPInterface != null)
            {
                oSAPInterface.Logout();
                oSAPInterface = null;
            }

            oApplication = null;

            // Release the AddIn reference
            if (objAddIn != null)
            {
                objAddIn.Dispose();
                objAddIn = null;
            }
        }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     rSAPInterface = null;
     this.Close();
 }