Ejemplo n.º 1
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            string t = GetText();

            if (string.IsNullOrEmpty(Json) == false)
            {
                t = Json;
            }
            var j = JObject.Parse(t);

            foreach (var item in j.Properties())
            {
                if (item.Value != null)
                {
                    if (item.Value.Type == Newtonsoft.Json.Linq.JTokenType.Null)
                    {
                        SetText("Null");
                    }
                    else if (item.Value.Type == Newtonsoft.Json.Linq.JTokenType.Object)
                    {
                        DataWriteAllJsonData all = new DataWriteAllJsonData();
                        all.SetParent(this);
                        all.Json         = item.Value.ToString();
                        all.PropertyName = this.PropertyName.NullIsEmpty() + item.Name + ".";
                        all.Run();
                    }
                    else
                    {
                        SetText(item.Value.ToString());
                    }
                }
                else
                {
                    SetText("Null");
                }

                DataWrite dataWrite = new DataWrite();
                dataWrite.SetParent(this);
                dataWrite.Attribute = PropertyName.NullIsEmpty() + item.Name;
                dataWrite.Run();
            }
            base.Run(runChildren);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            string t = GetText();
            if (string.IsNullOrEmpty(Json) == false) t = Json;
            var j = JObject.Parse(t);

            foreach (var item in j.Properties())
            {
                if (item.Value != null)
                {
                    if (item.Value.Type == Newtonsoft.Json.Linq.JTokenType.Null)
                    {
                        SetText("Null");
                    }
                    else if (item.Value.Type == Newtonsoft.Json.Linq.JTokenType.Object)
                    {
                        DataWriteAllJsonData all = new DataWriteAllJsonData();
                        all.SetParent(this);
                        all.Json = item.Value.ToString();
                        all.PropertyName = this.PropertyName.NullIsEmpty() + item.Name + ".";
                        all.Run();
                    }
                    else
                    {
                        SetText(item.Value.ToString());
                    }
                }
                else
                {
                    SetText("Null");
                }

                DataWrite dataWrite = new DataWrite();
                dataWrite.SetParent(this);
                dataWrite.Attribute = PropertyName.NullIsEmpty()+ item.Name;
                dataWrite.Run();

            }
            base.Run(runChildren);
        }