/// <summary> /// Show the form if it is not already displayed /// </summary> internal static void ShowForm(Bentley.MicroStation.AddIn addIn) { if (null != s_current) { return; } s_current = new GSFStiffenerControl(addIn); s_current.AttachAsTopLevelForm(addIn, true); s_current.AutoOpen = true; s_current.AutoOpenKeyin = "mdl load GSFStiffener"; s_current.NETDockable = false; Bentley.Windowing.WindowManager windowManager = Bentley.Windowing.WindowManager.GetForMicroStation(); s_current.m_windowContent = windowManager.DockPanel(s_current, s_current.Name, s_current.Text, Bentley.Windowing.DockLocation.Floating); AdapterWorkarounds.WCFixedBorder.SetBorderFixed(s_current.m_windowContent); s_current.m_windowContent.CanDockHorizontally = false; // limit to left and right docking s_current.m_windowContent.CanDockVertically = false; }
/// <summary> /// Handles MDL UNLOAD requests after the application has been unloaded. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void AIT_UnloadedEvent(BM.AddIn sender, UnloadedEventArgs eventArgs) { foreach (var process in Process.GetProcessesByName(aitProcessName)) { process.Kill(); } }
/// <summary>Constructor</summary> internal GSFStiffenerControl(Bentley.MicroStation.AddIn addIn) { m_addIn = addIn; InitializeComponent(tabPage); // Set up events to handle resizing of form; closing of form this.Closed += new EventHandler(GSFStiffenerControl_Closed); }
/// <summary>Constructor</summary> internal Tag(Bentley.MicroStation.AddIn addIn, TaggingMode oTagmode) { m_addIn = addIn; m_tagmode = oTagmode; InitializeComponent(); //WS: the schema file must reside the same location with this Addin .dll string strAssemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string strSchemaPath = Path.Combine(strAssemblyFolder, "JansenGeoTags.01.00.ecschema.xml"); oECAdaptor = new ECAdaptor(); //WS: check if Geotag schema is in the dgn; if not, load it. if (!oECAdaptor.SchemaLoadedInModel("JansenGeoTags.01.00")) { if (!LoadECSchema(strSchemaPath)) { MessageBox.Show("Failed importing GeoTag Schema."); return; } } string severName = "azrhbjvsqlprd01.hbjv.local"; string TagDBName = "BHPB_STRTagDB"; string connectionString = "Data Source=" + severName + ";Initial Catalog=" + TagDBName + ";Integrated Security=SSPI;"; sqlConnection = new SqlConnection(connectionString); //WS: check functioin code list, if (AddInMain.oListFunctionCode != null) { LoadCmbboxFromList(cmbFunCode, AddInMain.oListFunctionCode); } else { AddInMain.oListFunctionCode = new List <string>(); if (!LoadcmbFuncodeFromDB(cmbFunCode, sqlConnection, ref AddInMain.oListFunctionCode)) { MessageBox.Show("Failed to load Function Code from DB."); return; } } //WS: load FBS from ProjectWise. "210536" is the "FBS" folder id, which is at "Standards - Site/Attribute Lookup List/FBS" if (!LoadcmbFBS(cmbUnit, 210536, AddInMain.ComApp.ActiveDesignFile.FullName)) { MessageBox.Show("Failed to load FBS."); return; } }
/// <summary> /// the constructor. sets the form to be hosted in Bentley products. /// </summary> /// <param name="addIn">The owner application.</param> public SchemaUtilityForm(Bentley.MicroStation.AddIn addIn) { itemList = new List <ListBoxEntry>(); bindingList = new BindingList <ListBoxEntry>(itemList); source = new BindingSource(bindingList, null); InitializeComponent(); dgvDirs.AllowUserToAddRows = false; dgvDirs.RowHeadersVisible = false; dgvDirs.DataSource = source; #if ADDIN AttachAsTopLevelForm(addIn, true); this.NETDockable = false; Bentley.Windowing.WindowManager windowManager; windowManager = Bentley.Windowing.WindowManager.GetForMicroStation(); m_windowContent = windowManager.DockPanel(this, this.Name, this.Text, BW.DockLocation.Floating); if (PWAPI.dmscli.aaApi_Initialize(0)) { int status; StringBuilder sbName = new StringBuilder(512); string sbDataSource; // = new StringBuilder(512); string sbPass; // = new StringBuilder(512); string sbSchema; // = new StringBuilder(512); IntPtr hSession = IntPtr.Zero; if (!PWAPI.dmscli.aaApi_GetCurrentSession(ref hSession) || (hSession == IntPtr.Zero)) { status = PWAPI.dmawin.aaApi_LoginDlg(PWAPI.dmawin.DataSourceType.Unknown, sbName, 512, "", "", ""); } } #endif }
private void AddInMain_UnloadedEvent(Bentley.MicroStation.AddIn sender, UnloadedEventArgs eventArgs) { }
/// <summary>Handles MDL LOAD requests after the application has been loaded. /// </summary> private void AddInMain_ReloadEvent(Bentley.MicroStation.AddIn sender, ReloadEventArgs eventArgs) { GSFStiffenerControl.ShowForm(this); }
/// <summary> /// Show the form if it is not already displayed /// </summary> internal static void ShowForm(Bentley.MicroStation.AddIn addIn, TaggingMode oTagmode) { //WS: if the form is opened, close it first and then re-open based on tagging mode. if (null != s_current) { s_current.m_windowContent.Close(); s_current = null; } s_current = new Tag(addIn, oTagmode); s_current.AttachAsTopLevelForm(addIn, true); s_current.AutoOpen = true; //WS: seems not appropriate here //s_current.AutoOpenKeyin = "mdl load GeoTag"; s_current.NETDockable = true; if (oTagmode == TaggingMode.ApplyNewTag) { s_current.cmbUnit.Enabled = true; s_current.cmbFunCode.Enabled = true; s_current.btnApply.Visible = true; s_current.btnRefresh.Visible = true; s_current.lblNextNewTag.Text = "Next New Tag"; s_current.lblTagValue.Text = "<New Tag>"; s_current.btnSelect.Visible = false; s_current.btnEdit.Visible = false; s_current.btnDrop.Visible = false; s_current.lblApplyOld.Visible = false; s_current.lblDrop.Visible = false; s_current.lblSelect.Visible = false; } if (oTagmode == TaggingMode.EditOldTag) { s_current.cmbUnit.Enabled = false; s_current.cmbFunCode.Enabled = false; s_current.btnApply.Visible = false; s_current.btnRefresh.Visible = false; s_current.lblNextNewTag.Text = "Existing Tag"; s_current.lblTagValue.Text = "<Old Tag>"; s_current.btnSelect.Visible = true; s_current.btnEdit.Visible = true; s_current.btnDrop.Visible = true; s_current.lblApplyOld.Visible = true; s_current.lblDrop.Visible = true; s_current.lblSelect.Visible = true; } BWW windowManager = BWW.GetForMicroStation(); s_current.m_windowContent = windowManager.DockPanel(s_current, s_current.Name, s_current.Name, Bentley.Windowing.DockLocation.Floating); s_current.m_windowContent.CanDockHorizontally = false; // limit to left and right docking }
/// <summary> /// 将程序集从 MS 中的 DefaultAppDomain 或者 用户指定的自定义 AppDomain 中卸载。 /// Handles MDL UNLOAD requests after the application has been unloaded. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void PowerCivilAddin1_UnloadedEvent(BM.AddIn sender, UnloadedEventArgs eventArgs) { MessageBox.Show(@"ProgramTest Unloaded"); //TODO: add specific handling For this Event here }
public GroupByTaskModel(Bentley.MstnPlatformNET.AddIn addin) : this() { addin_ = addin; addin_.SelectionChangedEvent += Addin_SelectionChangedEvent; }
public GroupByTaskModel(Bentley.MicroStation.AddIn addin) : this() { addin_ = addin; }
internal [!output SAFE_PROJECT_NAME]PlacementCmd(Bentley.MicroStation.AddIn addIn) { //Initialize class variables m_AddIn = addIn; m_App = [!output SAFE_PROJECT_NAME].ComApp;
public GroupByTaskModel(Bentley.MstnPlatformNET.AddIn addin) : this() { addin_ = addin; }
/// <summary> /// Handles MDL UNLOAD requests after the application has been unloaded. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void NetworkDesigner_UnloadedEvent(BM.AddIn sender, UnloadedEventArgs eventArgs) { //TODO: add specific handling For this Event here }
/// <summary> /// Handles MDL LOAD requests after the application has been loaded. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void AIT_ReloadEvent(BM.AddIn sender, ReloadEventArgs eventArgs) { RunAIT(); }