Пример #1
0
        public void WriteData(AmfWriter writer, object obj)
        {
            IDictionary <string, object> dictionary;
            IEnumerable enumerable;

            if ((dictionary = obj as IDictionary <string, object>) != null)
            {
                // method writes type marker
                writer.WriteAmf0AssociativeArray(dictionary);
            }
            else if ((enumerable = obj as IEnumerable) != null)
            {
                writer.WriteMarker(Amf0TypeMarkers.StrictArray);
                writer.WriteAmf0Array(enumerable.Cast <object>().ToArray());
            }
            else
            {
                // method writes type marker
                writer.WriteAmf0TypedObject(obj);
            }
        }
Пример #2
0
        public void WriteData(AmfWriter writer, object obj)
        {
            IDictionary<string, object> dictionary;
            IEnumerable enumerable;

            if ((dictionary = obj as IDictionary<string, object>) != null)
            {
                // method writes type marker
                writer.WriteAmf0AssociativeArray(dictionary);
            }
            else if ((enumerable = obj as IEnumerable) != null)
            {
                writer.WriteMarker(Amf0TypeMarkers.StrictArray);
                writer.WriteAmf0Array(enumerable.Cast<object>().ToArray());
            }
            else
            {
                // method writes type marker
                writer.WriteAmf0TypedObject(obj);
            }
        }
Пример #3
0
        public void WriteData(AmfWriter writer, object obj)
        {
            IDictionary <string, object> dictionary;

            if ((dictionary = obj as IDictionary <string, object>) != null)
            {
                writer.WriteAmf0AssociativeArray(dictionary);
            }
            else
            {
                IEnumerable source;
                if ((source = obj as IEnumerable) != null)
                {
                    writer.WriteMarker(Amf0TypeMarkers.StrictArray);
                    writer.WriteAmf0Array((Array)source.Cast <object>().ToArray <object>());
                }
                else
                {
                    writer.WriteAmf0TypedObject(obj);
                }
            }
        }
Пример #4
0
 public void WriteData(AmfWriter writer, object obj)
 {
     writer.WriteMarker(Amf0TypeMarkers.StrictArray);
     writer.WriteAmf0Array(obj as Array);
 }
Пример #5
0
 public void WriteData(AmfWriter writer, object obj)
 {
     writer.WriteMarker(Amf0TypeMarkers.StrictArray);
     writer.WriteAmf0Array(obj as Array);
 }