コード例 #1
0
        public void Read(long parentEndPosition, Encoding encoding, AdsBinaryReader reader)
        {
            long position = reader.BaseStream.Position;

            this.entryLength = reader.ReadUInt32();
            long num2 = position + this.entryLength;

            this.size          = reader.ReadUInt32();
            this.alignSize     = reader.ReadUInt32();
            this.dataType      = (AdsDatatypeId)reader.ReadUInt32();
            this.flags         = (MethodParamFlags)reader.ReadUInt32();
            this.reserved      = reader.ReadUInt32();
            this.typeGuid      = reader.ReadGuid();
            this.lengthIsPara  = reader.ReadUInt16();
            this.nameLength    = reader.ReadUInt16();
            this.typeLength    = reader.ReadUInt16();
            this.commentLength = reader.ReadUInt16();
            this.name          = reader.ReadPlcString(this.nameLength + 1, encoding);
            this.type          = reader.ReadPlcString(this.typeLength + 1, encoding);
            this.comment       = reader.ReadPlcString(this.commentLength + 1, encoding);
            if (reader.BaseStream.Position <= num2)
            {
                byte[] buffer = reader.ReadBytes((int)(num2 - reader.BaseStream.Position));
            }
            else if (reader.BaseStream.Position > num2)
            {
                object[] args = new object[] { this.name };
                Module.Trace.TraceError("Reading MethodPara entry for '{0}' failed!", args);
                reader.BaseStream.Position = num2;
            }
        }
コード例 #2
0
 internal RpcMethodParameter(AdsMethodParaInfo paraInfo)
 {
     this._name            = paraInfo.name;
     this._size            = (int)paraInfo.size;
     this._alignSize       = (int)paraInfo.alignSize;
     this._dataTypeId      = paraInfo.dataType;
     this._flags           = paraInfo.flags;
     this._typeGuid        = paraInfo.typeGuid;
     this._lengthParaIndex = paraInfo.lengthIsPara;
     this._name            = paraInfo.name;
     this._typeName        = paraInfo.type;
     this._comment         = paraInfo.comment;
 }
コード例 #3
0
 protected int GetParameters(IRpcMethod method, MethodParamFlags mask, out RpcMethodParameterCollection parameters, out IList <IDataType> types)
 {
     types      = new List <IDataType>();
     parameters = new RpcMethodParameterCollection();
     for (int i = 0; i < method.Parameters.Count; i++)
     {
         if ((method.Parameters[i].ParameterFlags & mask) > ((MethodParamFlags)0))
         {
             IDataType type = null;
             if (!this._resolver.TryResolveType(method.Parameters[i].TypeName, out type))
             {
                 throw new ArgumentOutOfRangeException("parameters");
             }
             types.Add(type);
             parameters.Add(method.Parameters[i]);
         }
     }
     return(types.Count);
 }