void ps_DeleteClick(object sender, RoutedEventArgs e) { ParameterSelected ps = sender as ParameterSelected; if (null == ps) { return; } ps.Text = string.Empty; ps.TargetCtrlName = string.Empty; ps.TargetMetaDataColumn = null; ps.InitLoadValue = null; }
void ps_ModifyClick(object sender, RoutedEventArgs e) { //-->将值显示到text上去 ParameterSelected ps = sender as ParameterSelected; if (null == ps) { return; } if (null != _CurrentParamterSelected) { _CurrentParamterSelected.BackgroundReset(); } //-->获取所有其它控件 _CurrentParamterSelected = ps; _CurrentParamterSelected.BackgroundSet(); }
void ct_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { sp_Children.Children.Clear(); var ci = ct.SelectedControlInfo; if (null == ci) { return; } var parameterItem = _GetControlParameter(ci.MetaData, ci.ColumnName); //-->控件的参数就是控件MetaData里的row信息 //-->得行的参数了 if (null == parameterItem) { return; } string _controlName = Wrapper.ParseControlName(ci.Name); foreach (var v in parameterItem) { ParameterSelected ps = new ParameterSelected(); ps.txtParamName.Text = string.Format("{0}【{1}】", v.column_name, v.column_comment); ps.OrgMetaDataColumn = v; ps.FieldName = v.column_name; ps.DeleteClick += new RoutedEventHandler(ps_DeleteClick); ps.ModifyClick += new RoutedEventHandler(ps_ModifyClick); sp_Children.Children.Add(ps); if (!_controlName.Equals(_CurrentActivityInfo.ControlName)) { continue; } var pi = _CurrentActivityInfo.Param.Where(p => p.OrgFieldName.Equals(v.column_name)).GetFirst <ParamInfo>(); if (null == pi) { continue; } SetParameterSelectedValue(ps, pi); } _CurrentParamterSelected = sp_Children.Children[0] as ParameterSelected; }
void UpdateDesignPage() { string eventName = string.Format("{0}", CurrentApiSelector.Name); string controlName = string.Format("{0}", ct.SelectedControlInfo.Name); //-->保存操作。 _CurrentActivityInfo.ActivityName = this.ActivityName; _CurrentActivityInfo.ActivityType = this.ActivityType; _CurrentActivityInfo.ControlName = controlName; _CurrentActivityInfo.EventName = eventName; _CurrentActivityInfo.Description = CurrentApiSelector.Description; _CurrentActivityInfo.Param = new List <ParamInfo>(); foreach (var v in this.sp_Children.Children) { ParameterSelected select = v as ParameterSelected; if (null == select || null == select.ParamForamt) { continue; } _CurrentActivityInfo.Param.Add(select.ParamForamt); } if (0 <= _CurrentActivityInfoIndex) { _CurrentControlEventInfo.Item.RemoveAt(_CurrentActivityInfoIndex); } else { _CurrentActivityInfoIndex = 0; } _CurrentControlEventInfo.Item.Add(_CurrentActivityInfo); if (0 <= _CurrentControlEventIndex) { _XmlTemplate.EventLinkItem.RemoveAt(_CurrentControlEventIndex); } else { _CurrentControlEventIndex = 0; } _XmlTemplate.EventLinkItem.Add(_CurrentControlEventInfo); IDesignFramework.GetCurrentXmlTemplate().EventLinkItem = _XmlTemplate.EventLinkItem; IDesignFramework.UpdateCurrentTemplate(); }
void SetParameterSelectedValue(ParameterSelected ps, ParamInfo pi) { var _target_ci = IDesignFramework.GetControlInfoByControlName(pi.TargetCtrlName); if (null == _target_ci) { return; } var _target_mdi = IDesignFramework.GetMetaDataInfoByTableName(_target_ci.MetaData); if (null == _target_mdi) { return; } var _target_mdc = _target_mdi.Item.Where(p => p.column_name.Equals(pi.TargetFieldName)).GetFirst <MetaDataColumnInfo>(); if (null == _target_mdc) { return; } ps.InitLoadValue = pi; ps.Text = _target_mdc.column_comment; }