public void addImgJarry (JArray jimg, JObject job, JToken rs, string imgName, int sort)
{
If (BLL. JsonDo. GetJTokenKey (rs) IndexOf (imgName) & gt; 1)
{
String STR=the BLL. JsonDo. GetJTokenKey (rs). Replace ("/", "[");
STR=STR. Replace ("] ", "] ");
Sort=Common. Util. ConvertInt32 (BLL. BLLBase. GetsTr (STR, "[]", ""), 0).
String itemName=STR. Split (' [') [0];
If (itemName==imgName)
Job. The Add (imgName, the BLL. JsonDo. GetJTokenValue (rs));
If (itemName==imgName + "_t")
Job. The Add (imgName + "_t", the BLL. JsonDo. GetJTokenValue (rs));
If (itemName==imgName + "_s")
Job. The Add (imgName + "_s", the BLL. JsonDo. GetJTokenValue (rs));
If (job. Count==3)
{
Job. The Add (" sort ", sort);
Jimg. Add (job);
Job=new JObject ();
JObject TMP=the job;
}
}
}
CodePudding user response:
Function passed object argument, namely actually passed in is the object of reference, the address, that is to say, this argument points to the caller of the definition of the original object address, when you are on the job assignment in the function, after the job to a new address, but the caller of the original object is still pointing to the original address, so the original object won't change, if want to empty the contents of the job, not on the job assignment, should call the job of the Clear method (if any),CodePudding user response: