コード例 #1
0
        private void WriteList(StageList list)
        {
            this._json.WriteListStart();
            bool flag = false;

            foreach (StageItem stageItem in list.Items())
            {
                if (!flag)
                {
                    flag = true;
                }
                else
                {
                    this._json.WriteSeparator();
                }
                if (stageItem is StageValue)
                {
                    this._json.WriteValue((StageValue)stageItem);
                }
                else if (stageItem is StageElement)
                {
                    this.WriteElement((StageElement)stageItem);
                }
                else if (!(stageItem is StageList))
                {
                    if (!(stageItem is StageNull))
                    {
                        continue;
                    }
                    this._json.WriteNull((StageNull)stageItem);
                }
                else
                {
                    this.WriteList((StageList)stageItem);
                }
            }
            this._json.WriteListEnd();
        }
コード例 #2
0
        private void WriteList(StageList list)
        {
            _json.WriteListStart();

            bool separate = false;

            foreach (var item in list.Items())
            {
                if (separate)
                {
                    _json.WriteSeparator();
                }
                else
                {
                    separate = true;
                }

                if (item is StageValue)
                {
                    _json.WriteValue((StageValue)item);
                }
                else if (item is StageElement)
                {
                    WriteElement((StageElement)item);
                }
                else if (item is StageList)
                {
                    WriteList((StageList)item);
                }
                else if (item is StageNull)
                {
                    _json.WriteNull((StageNull)item);
                }
            }

            _json.WriteListEnd();
        }