Exemple #1
0
 public override void Validate(Context context)
 {
     ArgumentValidation.CheckForEmptyString(BaseString, "Base String");
     ArgumentValidation.CheckForEmptyString(NumParams.ToString(), "Num Params");
     ArgumentValidation.CheckForEmptyString(ParamString, "Parameter String");
     ArgumentValidation.CheckForEmptyString(Delimiter, "Delimiter");
     ArgumentValidation.CheckForEmptyString(ContextKeyWithResult, "Context Key");
 }
Exemple #2
0
        public virtual void Deserialize(BinaryReader r)
        {
            var numParamCount = r.ReadUInt32();

            // if there are no custom params of any kind,
            // there's just an 0xFFFFFFFF here and the item ends.
            if (numParamCount == NoParamsMarker)
            {
                return;
            }

            for (int i = 0; i < numParamCount; i++)
            {
                NumParams.Add(r.ReadSingle());
            }

            var stringParamCount = r.ReadUInt32();

            for (int i = 0; i < stringParamCount; i++)
            {
                var strLen   = (int)r.ReadUInt64();
                var strBytes = r.ReadBytes(strLen);
                var str      = Encoding.Default.GetString(strBytes);
                StringParams.Add(str);
            }

            var targetTagsCount = r.ReadUInt32();

            for (int i = 0; i < targetTagsCount; i++)
            {
                TargetTags.Add(r.ReadToken());
            }

            TargetRange = r.ReadSingle();
            actionFlags = new FlagField(r.ReadUInt32());
        }