/// <summary>
 /// Buttons the test read opc address space request.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void ButtonTestReadOpcAddressSpaceRequest(object sender, RoutedEventArgs e)
 {
     try
     {
         var client = new CommServerClient();
         client.ReadOpcAddressSpaceRequest(ClientUri, Guid.NewGuid(), "Endress.OpcDa.Promag800.1");
         client.Close();
     }
     catch (Exception exception)
     {
         MessageBox.Show("Exception in client call: " + exception.Message);
     }
 }
示例#2
0
        /// <summary>
        /// Reads the opc address space.
        /// </summary>
        private void ReadOpcAddressSpace()
        {
            try
            {
                if (!string.IsNullOrEmpty(this.mainWindowViewModel.ConnectedServer.Name))
                {
                    this.mainWindowViewModel.ClearOpcItemMappingTreeOpcItems();

                    var client = new CommServerClient();
                    client.ReadOpcAddressSpaceRequest(MainWindow.ClientUri, Guid.NewGuid(), this.mainWindowViewModel.ConnectedServer.ClassId);
                    client.Close();
                }
            }
            catch (Exception exception)
            {
                this.mainWindowViewModel.Host.UserInterface.DisplayMessage(exception.Message, Resources.Language_Selection, MessageButton.ButtonsOk, MessageType.MessageInformation, DefaultMessageButton.ButtonOk);
            }
        }