internal override NodeDesign Export(List <string> path, Action <InstanceDesign, List <string> > createInstanceType)
            {
                NodeDesign _nd = new NodeDesign()
                {
                };

                base.UpdateNode(_nd, path, createInstanceType);
                return(_nd);
            }
Example #2
0
        //private
        protected void ExportNodes(List <NodeDesign> members, List <string> path, Action <InstanceDesign, List <string> > createInstanceType)
        {
            NodeFactoryBase _currItem = null;

            foreach (NodeFactoryBase _item in m_Nodes)
            {
                try
                {
                    _currItem = _item;
                    NodeDesign _newNode = _item.Export(new List <string>(path), createInstanceType);
                    members.Add(_newNode);
                }
                catch (Exception _ex)
                {
                    string _msg = String.Format("Error caught while processing the node {0}. The message: {1} at {2}.", _currItem.SymbolicName, _ex.Message, _ex.StackTrace);
                    TraceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.NonCategorized, _msg));
                }
            }
        }
        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);
        }