/// <summary> /// Load the AMLX file and display the loaded device /// </summary> /// <param name="fileName">the full path to an .amlx file</param> internal void showDevice(string fileName) { MWData.MWObject mWObject = mWData.loadObject(fileName); if (mWObject == null) { System.Windows.Forms.MessageBox.Show("The loaded device does not match the required format.\nThe ModellingWizard can not display this object"); return; } devices.Add(mWObject); GetStartGUI().updateDeviceDropdown(devices); // show the most recently added device showDevice(devices.Count - 1); }
/// <summary> /// Show the correct GUI for the selected device /// </summary> /// <param name="selectedIndex">The index of the selected item in the dropdown</param> internal void showDevice(int selectedIndex) { if (devices.Count >= 1) { MWData.MWObject mWObject = devices[selectedIndex]; // Display the corect GUI for the object type if (mWObject is MWDevice) { GetCreateDeviceForm().prefill((MWDevice)mWObject); ChangeGui(MWGUIType.CreateDevice); } else if (mWObject is MWInterface) { GetCreateInterfaceForm().prefill((MWInterface)mWObject); ChangeGui(MWGUIType.CreateInterface); } } }