Пример #1
0
        /// <summary>
        /// Initialize the ServerOperation and ConnectionAdapter
        /// </summary>
        /// <returns></returns>
        public ServerOperationManager Init_ServerOperation(Logger log)
        {
            var connection_section = ConfigurationManager.GetSection("Connection") as NameValueCollection;

            foreach (var part in connection_section.AllKeys)
            {
                connection_data.Add(part, connection_section[part]);
            }

            ConnectionAdapter      ConnectionAdapter      = new ConnectionAdapter(connection_data["TfsCollection"], connection_data["TeamProjectName"], log);
            ServerOperationManager ServerOperationManager = new ServerOperationManager(ConnectionAdapter, connection_data["AreaPath"], connection_data["Iteration"], log);

            CurrentTfsCollectionName = connection_data["TfsCollection"];
            CurrentTeamProjectName   = connection_data["TeamProjectName"];

            return(ServerOperationManager);
        }
Пример #2
0
        /// <summary>
        /// ServerOperationManager constructor.
        /// </summary>
        /// <param name="conn">ConnectionAdapter calss parameter, whitch makes the connection with the server.</param>
        /// <param name="log">Custom logger class, for logging.</param>
        public ServerOperationManager(ConnectionAdapter conn, string AreaPath, string Iteration, Logger log)
        {
            this.AreaPath  = AreaPath;
            this.Iteration = Iteration;
            this.log       = log;

            if (conn != null)
            {
                this.conn = conn;
                log.Info("ServerOperationManager is Up!");
                log.Flush();
            }
            else
            {
                log.Error("ArgumentNullException in the ServerOperationManager class!");
                log.Flush();
                throw new ArgumentNullException(nameof(conn));
            }
        }