public bool Validate(string dataSourceString, DataSourceProvideArgs args)
        {
            if (args == null || args.WindowEntity == null)
            {
                Debug.Assert(false, "args.WindowEntity 为空");
                return(false);
            }
            WindowEntity window = args.WindowEntity;

            return(window.FindFormElementById(dataSourceString) != null);
        }
        public override void FromXml(string strXml)
        {
            base.FromXml(strXml);
            SEXElement xmlDoc = SEXElement.Parse(strXml);

            this.TargetWindow           = (EnumCallUIElementMethodTargetForm)xmlDoc.GetInnerObject <int>("/TargetWindow", 0);
            this.FormElement            = xmlDoc.GetInnerObject("/FormElement");
            this.FormElementControlType = UIElementEntityTypes.Instance.GetProvideAttribute(xmlDoc.GetInnerObject <int>("/FormElementControlType", -1));
            this.Event     = EventTypes.Instance.GetProvideAttribute(xmlDoc.GetInnerObject <int>("/EventCode", -1));
            this.CallEvent = this.EventTypesAdapter.CreateInstance(
                Convert.ToInt32(xmlDoc.SelectSingleNode("/Event").Attribute("EventCode").Value));
            this.CallEvent.FromXml(xmlDoc.SelectSingleNode("/Event").ToString());
            this.CallEvent.HostFormEntity = this.HostFormEntity;
        }
        public string GetDisplayString(string dataSourceString, DataSourceProvideArgs args)
        {
            if (args == null || args.WindowEntity == null)
            {
                Debug.Assert(false, "args.WindowEntity 为空");
                return(String.Empty);
            }
            WindowEntity window  = args.WindowEntity;
            UIElement    element = window.FindFormElementById(dataSourceString);

            if (element != null)
            {
                return(_language.UIElementDataSoureDisplayString + " " + element.FullName);
            }
            else
            {
                return(String.Empty);
            }
        }
        public DataSourceCollection GetAvailableDataSource(DataSourceProvideArgs args)
        {
            DataSourceCollection collection = new DataSourceCollection();

            if (args == null || args.WindowEntity == null)
            {
                Debug.Assert(false, "args.WindowEntity 为空");
                return(collection);
            }
            WindowEntity window = args.WindowEntity;

            foreach (var item in window.GetFormElement())
            {
                if (item.DataSourceUseable)
                {
                    UIElementDataSoure dataSource = new UIElementDataSoure(item);
                    collection.Add(dataSource);
                }
            }
            return(collection);
        }
 public void Remove(WindowEntity value)
 {
     List.Remove(value);
 }
 public void Insert(int index, WindowEntity value)
 {
     List.Insert(index, value);
 }
 public int IndexOf(WindowEntity value)
 {
     return(List.IndexOf(value));
 }
 public bool Contains(WindowEntity value)
 {
     return(List.Contains(value));
 }
 public int Add(WindowEntity value)
 {
     return(List.Add(value));
 }
示例#10
0
 public UIElementCollection(WindowEntity hostFormEntity)
 {
     this._hostFormEntity = hostFormEntity;
 }
 public EventCollection(WindowEntity formEntity, EntityBase hostEntity)
 {
     this._hostFormEntity = formEntity;
     this._hostEntity     = hostEntity;
 }