示例#1
0
        public void AfterConnectPlugins()
        {
            // Get all types that implement the IAfterConnectSupport interface
            var types = Manager.ConnectionManager.GetIAfterConnectSupportTypes();

            // Filter the current active type out.
            // e.g.
            // HTTP connection might have an AutoIt connection afterwards
            // AutoIt connection can't have AutoIt afterwards -> avoiding recursion
            types = (from type in types
                     where this.GetType().FullName != type.FullName
                     select type).ToList <Type>();

            foreach (Type type in types)
            {
                FavoriteConfigurationElement favoriteCopy = (FavoriteConfigurationElement)Favorite.Clone();

                Connection conn = Manager.ConnectionManager.GetConnection(Manager.ConnectionManager.GetProtocolName(type));
                ((IAfterConnectSupport)conn).IsInAfterConnectMode = true;
                conn.Favorite        = favoriteCopy;
                conn.TerminalTabPage = this.TerminalTabPage;

                if (((IAfterConnectSupport)conn).IsAfterConnectEnabled)
                {
                    Manager.ConnectionManager.CreateConnection(Favorite, this.ParentForm, false, TerminalTabPage, conn);
                }
            }
        }