コード例 #1
0
 private static void Update(IReferenceTypeFactory nodeDesign, UAReferenceType nodeSet, Action <TraceMessage> traceEvent)
 {
     nodeSet.InverseName.ExportLocalizedTextArray(nodeDesign.AddInverseName);
     nodeDesign.Symmetric = nodeSet.Symmetric;
     if (nodeSet.Symmetric && (nodeSet.InverseName != null && nodeSet.InverseName.Where(x => !String.IsNullOrEmpty(x.Value)).Any()))
     {
         XML.LocalizedText _notEmpty = nodeSet.InverseName.Where(x => !String.IsNullOrEmpty(x.Value)).First();
         traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongInverseName, String.Format("If ReferenceType {0} is symmetric the InverseName {1}:{2} shall be omitted.", nodeSet.NodeIdentifier(), _notEmpty.Locale, _notEmpty.Value)));
     }
     else if (!nodeSet.Symmetric && !nodeSet.IsAbstract && (nodeSet.InverseName == null || !nodeSet.InverseName.Where(x => !String.IsNullOrEmpty(x.Value)).Any()))
     {
         traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongInverseName, String.Format("If ReferenceType {0} is not symmetric and not abstract the InverseName shall be specified.", nodeSet.NodeIdentifier())));
     }
 }
        public void InformationModelFactoryIExportReferenceTypeFactoryTestMethod()
        {
            IReferenceTypeFactory _new = m_FactoryBase.AddNodeFactory <IReferenceTypeFactory>();

            Assert.IsNotNull(_new);
        }