public T ReadStruct <T>() where T : INdrStructure, new() { INdrStructure s = (INdrStructure) new T(); bool conformant = false; if (s is INdrConformantStructure conformant_struct) { conformant = SetupConformance(conformant_struct.GetConformantDimensions()); System.Diagnostics.Debug.Assert(_conformance_values != null); } T ret; using (var queue = _deferred_reads.Push()) { ret = ReadStructInternal <T>(); } if (conformant) { System.Diagnostics.Debug.Assert(_conformance_values == null); } return(ret); }
private T ReadStructInternal <T>() where T : new() { INdrStructure s = (INdrStructure) new T(); Align(s.GetAlignment()); s.Unmarshal(this); return((T)s); }
public void WriteStruct(INdrStructure structure) { bool conformant = false; if (structure is INdrConformantStructure conformant_structure) { conformant = SetupConformance(conformant_structure.GetConformantDimensions()); System.Diagnostics.Debug.Assert(_conformance_position.HasValue); } structure.Marshal(this); if (conformant) { System.Diagnostics.Debug.Assert(!_conformance_position.HasValue); } }
public void WriteStruct(INdrStructure structure) { bool conformant = false; if (structure is INdrConformantStructure conformant_structure) { conformant = SetupConformance(conformant_structure.GetConformantDimensions()); System.Diagnostics.Debug.Assert(_conformance_position.HasValue); } using (var queue = _deferred_writes.Push()) { WriteStructInternal(structure); } if (conformant) { System.Diagnostics.Debug.Assert(!_conformance_position.HasValue); } }
private T ReadStructInternal <T>(bool top_level_struct) where T : new() { INdrStructure s = (INdrStructure) new T(); bool conformant = false; if (top_level_struct && s is INdrConformantStructure conformant_struct) { conformant = SetupConformance(conformant_struct.GetConformantDimensions()); System.Diagnostics.Debug.Assert(_conformance_values != null); } Align(s.GetAlignment()); s.Unmarshal(this); if (conformant) { System.Diagnostics.Debug.Assert(_conformance_values == null); } return((T)s); }
private void WriteStructInternal(INdrStructure structure) { Align(structure.GetAlignment()); structure.Marshal(this); }
public void WriteStruct(INdrStructure structure) { structure.Marshal(this); }