예제 #1
0
        private TFSourceManager(XElement xConfig)
        {
            Contract.Requires(xConfig != null);


            // Read the config.xml file
            var xProtocol = xConfig.Element("protocol");
            var protocol  = xProtocol == null ? "http" : xProtocol.Value;
            var xServer   = xConfig.Element("server");
            var server    = xServer == null ? "localhost" : xServer.Value;
            var xPort     = xConfig.Element("port");
            var port      = xPort == null ? "8080" : xPort.Value;
            var xPath     = xConfig.Element("path");
            var path      = xPath == null ? "tfs" : xPath.Value;
            var xSubPath  = xConfig.Element("subpath");

            this.subPath = xSubPath == null ? "" : xSubPath.Value;

            // build the URL
            this.uri = String.Format("{0}://{1}:{2}/{3}", protocol, server, port, path);

            // Build the TFS objects
            // The TFS needs a window were to show some dialogs, in the case of
            this.tpc      = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(this.uri), new UICredentialsProvider(Program.TheMainForm));
            this.vcServer = tpc.GetService <VersionControlServer>();
            Contract.Assume(this.vcServer != null);

            // build the ID
            this.id = IDBuilder.FromUri("TF_", this.uri + '/' + this.subPath);
        }
예제 #2
0
        private HGSourceManager(XElement xConfig)
        {
            Contract.Requires(xConfig != null);

            var xProtocol = xConfig.Element("protocol");
            var protocol  = xProtocol == null ? "http" : xProtocol.Value;
            var xServer   = xConfig.Element("server");
            var server    = xServer == null ? "localhost" : xServer.Value;
            var xPort     = xConfig.Element("port");
            var port      = xPort == null ? null : xPort.Value;
            var xPath     = xConfig.Element("path");
            var path      = xPath == null ? "" : xPath.Value;

            var xBranch = xConfig.Element("branch");

            this.branch = xBranch == null ? "default" : xBranch.Value;

            this.uri = String.Format("{0}://{1}{2}/{3}", protocol, server, port == null ? "" : ":" + port, path);

            this.id = IDBuilder.FromUri("HG_", this.uri);
        }
예제 #3
0
        private SDSourceManager(XElement xConfig)
        {
            Contract.Requires(xConfig != null);

            var xSdPort = xConfig.Element("sdport");

            if (xSdPort == null)
            {
                throw new ArgumentNullException("sdport");
            }
            this.sdport = xSdPort.Value;
            var xSdClient = xConfig.Element("sdclient");

            if (xSdClient == null)
            {
                throw new ArgumentNullException("sdclient");
            }
            this.sdclient = xSdClient.Value;

            // todo? views

            this.id = IDBuilder.FromUri("SD_", this.sdport + '/' + this.sdclient);
        }