public static UserDatabase GetInstance(string filePath) { if (_SingleObject == null) { lock (typeof(UserDatabase)) { if (_SingleObject == null) { _SingleObject = new UserDatabase(filePath); } } } return _SingleObject; }
public void Dispose() { _host = null; _dataBase.Dispose(); _dataBase = null; _selectedChat = null; _selectedUser = null; _users = null; }
public void Initialize(Hal.NCSPlugin.IPluginHost host) { _host = host; _dataBase = UserDatabase.GetInstance("test.sqlite"); _column = new System.Windows.Forms.DataGridViewTextBoxColumn(); _column.Name = "nameColumn"; _column.HeaderText = "Name"; _column.Width = 50; _column.ReadOnly = true; _column.Visible = Properties.Settings.Default.IsAlive; CreateContextMenu(); }
public void Dispose() { lock (typeof(UserDatabase)) { if (_connection != null) { _connection.Close(); _connection.Dispose(); _connection = null; } _SingleObject = null; } }