public static void Initialize() { InitializeCors(); DrawingsTable = getTable("Drawings1"); if (DrawingsTable != null) { DrawingsTable.CreateIfNotExists(); } RoomsTable = getTable("Rooms1"); if (RoomsTable != null) { RoomsTable.CreateIfNotExists(); } FiguresTable = getTable("dwFigures1"); if (FiguresTable != null) { FiguresTable.CreateIfNotExists(); } ChatsTable = getTable("Chats1"); if (ChatsTable != null) { ChatsTable.CreateIfNotExists(); } NotesTable = getTable("Notes1"); if (NotesTable != null) { NotesTable.CreateIfNotExists(); } PictureContainer = getContainer("picture1"); PathBatchContainer = getContainer("pathbatch1"); // blob name must be lower case. BlockPathsPond = new BlockPathsPond(); Random = new Random(); FiguresRowPond = new TableRowPond(FiguresTable); FiguresPartitionPond = new TablePartitionPond <FigureInfo>(FiguresTable); }
private void deleteChat_Click(object sender, EventArgs e) { ToolStripItem menuItem = sender as ToolStripItem; if (menuItem != null) { // Retrieve the ContextMenuStrip that owns this ToolStripItem ContextMenuStrip owner = menuItem.Owner as ContextMenuStrip; if (owner != null) { // Get the control that is displaying this context menu Control sourceControl = owner.SourceControl; Guid chatId = Guid.Parse(sourceControl.Name); int rowIndex = ChatsTable.GetRow(sourceControl); Client.DeleteChat(chatId, Properties.Settings.Default.CurrentUser.Id); Client.RemoveRow(ChatsTable, rowIndex); } } }