public string GetDataSourceString(object sourceItem, DataSourceProvideArgs args)
        {
            UIElement element = sourceItem as UIElement;

            if (element == null)
            {
                return(String.Empty);
            }
            return(UIElementDataSoure.Parse(element));
        }
 public string GetDataSourceString(object sourceItem, DataSourceProvideArgs args)
 {
     foreach (DataSource2 item in _systemDataSource)
     {
         if (item.SourceItem.Equals(sourceItem))
         {
             return(item.String);
         }
     }
     return(String.Empty);
 }
        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 string GetDisplayString(string dataSourceString, DataSourceProvideArgs args)
 {
     foreach (SystemDataSoure item in _systemDataSource)
     {
         if (item.SourceItem.Equals(dataSourceString))
         {
             return(_language.SystemDataSoureDisplayString + " " + item.Name);
         }
     }
     Debug.Assert(false, "GetDisplayString 没有找到对应的 DataSource");
     return(String.Empty);
 }
        public bool Validate(string dataSourceString, DataSourceProvideArgs args)
        {
            bool result = false;

            foreach (SystemDataSoure item in _systemDataSource)
            {
                if (item.SourceItem.Equals(dataSourceString))
                {
                    result = true;
                }
            }
            return(result);
        }
        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 string GetDataSourceString(object sourceItem, DataSourceProvideArgs args)
        {
            Debug.Assert(sourceItem != null, "sourceItem 为 null");
            if (sourceItem == null)
            {
                return(String.Empty);
            }
            string dataSourceString = String.Empty;

            foreach (IDataSourceProvide provide in _provides.Values)
            {
                dataSourceString = provide.GetDataSourceString(sourceItem, args);
                if (String.IsNullOrEmpty(dataSourceString) == false)
                {
                    continue;
                }
            }
            return(dataSourceString);
        }
        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 string GetDisplayString(string dataSourceString, DataSourceProvideArgs args)
        {
            if (DataSourceFormatValidate(dataSourceString) == false)
            {
                Debug.Assert(false, "dataSourceString 格式不对");
                return(String.Empty);
            }
            string[] strs = dataSourceString.Split(':');
            if (strs.Length != 2)
            {
                Debug.Assert(false, "dataSourceString 格式不对");
                return(String.Empty);
            }
            string             prefix           = strs[0];
            string             sourceString     = strs[1];
            IDataSourceProvide dataSoureProvide = GetDataSoureProvide(prefix);

            if (dataSoureProvide == null)
            {
                return(String.Empty);
            }
            return(dataSoureProvide.GetDisplayString(sourceString, args));
        }
 public string RestoreEditorString(string editorString, DataSourceProvideArgs args)
 {
     return(String.Empty);
 }
 public string GetEditorString(string dataSourceString, DataSourceProvideArgs args)
 {
     return(String.Empty);
 }
 public DataSourceCollection GetAvailableDataSource(DataSourceProvideArgs args)
 {
     return(_systemDataSource);
 }