//Window structure initializtion. private void Initialize(string name) { var windowDecorator = new WindowFactory(); var instrumentViewer = new InstrumentViewer(); //Getting instrument class information through it's name. //If window haven't been initialized than we use the type of the first instrument in list //because user haven't selected instrument type yet. if (name == null) { _instrumentInfo = instrumentViewer.GetInstrumentInfo(instrumentViewer.GetFirstTypeName()); } //Else we get instrument class info from InstrumentViewer else { _instrumentInfo = instrumentViewer.GetInstrumentInfo(instrumentViewer.GetTypeThrowName(name)); //Non-negative value means that instrument is already created and some properties //of object might be initialized, that's why we should display it. if (_index >= 0) { new InstrumentFactory().Initialize(_instrumentInfo, _instruments[_index]); } } _instrumentInfo[0].Value = name; //Window structure creating. Content = new Grid(); ((Grid)Content).Children.Add(windowDecorator.GetWindowContent(this, _instrumentInfo)); OnListChanged(); //_windowDecorator.Initialize(); }
private void AddItem(string value) { var instrumentViewer = new InstrumentViewer(); instrumentViewer.AddItem(_path, value); this.Close(); }
private void AddNewClass(string path) { var pluginManager = new PluginManager(path); var instrumentViewer = new InstrumentViewer(); instrumentViewer.AddInstrument(pluginManager.GetNewClass()); Initialize(null); }
public AddItemWindow(ComboBox comboBox, List <string> path) { var instrumentViewer = new InstrumentViewer(); _path = path; _comboBox = comboBox; InitializeComponent(); Title = instrumentViewer.GetNameThroughPath(_path); }
private void AddNewContent(string filePath) { var pluginManager = new PluginManager(filePath); var instrumentViewer = new InstrumentViewer(); foreach (string item in pluginManager.GetNewContent()) { instrumentViewer.AddItem(_path, item); } var windowFactory = new WindowFactory(); windowFactory.ReinitializeComboBox(_comboBox, _path); }