System.Runtime.Serialization.Plists.BinaryPlistArray.ToArray C# (CSharp) Method

ToArray() public method

Converts this instance into an T:object[] array.
public ToArray ( ) : object[]
return object[]
        public object[] ToArray()
        {
            object[] array = new object[this.ObjectReference.Count];
            int objectRef;
            object objectValue;
            BinaryPlistArray innerArray;
            BinaryPlistDictionary innerDict;

            for (int i = 0; i < array.Length; i++)
            {
                objectRef = this.ObjectReference[i];

                if (objectRef >= 0 && objectRef < this.ObjectTable.Count && (this.ObjectTable[objectRef] == null || this.ObjectTable[objectRef].Value != this))
                {
                    objectValue = this.ObjectTable[objectRef] == null ? null : this.ObjectTable[objectRef].Value;
                    innerDict = objectValue as BinaryPlistDictionary;

                    if (innerDict != null)
                    {
                        objectValue = innerDict.ToDictionary();
                    }
                    else
                    {
                        innerArray = objectValue as BinaryPlistArray;

                        if (innerArray != null)
                        {
                            objectValue = innerArray.ToArray();
                        }
                    }

                    array[i] = objectValue;
                }
            }

            return array;
        }