public static Dictionary <string, string> GetImportAdapters(Target importTo, string sourceName)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            DataRow[] importerList = TransferContainer.Instance().GetImporterList(sourceName, importTo.Name);
            if ((importerList != null) && (importerList.Length != 0))
            {
                string str   = null;
                int    index = 0;
                do
                {
                    Version version = new Version(importerList[index]["importToVersion"].ToString());
                    if (version <= importTo.Version)
                    {
                        str = importerList[index]["importToVersion"].ToString();
                    }
                    index++;
                }while (string.IsNullOrEmpty(str) && (index < importerList.Length));
                if (string.IsNullOrEmpty(str))
                {
                    return(dictionary);
                }
                foreach (DataRow row in importerList)
                {
                    if (row["importToVersion"].ToString().Equals(str))
                    {
                        dictionary.Add(row["fullName"].ToString(), row["sourceName"].ToString() + row["sourceVersion"].ToString());
                    }
                }
            }
            return(dictionary);
        }
Example #2
0
        public static Dictionary <string, string> GetImportAdapters(Target importTo, string sourceName)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            DataRow[] importerList = TransferContainer.Instance().GetImporterList(sourceName, importTo.Name);
            if (importerList != null && importerList.Length != 0)
            {
                string value = null;
                int    num   = 0;
                do
                {
                    Version v = new Version(importerList[num]["importToVersion"].ToString());
                    if (v <= importTo.Version)
                    {
                        value = importerList[num]["importToVersion"].ToString();
                    }
                    num++;
                }while (string.IsNullOrEmpty(value) && num < importerList.Length);
                if (!string.IsNullOrEmpty(value))
                {
                    DataRow[] array = importerList;
                    foreach (DataRow dataRow in array)
                    {
                        string text = dataRow["importToVersion"].ToString();
                        if (text.Equals(value))
                        {
                            dictionary.Add(dataRow["fullName"].ToString(), dataRow["sourceName"].ToString() + dataRow["sourceVersion"].ToString());
                        }
                    }
                }
                return(dictionary);
            }
            return(dictionary);
        }
Example #3
0
        public static ExportAdapter GetExporter(string fullName, params object[] exportParams)
        {
            if (string.IsNullOrEmpty(fullName))
            {
                return(null);
            }
            Type exporter = TransferContainer.Instance().GetExporter(fullName);

            if (exporter == null)
            {
                return(null);
            }
            if (exportParams != null && exportParams.Length > 0)
            {
                return(Activator.CreateInstance(exporter, exportParams) as ExportAdapter);
            }
            return(Activator.CreateInstance(exporter) as ExportAdapter);
        }
Example #4
0
        public static Dictionary <string, string> GetExportAdapters(Target source, string exportToName)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            DataRow[] exporterList = TransferContainer.Instance().GetExporterList(source.Name, exportToName);
            if (exporterList != null && exporterList.Length != 0)
            {
                string value = null;
                int    num   = 0;
                do
                {
                    Version v = new Version(exporterList[num]["sourceVersion"].ToString());
                    if (v <= source.Version)
                    {
                        value = exporterList[num]["sourceVersion"].ToString();
                    }
                    num++;
                    if (!string.IsNullOrEmpty(value))
                    {
                        break;
                    }
                }while (num < exporterList.Length);
                if (!string.IsNullOrEmpty(value))
                {
                    DataRow[] array = exporterList;
                    for (int i = 0; i < array.Length; i++)
                    {
                        DataRow dataRow = array[i];
                        string  text    = dataRow["sourceVersion"].ToString();
                        if (text.Equals(value))
                        {
                            dictionary.Add(dataRow["fullName"].ToString(), dataRow["exportToName"].ToString() + dataRow["exportToVersion"].ToString());
                        }
                    }
                }
                return(dictionary);
            }
            return(dictionary);
        }