示例#1
0
文件: Argument.cs 项目: rinavin/RCJS
        /// <summary>
        ///   CTOR that creates a "Value" type argument from a given Expression Value
        /// </summary>
        /// <param name = "expVal">the source expression value</param>
        protected internal Argument(GuiExpressionEvaluator.ExpVal expVal)
        {
            _type = ConstInterface.ARG_TYPE_VALUE;
            _fld  = null;
            _exp  = null;
            _skip = false;

            if (expVal.IsNull)
            {
                _val = null;
            }
            else
            {
                _val = expVal.ToMgVal();
                if (expVal.Attr == StorageAttribute.DOTNET &&
                    (String.IsNullOrEmpty(_val) || !BlobType.isValidDotNetBlob(_val)))
                {
                    _dnObjectCollectionKey = DNManager.getInstance().DNObjectsCollection.CreateEntry(null);
                    _val = BlobType.createDotNetBlobPrefix(_dnObjectCollectionKey);

                    if (expVal.DnMemberInfo != null)
                    {
                        DNManager.getInstance().DNObjectsCollection.Update(_dnObjectCollectionKey,
                                                                           expVal.DnMemberInfo.value);
                    }

                    // add this key into 'tempDNObjectsCollectionKeys', so that it can be freed later.
                    ClientManager.Instance.getTempDNObjectCollectionKeys().Add(_dnObjectCollectionKey);
                }
            }

            _valueIsNull = (_val == null);
            _valueAttr   = expVal.Attr;
        }