public MainForm() { InitializeComponent(); richTextBox.MouseWheel += new MouseEventHandler(OnMouseWheel); IsFullScreen = false; // Инициализируем локальные хранилища Storage = new LibraryStorage(); Config = new ConfigStorage(); Username = Config.GetValue("Username"); // Открываем последнюю книгу OpenLastBook(); // Пытаемся подключится к серверу ConnectServer(); }
public LibraryForm(LibraryStorage storage, ConfigStorage config, IConnection connection) { InitializeComponent(); Storage = storage; Config = config; Connection = connection; dataGridView.SelectionChanged += OnSelectionChanged; UpdateStatusLabel(); DrawBooksTable(); if (IsConnected) { Connection.MessageReceived += OnIncomingMessage; Shown += OnShown; } }
public Form1() { InitializeComponent(); this._storage = new LibraryStorage(); }