private void ButtonCreateService_Click(object sender, EventArgs e) { try { dynamic service = _service; string serviceId = null; if (service != null && service.Id != null) { serviceId = service.Id; } _service = new DynamicWrapper(); _service.Id = serviceId ?? Guid.NewGuid().ToString(); _service.Name = TextEditServiceName.Text; _service.Caption = TextEditServiceCaption.Text; _service.Type = ViewModelExtension.BuildCompleteServiceType(ComboBoxServiceType.EditValue.ToString()); foreach (var extensionPoint in _extensionPoints) { _service.BuildCollectionItem("ExtensionPoints", (object)extensionPoint); } MessageBox.Show("Service metadata created successfully."); OnValueChanged(_service, new EventArgs()); } catch { MessageBox.Show("Ошибка создания сервиса"); } }