//********************** //* * //* EntityView_Click * //* * //********************** // View/edit seleted entity. private void EntityCopy_Click(object sender, RoutedEventArgs e) { if (TableListView.SelectedItems.Count != 1) { MessageBox.Show("In order to copy an entity, please select one entity then click the View toolbar button", "Single Selection Requireed"); return; } EntityItem entity = (TableListView.SelectedItems[0]) as EntityItem; if (entity == null) return; EditEntityDialog dlg = new EditEntityDialog(); CloudTable table = tableClient.GetTableReference(SelectedTableContainer); dlg.InitForCopy(table, TableColumnNames, entity); if (dlg.ShowDialog().Value) { if (dlg.RecordsAdded > 0) { ShowTableContainer(SelectedTableContainer); } } }
//********************* //* * //* EntityNew_Click * //* * //********************* // Insert a new entity into the currently selected table. private void EntityNew_Click(object sender, RoutedEventArgs e) { EditEntityDialog dlg = new EditEntityDialog(); CloudTable table = tableClient.GetTableReference(SelectedTableContainer); dlg.InitForInsert(table, TableColumnNames); if (dlg.ShowDialog().Value) { if (dlg.RecordsAdded > 0) { ShowTableContainer(SelectedTableContainer); } } }