//------------------------------- DIALOG LAUNCHING --------------------------------- // // Before invoking this application one needs to open any part/empty part in NX // because of the behavior of the blocks. // // Make sure the dlx file is in one of the following locations: // 1.) From where NX session is launched // 2.) $UGII_USER_DIR/application // 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_ROOT_DIR\menus\custom_dirs.dat // // You can create the dialog using one of the following way: // // 1. Journal Replay // // 1) Replay this file through Tool->Journal->Play Menu. // // 2. USER EXIT // // 1) Remove the following conditional definitions: // a) #if USER_EXIT_OR_MENU // #endif//USER_EXIT_OR_MENU // // b) #if USER_EXIT // #endif//USER_EXIT // 2) Create the Shared Library -- Refer "Block UI Styler programmer's guide" // 3) Invoke the Shared Library through File->Execute->NX Open menu. // // 3. THROUGH CALLBACK OF ANOTHER DIALOG // // 1) Remove the following conditional definition: // #if CALLBACK // #endif//CALLBACK // 2) Call the following line of code from where ever you want to lauch this dialog. // TechDoc.Show_TechDoc(); // 3) Integrate this file with your main application file. // // 4. MENU BAR // // 1) Remove the following conditional definition: // a) #if USER_EXIT_OR_MENU // #endif//USER_EXIT_OR_MENU // 2) Add the following lines to your MenuScript file in order to // associate a menu bar button with your dialog. In this // example, a cascade menu will be created and will be // located just before the Help button on the main menubar. // The button, SAMPLEVB_BTN is set up to launch your dialog and // will be positioned as the first button on your pulldown menu. // If you wish to add the button to an existing cascade, simply // add the 3 lines between MENU LAUNCH_CASCADE and END_OF_MENU // to your menuscript file. // The MenuScript file requires an extension of ".men". // Move the contents between the dashed lines to your Menuscript file. // // !----------------------------------------------------------------------------- // VERSION 120 // // EDIT UG_GATEWAY_MAIN_MENUBAR // // BEFORE UG_HELP // CASCADE_BUTTON BLOCKSTYLER_DLX_CASCADE_BTN // LABEL Dialog Launcher // END_OF_BEFORE // // MENU BLOCKSTYLER_DLX_CASCADE_BTN // BUTTON SAMPLEVB_BTN // LABEL Display SampleVB dialog // ACTIONS <path of Shared library> !For example: D:\temp\SampleVB.dll // END_OF_MENU // !----------------------------------------------------------------------------- // // 3) Make sure the .men file is in one of the following locations: // // - $UGII_USER_DIR/startup // - For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_ROOT_DIR\menus\custom_dirs.dat // //------------------------------------------------------------------------------ public static void Main() { TechDoc theTechDoc = null; try { theTechDoc = new TechDoc(); theTechDoc._dataService = new DataService(theTechDoc); // The following method shows the dialog immediately theTechDoc.Show(); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } finally { if (theTechDoc != null) { theTechDoc.Dispose(); } theTechDoc = null; } }
// private NxToolsToDbUploaderService _uploaderService; public DataService(TechDoc theTechDoc) { _session = TechDoc.theSession; _ui = TechDoc.theUI; _dialog = theTechDoc; _lw = _session.ListingWindow; _data = new NxSession(_session, _ui); // _uploaderService = new NxToolsToDbUploaderService(_data); }
public static string GetTechDoc(RestCommand command, int techDocID) { TechDoc techDoc = TechDocs.GetTechDoc(command.LoginUser, techDocID); if (techDoc.OrganizationID != command.Organization.OrganizationID) { throw new RestException(HttpStatusCode.Unauthorized); } return(techDoc.GetXml("TechDoc", true)); }
public DataService(TechDoc theTechDoc) { _data = new NxSession(TechDoc.theSession); _ui = TechDoc.theUI; _dialog = theTechDoc; }