Microsoft.TeamFoundation.VersionControl.Client.RepositoryService.CheckIn C# (CSharp) Method

CheckIn() private method

private CheckIn ( Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace, List changes, string comment, WorkItemCheckinAction>.Dictionary workItems ) : CheckInResult
workspace Microsoft.TeamFoundation.VersionControl.Client.Workspace
changes List
comment string
workItems WorkItemCheckinAction>.Dictionary
return Microsoft.TeamFoundation.VersionControl.Client.Objects.CheckInResult
        internal CheckInResult CheckIn(Workspace workspace, List<PendingChange> changes, string comment, Dictionary<int, WorkItemCheckinAction> workItems)
        {
            var invoker = new SoapInvoker(this);
            var msg = invoker.CreateEnvelope("CheckIn");
            msg.Add(new XElement(MessageNs + "workspaceName", workspace.Name));
            msg.Add(new XElement(MessageNs + "ownerName", workspace.OwnerName));
            msg.Add(new XElement(MessageNs + "serverItems", changes.Select(x => x.ServerItem).Distinct().Select(s => new XElement(MessageNs + "string", s))));
            msg.Add(new XElement(MessageNs + "info",
                new XAttribute("date", new DateTime(0).ToString("s")),
                new XAttribute("cset", 0),
                new XAttribute("owner", workspace.OwnerName),
                new XElement(MessageNs + "Comment", comment),
                new XElement(MessageNs + "CheckinNote", string.Empty),
                new XElement(MessageNs + "PolicyOverride", string.Empty)));

            if (workItems != null && workItems.Count > 0)
            {
                msg.Add(new XElement(MessageNs + "checkinNotificationInfo",
                    new XElement(MessageNs + "WorkItemInfo",
                        workItems.Select(wi => new XElement(MessageNs + "CheckinNotificationWorkItemInfo", 
                            new XElement(MessageNs + "Id", wi.Key), 
                            new XElement(MessageNs + "CheckinAction", wi.Value))))));
            }
            var response = invoker.InvokeResponse();
            var resultElement = invoker.MethodResultExtractor(response);

            var result = CheckInResult.FromXml(resultElement);
            result.Failures = FailuresExtractor(response);
            return result;
        }