public MainWindow()
        {
            InitializeComponent();

            //ConsoleManager.Show();

            icons = LoadIconSet();
            this.Focusable = false;

            Width.Text = lines.Length.ToString();
            Height.Text = lines.Width.ToString();

            grid = new GridModel(lines.Width, lines.Length, icons);
            Loaded += new RoutedEventHandler(OnGridLoaded);

            SimulationSpeedTextBox.Text = "" + 3;
            ConsumerEmptyTextBox.Text = "" + 0;

            DataContext = grid;
            view.ClipToBounds = false;

            CreateToolbox();
            Hide3DGrid();

            optionWindow = new OptionsWindow();
            optionWindow.configEvent += new EventHandler(optionWindow_configEvent);

            pluginWindow = new PluginWindow();
            pluginWindow.InitializeComboBox(icons.GetAvailablePlugins());
            pluginWindow.pluginEvent += new EventHandler(pluginWindow_pluginEvent);

            chatWindow = new ChatWindow();

            csu = ClientServerUtil.getInstance();
            csu.ClientServerEvent += new ClientServerEventHandler(csu_clientServerEvent);

            FactoryControll.IsEnabled = false;
            LoggedInControll.IsEnabled = false;
        }