Пример #1
0
            public IAsyncCollector <Models.Assignment> Convert(AssignmentAttribute attribute)
            {
                string baseServiceUriString = Environment.GetEnvironmentVariable(attribute.ServiceUrlEnvironmentVariable);

                if (string.IsNullOrEmpty(baseServiceUriString))
                {
                    throw new ArgumentException("Assignment service URL was not provided.");
                }

                AssignmentsClient assignmentsClient = _assignmentClientFactory.CreateClient(baseServiceUriString);

                return(new AssignmentsCollector(assignmentsClient));
            }
        private Task <Models.Assignment> ConvertToAssignment(AssignmentAttribute attribute, ValueBindingContext context)
        {
            string baseServiceUriString = Environment.GetEnvironmentVariable(attribute.ServiceUrlEnvironmentVariable);

            if (string.IsNullOrEmpty(baseServiceUriString))
            {
                throw new ArgumentException("Assignment service URL was not provided.");
            }

            AssignmentsClient assignmentsClient = _assignmentClientFactory.CreateClient(baseServiceUriString);

            return(assignmentsClient.GetAssignment(attribute.AssignmentId));
        }
Пример #3
0
 private AvailableTask Build(AssignmentAttribute attribute)
 {
     TenroxTask task = new TenroxTask(attribute.AssignmentName, attribute.AssignmentUid);
     TenroxClient client = new TenroxClient(attribute.ClientName, attribute.ClientUid);
     return new AvailableTask(task, client);
 }
Пример #4
0
 public AvailableTaskBuilder(AssignmentAttribute[] timesheetAssignmentAttributes)
 {
     if (timesheetAssignmentAttributes == null) throw new ArgumentNullException("timesheetAssignmentAttributes");
     _timesheetAssignmentAttributes = timesheetAssignmentAttributes;
 }