internal static ISBaseFlatFileConnectionManager GetConnectionManager(string connectionManagerName, ISProject ssisProject = null, ISPackage ssisPackage = null)
        {
            ISBaseFlatFileConnectionManager connMgr = null;

            if (ssisProject != null)
            {
                foreach (ConnectionManagerItem cmi in ssisProject.ConnectionManagerItems_m)
                {
                    if (cmi.ConnectionManager.Name == connectionManagerName)
                    {
                        connMgr = (ISBaseFlatFileConnectionManager)cmi.ConnectionManager;
                    }
                }
            }

            return(connMgr);
        }
        /// <summary>
        /// ctor that accepts the parent flat file connection manager and a name for the flat file column
        /// </summary>
        /// <param name="fileConnection"></param>
        /// <param name="name"></param>
        public ISFlatFileColumn(ISBaseFlatFileConnectionManager fileConnection, string name)
        {
            bool exists = false;

            _parentConnectionManager = fileConnection;
            foreach (runTimeWrapper.IDTSConnectionManagerFlatFileColumn100 column in fileConnection.Columns_m)
            {
                if (((runTimeWrapper.IDTSName100)column).Name == name)
                {
                    exists         = true;
                    FlatFileColumn = column;
                }
            }
            if (!(exists))
            {
                FlatFileColumn = fileConnection.Columns_m.Add();
                Name           = name;
            }
        }
 /// <summary>
 /// Extended ctor that also accepts whether the column is hte last column or not.
 /// </summary>
 /// <param name="fileConnection"></param>
 /// <param name="name"></param>
 /// <param name="isLastColumnInFile"></param>
 public ISFlatFileColumn(ISBaseFlatFileConnectionManager fileConnection, string name, bool isLastColumnInFile) :
     this(fileConnection, name)
 {
     IsLastColumnInCollection = isLastColumnInFile;
 }