System.Runtime.Serialization.Plists.BinaryPlistWriter.AddPrimitive C# (CSharp) Method

AddPrimitive() private method

Adds a primitive to the internal object table.
private AddPrimitive ( bool value ) : int
value bool The value to add.
return int
        private int AddPrimitive(bool? value)
        {
            if (!value.HasValue || !this.uniques.Contains(value.Value))
            {
                int index = this.objectTable.Count;

                BinaryPlistItem item = new BinaryPlistItem(value);
                item.Marker.Add(value.HasValue ? (value.Value ? (byte)0x9 : (byte)0x8) : (byte)0);

                this.objectTable.Add(item);
                this.objectTableSize += item.Size;

                if (value.HasValue)
                {
                    this.uniques.SetIndex(value.Value, index);
                }

                return index;
            }

            return this.uniques.GetIndex(value.Value);
        }