Symphonary.NWGUI.NWGUI C# (CSharp) Method

NWGUI() public method

Constructor for window
public NWGUI ( ) : System
return System
        public NWGUI()
        {
            InitializeComponent();

            midiInfo = new MidiInfo(debugConsole);

            Stop.IsEnabled = false;
            Stop.Width = 0;

            instrument = ReadSettingsFromFile();
            if (instrument != 0) {
                Instrument_Clicked(instrument);
                foreach (MenuItem item in Instruments.Items) {
                    if (instrument == Convert.ToInt32(item.Tag))
                        item.IsChecked = true;
                }
            }

            i_InitialCanvasPosY = (double)(subcanv.GetValue(Canvas.TopProperty));

            //r_HeaderBackground.Background = new SolidColorBrush(Color.FromRgb(51, 51, 51));
            HideCanvasChildren();

            if (USE_OLD_SERIAL_READ_METHOD) {
                serialPort.ReadTimeout = 5;
                serialPortReadThread = new Thread(new ThreadStart(GetSerialData));
                serialPortReadThread.Start();
            }
            else
            {
                serialPort.DataReceived += SerialPortDataReceived;
            }

            channelSelector = new ChannelSelector(channelsListView, ChannelsListViewSelectionChanged);
            channelsListView.DataContext = channelSelector.Channels;
            serialPortSelector = new SerialPortSelector(serialPortsListView);
            serialPortsListView.DataContext = serialPortSelector.SerialPorts;

            //System.Console.WriteLine("{0}, {1}", window.ActualWidth, window.ActualHeight);
            //System.Console.WriteLine("{0}, {1}", LogoPositionX, LogoPositionY);
        }