Beispiel #1
0
        //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();
        }
Beispiel #2
0
        private void AddItem(string value)
        {
            var instrumentViewer = new InstrumentViewer();

            instrumentViewer.AddItem(_path, value);

            this.Close();
        }
Beispiel #3
0
        private void AddNewClass(string path)
        {
            var pluginManager    = new PluginManager(path);
            var instrumentViewer = new InstrumentViewer();

            instrumentViewer.AddInstrument(pluginManager.GetNewClass());
            Initialize(null);
        }
Beispiel #4
0
        public AddItemWindow(ComboBox comboBox, List <string> path)
        {
            var instrumentViewer = new InstrumentViewer();

            _path     = path;
            _comboBox = comboBox;
            InitializeComponent();
            Title = instrumentViewer.GetNameThroughPath(_path);
        }
Beispiel #5
0
        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);
        }