本文整理汇总了C#中Hl7.Fhir.Model.List.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# List.AddRange方法的具体用法?C# List.AddRange怎么用?C# List.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hl7.Fhir.Model.List
的用法示例。
在下文中一共展示了List.AddRange方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParametersToQuery
private IMongoQuery ParametersToQuery(IEnumerable<IParameter> parameters)
{
List<IMongoQuery> queries = new List<IMongoQuery>();
queries.Add(M.Query.EQ(InternalField.LEVEL, 0)); // geindexeerde contained documents overslaan
IEnumerable<IMongoQuery> q = parameters.Select(p => ParameterToQuery(p));
queries.AddRange(q);
return M.Query.And(queries);
}
示例2: Validate
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
foreach (var tag in Category)
result.AddRange(tag.Validate(validationContext));
return result;
}
示例3: Validate
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
result.AddRange(base.Validate(validationContext));
if (!result.Any()) result.Add(ValidationResult.Success);
return result;
}
示例4: Validate
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
result.AddRange(base.Validate(validationContext));
if (When == null)
result.Add(new ValidationResult("A DeletedEntry must have a non-null deletion time (When)"));
if (!result.Any()) result.Add(ValidationResult.Success);
return result;
}
示例5: SetTextTag
public static void SetTextTag(this BundleEntry entry, string text)
{
var result = new List<Tag>();
if (entry.Tags != null) result.AddRange(entry.Tags);
result.RemoveAll(t => Equals(t.Scheme,Tag.FHIRTAGSCHEME_GENERAL) &&
(t.Term != null && t.Term.StartsWith(TAG_TERM_TEXT)));
result.Add(new Tag(TAG_TERM_TEXT + Uri.EscapeUriString(text), Tag.FHIRTAGSCHEME_GENERAL, text));
entry.Tags = result;
}
示例6: Validate
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
result.AddRange(base.Validate(validationContext));
if (Content == null)
result.Add(new ValidationResult("Entry must contain (possibly 0-length) data in Content element"));
if (ContentType == null)
result.Add(new ValidationResult("Entry must contain a ContentType"));
return result;
}
示例7: GetFhirTags
public static List<Tag> GetFhirTags(this HttpHeaders headers)
{
IEnumerable<string> tagstrings;
List<Tag> tags = new List<Tag>();
if (headers.TryGetValues(FhirHeader.CATEGORY, out tagstrings))
{
foreach (string tagstring in tagstrings)
{
tags.AddRange(HttpUtil.ParseCategoryHeader(tagstring));
}
}
return tags;
}
示例8: Validate
public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
if (!Bundle.UriHasValue(Id))
result.Add(new ValidationResult("Entry must have an id"));
else
if (!Id.IsAbsoluteUri)
result.Add(new ValidationResult("Entry id must be an absolute URI"));
if (Bundle.UriHasValue(SelfLink) && !SelfLink.IsAbsoluteUri)
result.Add(new ValidationResult("Entry selflink must be an absolute URI"));
if (Links.FirstLink != null || Links.LastLink != null || Links.PreviousLink != null || Links.NextLink != null)
result.Add(new ValidationResult("Paging links can only be used on feeds, not entries"));
if (Tags != null)
result.AddRange(new TagList(Tags).Validate(validationContext));
return result;
}
示例9: Prepare
/// <summary>
/// Unpacks zip-files containing the artifact files, and enumerates all (zipped/nonzipped) files.
/// </summary>
/// <remarks>This is an expensive operations and should be run once. As well, it unpacks files on the
/// file system and is not thread-safe.</remarks>
public void Prepare()
{
#if !PORTABLE45
_artifactFiles = new List<string>();
var zips = Directory.GetFiles(_contentDirectory, "*.zip");
// Get the files in each *.zip files present in the content directory
// The ZipCacher will avoid re-extracting these files.
foreach (string zipPath in zips)
{
ZipCacher zc = new ZipCacher(zipPath, CACHE_KEY);
_artifactFiles.AddRange(zc.GetContents());
}
_isPrepared = true;
#else
throw Error.NotImplemented("File based Core artifact source is not supported on the portable runtime");
#endif
}
示例10: Merge
public static IEnumerable<Tag> Merge(this IEnumerable<Tag> tags, IEnumerable<Tag> that)
{
var result = new List<Tag>(tags.Remove(that));
result.AddRange(that);
return result;
}
示例11: GetTargetedReferenceTypes
private static List<string> GetTargetedReferenceTypes(ModelInfo.SearchParamDefinition parameter, String modifier)
{
var allowedResourceTypes = ModelInfo.SupportedResources; //TODO: restrict to parameter.ReferencedResources. This means not making this static, because you want to use IFhirModel.
List<string> searchResourceTypes = new List<string>();
if (String.IsNullOrEmpty(modifier))
searchResourceTypes.AddRange(allowedResourceTypes);
else if (allowedResourceTypes.Contains(modifier))
{
searchResourceTypes.Add(modifier);
}
else
{
throw new NotSupportedException(String.Format("Referenced type cannot be of type %s.", modifier));
}
return searchResourceTypes;
}
示例12: ListArtifactNames
public IEnumerable<string> ListArtifactNames()
{
var result = new List<string>();
foreach (var source in Sources)
{
try
{
result.AddRange(source.ListArtifactNames());
}
catch (NotImplementedException)
{
// Don't do anything, just try the next IArtifactSource
}
}
return result;
}
示例13: CloseCriterium
/// <summary>
/// CloseCriterium("patient.name=\"Teun\"") -> "patient=id1,id2"
/// </summary>
/// <param name="resourceType"></param>
/// <param name="crit"></param>
/// <returns></returns>
private Criterium CloseCriterium(Criterium crit, string resourceType)
{
List<string> targeted = crit.GetTargetedReferenceTypes(resourceType);
List<string> allKeys = new List<string>();
foreach (var target in targeted)
{
var keys = CollectKeys(target, new List<Criterium> { (Criterium)crit.Operand }); //Recursive call to CollectKeys!
allKeys.AddRange(keys.Select(k => k.ToString()));
}
crit.Type = Operator.IN;
crit.Operand = ChoiceValue.Parse(String.Join(",", allKeys));
return crit;
}
示例14: locateChildren
private static IEnumerable<Bookmark> locateChildren(BaseElementNavigator nav, IEnumerable<string> path, bool partial)
{
var child = path.First();
var rest = path.Skip(1);
var bm = nav.Bookmark();
if (nav.MoveToChild(child))
{
var result = new List<Bookmark>();
do
{
if (!rest.Any())
{
// Exact match!
result.Add(nav.Bookmark());
}
else if (!nav.HasChildren && partial)
{
// This is as far as we can get in this structure,
// so this is a hit too if partial hits are OK
result.Add(nav.Bookmark());
}
else
{
// So, no hit, but we have children that might fit the bill.
result.AddRange(locateChildren(nav, rest, partial));
}
// Try this for the other matching siblings too...
}
while (nav.MoveToNext(child));
// We've scanned all my children and collected the results,
// move the navigator back to where we were before
nav.ReturnToBookmark(bm);
return result;
}
else
return Enumerable.Empty<Bookmark>();
}
示例15: CloseCriterium
/// <summary>
/// CloseCriterium("patient.name=\"Teun\"") -> "patient IN (id1,id2)"
/// </summary>
/// <param name="resourceType"></param>
/// <param name="crit"></param>
/// <returns></returns>
private Criterium CloseCriterium(Criterium crit, string resourceType, int level)
{
List<string> targeted = crit.GetTargetedReferenceTypes(resourceType);
List<string> allKeys = new List<string>();
var errors = new List<Exception>();
foreach (var target in targeted)
{
try {
Criterium innerCriterium = (Criterium)crit.Operand;
var keys = CollectKeys(target, new List<Criterium> { innerCriterium }, ++level); //Recursive call to CollectKeys!
allKeys.AddRange(keys.Select(k => k.ToString()));
}
catch (Exception ex)
{
errors.Add(ex);
}
}
if (errors.Count == targeted.Count())
{
//It is possible that some of the targets don't support the current parameter. But if none do, there is a serious problem.
throw new ArgumentException(String.Format("None of the possible target resources support querying for parameter {0}", crit.ParamName));
}
crit.Operator = Operator.IN;
crit.Operand = ChoiceValue.Parse(String.Join(",", allKeys));
return crit;
}