public OptionsPage()
 {
     MSCEPath             = BentleyDataCollector.MSCEPath();
     MSCESDKPath          = BentleyDataCollector.GetSDKPath(MSCEPath);
     BentleyApp           = BentleyDataCollector.GetBentleyApp(MSCEPath);
     MDLAPPSPath          = BentleyDataCollector.GetMdlappsPath(MSCEPath);
     BentleyBuildFilePath = BentleyDataCollector.BentleyBuildBatchFilePath(BentleyApp);
     BatchLock            = false;
     MDLAPPSLock          = false;
 }
Esempio n. 2
0
        private void cboBentleyProduct_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                ICollection bentleyKeyCollection   = BentleyDataCollector.BentleyProducts.Keys;
                ICollection bentleyValueCollection = BentleyDataCollector.BentleyProducts.Values;

                string[] bentleyKeys   = new string[BentleyDataCollector.BentleyProducts.Count];
                string[] bentleyValues = new string[BentleyDataCollector.BentleyProducts.Count];
                bentleyKeyCollection.CopyTo(bentleyKeys, 0);
                bentleyValueCollection.CopyTo(bentleyValues, 0);
                for (int i = 0; i < BentleyDataCollector.BentleyProducts.Count; i++)
                {
                    if (!string.IsNullOrEmpty(cboBentleyProduct.Text))
                    {
                        if (bentleyKeys[i] == cboBentleyProduct.Text)
                        {
                            tbMSCEPath.Text = bentleyValues[i];
                            break;
                        }
                    }
                }

                tbSDKPath.Text             = BentleyDataCollector.GetSDKPath(tbMSCEPath.Text);
                msceOptionsPage.BentleyApp = BentleyDataCollector.GetBentleyApp(tbMSCEPath.Text);

                if (!msceOptionsPage.MDLAPPSLock)
                {
                    tbMDLAPPSPath.Text = BentleyDataCollector.GetMdlappsPath(tbMSCEPath.Text);
                }

                if (!msceOptionsPage.BatchLock)
                {
                    tbBuildPath.Text = BentleyDataCollector.BentleyBuildBatchFilePath(msceOptionsPage.BentleyApp);
                }

                //if (!msceOptionsPage.LockSDK)
                //{
                //    msceOptionsPage.MSCESDKPath = BentleyDataCollector.SDKPath("microstation connect edition");
                //    tbSDKPath.Text = GetSDKPath;
                //}

                //if (!msceOptionsPage.LockMDL)
                //{
                //    if (tbMSCEPath.Text == "Not Installed")
                //        tbMDLAPPSPath.Text = "";
                //    else
                //        tbMDLAPPSPath.Text = tbMSCEPath.Text + "mdlapps\\";
                //}
            }
            catch (Exception)
            {
                //Do nothing when exception occurs.
            }
        }
Esempio n. 3
0
        private void btnReset_Click(object sender, EventArgs e)
        {
            tbMSCEPath.Text = BentleyDataCollector.MSCEPath();
            foreach (var item in BentleyDataCollector.BentleyProducts)
            {
                if (tbMSCEPath.Text == item.Value.ToString())
                {
                    cboBentleyProduct.Text = item.Key.ToString();
                }
            }

            tbSDKPath.Text             = BentleyDataCollector.GetSDKPath(tbMSCEPath.Text);
            msceOptionsPage.BentleyApp = BentleyDataCollector.GetBentleyApp(tbMSCEPath.Text);
            if (!msceOptionsPage.MDLAPPSLock)
            {
                tbMDLAPPSPath.Text = BentleyDataCollector.GetMdlappsPath(tbMSCEPath.Text);
            }

            if (!msceOptionsPage.BatchLock)
            {
                tbBuildPath.Text = BentleyDataCollector.BentleyBuildBatchFilePath(msceOptionsPage.BentleyApp);
            }
        }