Example #1
0
        // Many
        #region "Batch->FromDynamic()"
        /// <summary>
        /// Batch->FromDynamic() --> Imports collection(s) given by a file name.
        /// </summary>
        /// <param name="filename">Represents the file name from where the collection(s) will be imported.</param>
        /// <returns>Returns a ITisCollectionData array if successful, otherwise null.</returns>
        /// <example><code>ITisCollectionData[] collDatas = b.FromDynamic(@"c:\temp\test.dynamic");</code></example>
        public ITisCollectionData[] FromDynamic(string filename)
        {
            List <ITisCollectionData> result = new List <ITisCollectionData>();

            if (filename != String.Empty && File.Exists(filename))
            {
                if (CheckLogon())
                {
                    Batch.CoreFromDynamic(ref result, ref oCSM, filename);
                }
                else
                if (oCSM != null)
                {
                    oCSM.Logger.RequestMessageLog(Constants.cStrLiteSdkBatch + Constants.cStrFromDynamicMethod + Constants.cStrCouldNotLogin, Constants.cStrLiteSdk,
                                                  Log.Severity.ERROR, 0, 0);
                }
                else
                {
                    throw new Exception(Constants.cStrLiteSdkBatch + Constants.cStrFromDynamicMethod + Constants.cStrCouldNotLogin);
                }
            }
            else
            if (oCSM != null)
            {
                oCSM.Logger.RequestMessageLog(Constants.cStrLiteSdkBatch + Constants.cStrFromDynamicMethod + Constants.cStrFileNameNotFound + filename + "']",
                                              Constants.cStrLiteSdk, Log.Severity.ERROR, 0, 0);
            }

            return(result.ToArray());
        }