コード例 #1
0
 public static void SetAttributeDataTypeIfNull(PssgSchema.Attribute attribute, Type attrType)
 {
     if (attribute.DataType == typeof(System.Exception))
     {
         attribute.DataType = attrType;
     }
 }
コード例 #2
0
 public PssgAttribute(PssgSchema.Attribute attributeInfo, object data, PssgFile file, PssgNode ParentNode)
 {
     this.AttributeInfo = attributeInfo;
     this.data          = data;
     this.file          = file;
     this.ParentNode    = ParentNode;
 }
コード例 #3
0
        public PssgAttribute(PssgAttribute attrToCopy)
        {
            this.file       = attrToCopy.file;
            this.ParentNode = attrToCopy.ParentNode;

            this.AttributeInfo = attrToCopy.AttributeInfo;
            this.size          = attrToCopy.size;
            this.data          = attrToCopy.data;
        }
コード例 #4
0
        public PssgAttribute(XAttribute xAttr, PssgFile file, PssgNode node)
        {
            this.file       = file;
            this.ParentNode = node;

            //this.id = PssgSchema.GetAttributeId(ParentNode.Name, xAttr.Name.LocalName);
            string attrName = xAttr.Name.LocalName.StartsWith("___") ? xAttr.Name.LocalName.Substring(3) : xAttr.Name.LocalName;

            this.AttributeInfo = PssgSchema.AddAttribute(this.ParentNode.Name, attrName);// PssgSchema.GetAttribute(this.ParentNode.Name, xAttr.Name.LocalName);
            this.data          = this.FromString(xAttr.Value);
            PssgSchema.SetAttributeDataTypeIfNull(this.AttributeInfo, this.ValueType);
        }
コード例 #5
0
        public PssgAttribute(PssgBinaryReader reader, PssgFile file, PssgNode node)
        {
            this.file       = file;
            this.ParentNode = node;

            int id = reader.ReadInt32();

            this.AttributeInfo = PssgSchema.GetAttribute(id);
            this.size          = reader.ReadInt32();
            this.data          = reader.ReadAttributeValue(this.AttributeInfo.DataType, size);
            this.AttributeInfo = PssgSchema.AddAttribute(this.ParentNode.Name, this.Name, this.ValueType);
        }