示例#1
0
 private Opc.Ua.ModelCompiler.LocalizedText CreateSource()
 {
     Opc.Ua.ModelCompiler.LocalizedText source = new Opc.Ua.ModelCompiler.LocalizedText();
     source.Key   = Key;
     source.Value = Value;
     return(source);
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocalizedText"/> class on the base of <see cref="Opc.Ua.ModelCompiler.LocalizedText"/>.
 /// </summary>
 /// <param name="source">The source.</param>
 public LocalizedText(Opc.Ua.ModelCompiler.LocalizedText source)
 {
     if (source == null)
     {
         return;
     }
     this.Key   = source.Key;
     this.Value = source.Value;
 }
        public void DescriptionTestMethod()
        {
            int         _counter = 0;
            NodeFactory _nf      = new NodeFactory(x => _counter++);

            Assert.AreEqual <int>(0, _counter);
            LocalizedText _lt = new LocalizedText()
            {
                Key = "localeField", Value = "valueField"
            };

            _nf.AddDescription(_lt.Key, _lt.Value);
            Assert.AreEqual <int>(0, _counter);
            _nf.AddDescription(_lt.Key, _lt.Value);
            Assert.AreEqual <int>(1, _counter);
            _nf.AddDescription(_lt.Key, _lt.Value);
            Assert.AreEqual <int>(2, _counter);
            List <string> _path = new List <string>();
            NodeDesign    _nd   = _nf.Export(_path, (x, Y) => { });

            _lt.Compare(_nd.Description);
        }