private static void Update(IVariableInstanceFactory variableInstance, UAVariable nodeSet, IUANodeBase nodeContext, UAReferenceContext parentReference, Action <TraceMessage> traceEvent) { try { Update(variableInstance, nodeSet, nodeContext, traceEvent); variableInstance.ReferenceType = parentReference == null ? null : parentReference.GetReferenceTypeName(); if (nodeContext.IsProperty) { traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongReference2Variable, string.Format("Creating Variable - wrong reference type {0}", parentReference.ReferenceKind.ToString()))); } } catch (Exception _ex) { traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongReference2Property, string.Format("Cannot resolve the reference for Variable because of error {0} at: {1}.", _ex, _ex.StackTrace))); } }
private void Update(IPropertyInstanceFactory propertyInstance, UAVariable nodeSet, IUANodeBase nodeContext, UAReferenceContext parentReference) { try { Update(propertyInstance, nodeSet); propertyInstance.ReferenceType = parentReference == null ? null : parentReference.GetReferenceTypeName(); if (!nodeContext.IsProperty) { Log.TraceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongReference2Property, $"Creating Property {nodeContext.BrowseName}- wrong reference type {parentReference.ReferenceKind.ToString()}")); } } catch (Exception _ex) { Log.TraceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongReference2Property, string.Format("Cannot resolve the reference for Property because of error {0} at: {1}.", _ex, _ex.StackTrace))); } }