void Page_LoadComplete(object sender, EventArgs e) { foreach (PropertyValue prop in this.Properties) { if (prop.Definition.EditorKey.IsNotEmpty()) { PropertyEditorHelper.AllEditors.ContainsKey(prop.Definition.EditorKey).FalseThrow("不能找到预定义好的属性编辑器{0}", prop.Definition.EditorKey); PropertyEditorBase propEditor = PropertyEditorHelper.AllEditors[prop.Definition.EditorKey]; propEditor.SetControlsPropertyDefineFromEditorParams(prop.Definition); } } }
void Page_LoadComplete(object sender, EventArgs e) { foreach (PropertyValue prop in this.Properties) { if (prop.Definition.EditorKey.IsNotEmpty()) { PropertyEditorBase propEditor = PropertyEditorHelper.AllEditors[prop.Definition.EditorKey]; propEditor.SetControlsPropertyDefineFromEditorParams(prop.Definition); //if (prop.Definition.EditorParams.IsNotEmpty() && Regex.IsMatch(prop.Definition.EditorParams, @"\{[^{}]*}") == true) //{ // EditorParamsDefine paraDefine = JSONSerializerExecute.Deserialize<EditorParamsDefine>(prop.Definition.EditorParams); // //try // //{ // // paraDefine = JSONSerializerExecute.Deserialize<EditorParamsDefine>(prop.Definition.EditorParams); // //} // //catch (Exception) // //{ // // flag = false; // //} // if (paraDefine.ServerControlProperties.Count > 0) // { // if (paraDefine.CloneControlID.IsNullOrEmpty()) // paraDefine.CloneControlID = propEditor.DefaultCloneControlName(); // if (propEditor.IsCloneControlEditor) // { // if (propEditor.ControlsPropertyDefine.ContainsKey(paraDefine.CloneControlID)) // { // propEditor.ControlsPropertyDefine[paraDefine.CloneControlID].ControlPropertyDefineList = paraDefine.ServerControlProperties; // } // else // { // propEditor.ControlsPropertyDefine.Add(new ControlPropertyDefineWrapper() { ControlID = paraDefine.CloneControlID, ControlPropertyDefineList = paraDefine.ServerControlProperties }); // } // //Control cloneControl = propEditor.CreateDefalutControl(); // //if (cloneControl == null) return; // //cloneControl.ID = paraDefine.CloneControlID; // //propEditor.AddCloneControl(cloneControl); // //propEditor.InitCloneControlProperties(paraDefine.CloneControlID, paraDefine.ServerControlProperties); // } // } //} } } }