public IList <ContractDeliverableCodeMapping> GetContractDeliverableCodeMapping(
            IList <string> deliverableCodes,
            CancellationToken cancellationToken)
        {
            var uncached = deliverableCodes.Where(deliverableCode => CodeMappings.All(x => x.ExternalDeliverableCode != deliverableCode)).ToList();

            if (uncached.Any())
            {
                CodeMappings.AddRange(_referenceDataRepository.GetContractDeliverableCodeMapping(uncached, cancellationToken));
            }

            return(CodeMappings);
        }
Ejemplo n.º 2
0
        public void PopulateContractDeliverableCodeMappings(IEnumerable <FcsDeliverableCodeMapping> mappings)
        {
            foreach (var mapping in mappings)
            {
                if (CodeMappings.Any(cm =>
                                     cm.FundingStreamPeriodCode.CaseInsensitiveEquals(mapping.FundingStreamPeriodCode) &&
                                     cm.ExternalDeliverableCode.CaseInsensitiveEquals(mapping.ExternalDeliverableCode)))
                {
                    continue;
                }

                CodeMappings.Add(mapping);
            }
        }
Ejemplo n.º 3
0
        public IEnumerable <FcsDeliverableCodeMapping> GetContractDeliverableCodeMapping(
            IEnumerable <string> deliverableCodes,
            CancellationToken cancellationToken)
        {
            var uncached = deliverableCodes
                           .Where(deliverableCode => CodeMappings
                                  .All(x => !x.ExternalDeliverableCode.CaseInsensitiveEquals(deliverableCode)))
                           .ToList();

            if (!uncached.Any())
            {
                return(CodeMappings);
            }

            PopulateContractDeliverableCodeMappings(uncached, cancellationToken);

            return(CodeMappings);
        }
Ejemplo n.º 4
0
 void AddCodeMappings(ITextEditorUIContext uiContext, AvalonEditTextOutput output)
 {
     if (output == null)
         return;
     var cm = new CodeMappings(output.DebuggerMemberMappings);
     uiContext.AddOutputData(CodeMappingsConstants.CodeMappingsKey, cm);
 }
Ejemplo n.º 5
0
		void AddCodeMappings(ITextEditorUIContext uiContext, AvalonEditTextOutput output) {
			if (output == null)
				return;
			var cm = new CodeMappings(output.DebuggerMemberMappings, serializedDnModuleCreator);
			uiContext.AddOutputData(CodeMappingsKey, cm);
		}
Ejemplo n.º 6
0
		public static bool VerifyAndGetCurrentDebuggedMethod(ITextEditorUIContext uiContext, SerializedDnToken serToken, out CodeMappings codeMappings) {
			codeMappings = uiContext.GetCodeMappings();
			return codeMappings.TryGetMapping(serToken) != null;
		}