/// <summary>
 /// Lookups the error text for the specified error id.
 /// </summary>
 private string GetErrorText(object subscriptionHandle, Opc.ResultID resultID)
 {
     if (m_CMS_ShowErrorText.Checked)
     {
         // display nothing for ok results.
         if (resultID == Opc.ResultID.S_OK)
         {
             return("");
         }
         // fetch the error text from the server.
         string errorText = null;
         try
         {
             Subscription subscription = (Subscription)m_subscriptions[subscriptionHandle];
             string       locale       = (subscription != null) ? subscription.Locale : CultureInfo.CurrentCulture.Name;
             errorText = subscription.Server.GetErrorText(locale, resultID);
         }
         catch
         {
             errorText = null;
         }
         // return the result;
         return((errorText != null) ? errorText : "");
     }
     // return the result id as a string.
     return(resultID.ToString());
 }
        /// <summary>
        /// Lookups the error text for the specified error id.
        /// </summary>
        private string GetErrorText(Opc.ResultID resultID)
        {
            if (!ShowErrorTextMI.Checked)
            {
                // return the result id as a string.
                return(resultID.ToString());
            }
            // display nothing for ok results.
            if (resultID == Opc.ResultID.S_OK)
            {
                return("");
            }
            // check if text has already been fetched.
            string errorText = (string)m_errors[resultID];

            // fetch the error text from the server.
            if (errorText != null)
            {
                return(errorText);
            }
            if ((m_server != null) && (m_server.IsConnected))
            {
                try
                {
                    errorText          = m_server.GetErrorText(m_locale, resultID);
                    m_errors[resultID] = errorText;
                }
                catch
                {
                    errorText = null;
                }
            }
            // return the result;
            return("");
        }
 public IdentifiedResult(string itemName, Opc.ResultID resultID, string diagnosticInfo) : base(itemName)
 {
     this.m_resultID       = Opc.ResultID.S_OK;
     this.m_diagnosticInfo = null;
     this.ResultID         = resultID;
     this.DiagnosticInfo   = diagnosticInfo;
 }
 public IdentifiedResult(IdentifiedResult item) : base(item)
 {
     this.m_resultID       = Opc.ResultID.S_OK;
     this.m_diagnosticInfo = null;
     if (item != null)
     {
         this.ResultID       = item.ResultID;
         this.DiagnosticInfo = item.DiagnosticInfo;
     }
 }
 public IdentifiedResult(ItemIdentifier item, Opc.ResultID resultID) : base(item)
 {
     this.m_resultID       = Opc.ResultID.S_OK;
     this.m_diagnosticInfo = null;
     this.ResultID         = resultID;
 }
 public IdentifiedResult()
 {
     this.m_resultID       = Opc.ResultID.S_OK;
     this.m_diagnosticInfo = null;
 }