void BuildSource(string strSource)
{
if (this.dataChangedEventHandled)
{
return;
}
PropertyGridParameterCollection result = new PropertyGridParameterCollection();
JObject jo = JObject.Parse(strSource);
foreach (JProperty property in jo.Properties())
{
string value = property.Value.Type == JTokenType.String ? (string)property.Value : this.ChopQuotes(property.Value.ToString());
PropertyGridParameter newP = new PropertyGridParameter(this.ChopQuotes(property.Name), value);
PropertyGridParameter oldP = this.FindParam(property.Name);
newP.Mode = oldP.Mode;
if (oldP.Editor.Count > 0)
{
newP.Editor.Add(oldP.Editor.Editor);
}
newP.IsChanged = newP.Name.IsEmpty() || oldP.Value != newP.Value;
if (newP.IsChanged)
{
raiseChanged = true;
}
result.Add(newP);
}
this.Source.Clear();
foreach (PropertyGridParameter parameter in result)
{
this.Source.Add(parameter);
}
this.dataChangedEventHandled = true;
}