Example #1
0
        /// <summary>
        /// 设置数据
        /// </summary>
        /// <param name="parser"></param>
        private void setValue(ref OperationParameter.NodeParser parser)
        {
            keyType key;

            if (HashCodeKey <keyType> .Get(ref parser, out key) && parser.LoadValueData() && parser.IsEnd && parser.ValueData.Type == ValueData.Data <valueType> .DataType)
            {
                valueType value = ValueData.Data <valueType> .GetData(ref parser.ValueData);

                Dictionary.Set(key, value);
                parser.SetOperationReturnParameter();
            }
            else
            {
                parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError;
            }
        }
 /// <summary>
 /// 获取或者创建节点
 /// </summary>
 /// <param name="parser"></param>
 private void getOrCreateNode(ref OperationParameter.NodeParser parser)
 {
     keyType key;
     if (HashCodeKey<keyType>.Get(ref parser, out key))
     {
         if (!dictionary.ContainsKey(key))
         {
             dictionary.Set(key, nodeConstructor(this, ref parser));
             parser.IsOperation = true;
         }
         parser.ReturnParameter.ReturnParameterSet(true);
     }
     else parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError;
 }