예제 #1
0
        private async void SaveButton_Click(object sender, EventArgs e)
        {
            MapiMapping mapiMapping = new MapiMapping(_maps);

            foreach (DataGridViewRow row in MapsDataGrid.Rows)
            {
                if (!row.IsNewRow)
                {
                    string from = row.Cells["From"].Value.ToString();
                    string type = row.Cells["Type"].Value.ToString();
                    string to   = row.Cells["To"].Value.ToString();

                    string meta = null;
                    if (row.Cells["Meta"].Value != null)
                    {
                        meta = row.Cells["Meta"].Value.ToString();
                    }

                    mapiMapping.AddMap(new MapiMap(from, type, to, meta));
                }
            }

            await _mappingManager.Save(mapiMapping);
        }
 public async Task Save(MapiMapping mapiMapping)
 {
     await _repository.Save(mapiMapping);
 }