Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 private void WriteStructInternal(INdrStructure structure)
 {
     Align(structure.GetAlignment());
     structure.Marshal(this);
 }
Ejemplo n.º 7
0
 public void WriteStruct(INdrStructure structure)
 {
     structure.Marshal(this);
 }