Opc.Ua.Com.ServerFactory.CreateUri C# (CSharp) Method

CreateUri() private method

Reads the server details from the enumerator.
private CreateUri ( System.Guid clsid ) : Uri
clsid System.Guid
return System.Uri
		private Uri CreateUri(Guid clsid)
		{
			// initialize the server uri.
			StringBuilder uri = new StringBuilder();

			// append scheme and host.
            uri.Append("opc.com://");
            uri.Append(m_host);
            
		    string progID = null;

			try
			{
				// fetch class details from the enumerator.
				string description  = null;
				string verIndProgID = null;

				m_server.GetClassDetails(
					ref clsid, 
					out progID, 
					out description, 
					out verIndProgID);                
				
				// use version independent prog id if available.
				if (!String.IsNullOrEmpty(verIndProgID))
				{
                    progID = verIndProgID;
                }				
			}
			catch
			{
                // cannot get prog id.
                progID = null;
			}
                    
			// append prog id.
			if (!String.IsNullOrEmpty(progID))
			{
                uri.AppendFormat("/{0}", progID);
			}

			// append prog id.
            uri.AppendFormat("/{0}", clsid);

			// return the server uri.
			return new Uri(uri.ToString());
		}
		#endregion