SetID() 공개 메소드

public SetID ( int id ) : void
id int
리턴 void
예제 #1
0
        /**
         * Writes the list and list override tables.
         */
        public virtual void WriteDefinition(Stream result)
        {
            byte[] t;
            result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
            result.Write(LIST_TABLE, 0, LIST_TABLE.Length);
            this.document.OutputDebugLinebreak(result);

            for (int i = 0; i < picturelists.Count; i++)
            {
                RtfPictureList l = (RtfPictureList)picturelists[i];
                //          l.SetID(document.GetRandomInt());
                l.WriteDefinition(result);
                this.document.OutputDebugLinebreak(result);
            }

            for (int i = 0; i < lists.Count; i++)
            {
                RtfList l = (RtfList)lists[i];
                l.SetID(document.GetRandomInt());
                l.WriteDefinition(result);
                this.document.OutputDebugLinebreak(result);
            }
            result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
            this.document.OutputDebugLinebreak(result);

            result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
            result.Write(LIST_OVERRIDE_TABLE, 0, LIST_OVERRIDE_TABLE.Length);
            this.document.OutputDebugLinebreak(result);

            // list override index values are 1-based, not 0.
            // valid list override index values \ls are 1 to 2000.
            // if there are more then 2000 lists, the result is undefined.
            for (int i = 0; i < lists.Count; i++)
            {
                result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
                result.Write(LIST_OVERRIDE, 0, LIST_OVERRIDE.Length);
                result.Write(RtfList.LIST_ID, 0, RtfList.LIST_ID.Length);
                result.Write(t = IntToByteArray(((RtfList)lists[i]).GetID()), 0, t.Length);
                result.Write(LIST_OVERRIDE_COUNT, 0, LIST_OVERRIDE_COUNT.Length);
                result.Write(t = IntToByteArray(0), 0, t.Length);    // is this correct? Spec says valid values are 1 or 9.
                result.Write(RtfList.LIST_NUMBER, 0, RtfList.LIST_NUMBER.Length);
                result.Write(t = IntToByteArray(((RtfList)lists[i]).GetListNumber()), 0, t.Length);
                result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
                this.document.OutputDebugLinebreak(result);
            }
            result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
            this.document.OutputDebugLinebreak(result);
        }