public override void SetParameter(EventBase even) { CallUIElementMethodDev _event = even as CallUIElementMethodDev; this.txtName.Text = _event.Name; this.txtCode.Text = _event.Code; this.ddlObjectForm.SelectedValue = (int)_event.TargetWindow; if (_event.TargetWindow == CallUIElementMethodEvent.EnumCallUIElementMethodTargetForm.Current) { //先把选择的项置为null //因为,当指定的窗体元素不存在时,在编辑面板上选个窗体元素,不保存,再打开编辑功能,上次的选择还存在着。 this.ddlFormElement.SelectedItem = null; foreach (object obj in this.ddlFormElement.Items) { UIElement entity = obj as UIElement; if (entity.Id == _event.FormElement) { this.ddlFormElement.SelectedItem = entity; break; } } } else { txtFormElement.Text = _event.FormElement; //调入可用事件列表 ICallEntityMethodSupport formElementEntityDev = FormElementEntityDevTypes.Instance.CreateInstance(_event.FormElementControlType) as ICallEntityMethodSupport; if (formElementEntityDev != null) { InitAvailabilityMethod(formElementEntityDev, CallUIElementMethodEvent.EnumCallUIElementMethodTargetForm.Caller); } } this.availabilityEvent.SelectedValueChanged -= new EventHandler <SEComboSelector2.OnSelectedValueChangedEventArgs>(availabilityEvent_SelectedValueChanged); //选择对应的动作 //注意的是,availabilityMethod 是有可能为 null的,如果是当前窗体,但指定的窗体元素已不存在 //就没有办法拿到 availabilityMethod 此时availabilityMethod 为null if (_availabilityMethod != null) { availabilityEvent.SetSelectedValue(_availabilityMethod.GetProvideAttribute(_event.CallEvent)); //this.SelectedEvent = _event.CallEvent; //LoadMethodPlan(); } this.availabilityEvent.SelectedValueChanged += new EventHandler <SEComboSelector2.OnSelectedValueChangedEventArgs>(availabilityEvent_SelectedValueChanged); this.SelectedEvent = _event.CallEvent; IEventEditorSupport eventParameterSet = this.SelectedEvent as IEventEditorSupport; if (eventParameterSet != null) { LoadMethodPlan(); eventParameterSet.EditorAdapter.BeginEdit(); } }
public static void CheckWarning(CallUIElementMethodDev entity) { entity.Warning.Clear(); IWarningable callEventWarningable = entity.CallEvent as IWarningable; if (callEventWarningable != null) { callEventWarningable.CheckWarning(); if (callEventWarningable.Warning.ExistWarning) { entity.Warning.AddWarningSign(callEventWarningable.Warning.Warnings); } } }