public void AddUniqueObject(AsfObject obj) { for (int i = 0; i < children.Count; i++) { if (((AsfObject)children[i]).Guid == obj.Guid) { children[i] = obj; return; } } children.Add(obj); }
public ByteVector Render() { ByteVector v = AsfObject.RenderUnicode(name); ByteVector data = AsfObject.RenderWord((short)v.Count) + v + AsfObject.RenderWord((short)type); switch (type) { case AsfDataType.Unicode: v = AsfObject.RenderUnicode(sValue); data += AsfObject.RenderWord((short)v.Count) + v; break; case AsfDataType.Bytes: data.Add(AsfObject.RenderWord((short)bvValue.Count)); data.Add(bvValue); break; case AsfDataType.Bool: data.Add(AsfObject.RenderWord(4)); data.Add(AsfObject.RenderDWord((uint)lValue)); break; case AsfDataType.DWord: data.Add(AsfObject.RenderWord(4)); data.Add(AsfObject.RenderDWord((uint)lValue)); break; case AsfDataType.QWord: data.Add(AsfObject.RenderWord(8)); data.Add(AsfObject.RenderQWord(lValue)); break; case AsfDataType.Word: data.Add(AsfObject.RenderWord(2)); data.Add(AsfObject.RenderWord((short)lValue)); break; default: return(null); } return(data); }
public void AddObject(AsfObject obj) { children.Add(obj); }
public void AddUniqueObject(AsfObject obj) { for (int i = 0; i < children.Count; i++) if (((AsfObject)children[i]).Guid == obj.Guid) { children[i] = obj; return; } children.Add(obj); }