private void NewCommandHandler() { OpenFileDialog _of = new OpenFileDialog() { CheckFileExists = true, DefaultExt = "UANodeSet (.xml)|*.xml", Title = "Open OPC UA Address Space Model" }; if (!_of.ShowDialog().GetValueOrDefault(false)) { return; } DomainModelWrapper _dsc = m_domainsServices.CreateDefault(); _dsc.UniversalAddressSpaceLocator = _of.FileName; DomainConfirmation _confirmation = new DomainConfirmation(_dsc, true, m_Logger.Log) { Title = "Create Data Domain Model" }; bool _exitLoop = false; do { b_EditPopupRequest.Raise(_confirmation, x => { _exitLoop = x.Confirmed; }); if (_exitLoop) { _exitLoop = m_domainsServices.AddDomain(_confirmation.DomainConfigurationWrapper); } else { _exitLoop = true; } } while (!_exitLoop); }
private void AddCommandHandler() { DomainModelWrapper _dsc = null; DomainModelResolveViewModel _modeResolveConfirmation = new DomainModelResolveViewModel(m_Logger.Log) { Title = "Resolve Uri of Information Model to Data Domain Model Description" }; bool _exitLoop = false; do { b_ResoleUriToDomainModelPopupRequest.Raise(_modeResolveConfirmation, x => { _exitLoop = x.Confirmed; }); if (_exitLoop & _modeResolveConfirmation.ResolvedDomainModel != null) { _dsc = _modeResolveConfirmation.ResolvedDomainModel; } else { _exitLoop = true; } } while (!_exitLoop); if (_dsc == null) { return; } DomainConfirmation _confirmation = new DomainConfirmation(_dsc, false, m_Logger.Log) { Title = "Import Data Domain Model" }; do { b_EditPopupRequest.Raise(_confirmation, x => { _exitLoop = x.Confirmed; }); if (_exitLoop) { _exitLoop = m_domainsServices.AddDomain(_confirmation.DomainConfigurationWrapper); if (!_exitLoop) { MessageBox.Show("The data domain exist", "Add data domain failed", MessageBoxButton.OK, MessageBoxImage.Error); } } else { _exitLoop = true; } } while (!_exitLoop); }
private void EditCommandHandler() { if (CurrentDomain == null) //double check { return; } DomainConfirmation _confirmation = new DomainConfirmation(CurrentDomain, true, m_Logger.Log) { Title = "Edit Data Domain Model" }; bool _confirmed = false; b_EditPopupRequest.Raise(_confirmation, x => { _confirmed = x.Confirmed; }); if (_confirmed) { _confirmation.ApplyChanges(); } }