예제 #1
0
 /// <summary>
 /// Initializes a new atomic trait.
 /// </summary>
 internal CKTrait(CKTraitContext ctx, string atomicTrait)
 {
     Debug.Assert(atomicTrait.Contains(ctx.Separator) == false);
     _context = ctx;
     _trait   = atomicTrait;
     _traits  = new CKTrait[] { this };
 }
예제 #2
0
 /// <summary>
 /// Initializes the new empty trait of a CKTraitContext.
 /// </summary>
 internal CKTrait(CKTraitContext ctx)
 {
     Debug.Assert(ctx.EmptyTrait == null, "There is only one empty trait per context.");
     _context = ctx;
     _trait   = String.Empty;
     _traits  = Util.Array.Empty <CKTrait>();
 }
예제 #3
0
 /// <summary>
 /// Initializes a new atomic tag.
 /// </summary>
 internal CKTrait(CKTraitContext ctx, string atomicTag)
 {
     Debug.Assert(atomicTag.Contains(ctx.Separator) == false);
     _context = ctx;
     _tag     = atomicTag;
     _tags    = new CKTrait[] { this };
 }
예제 #4
0
 /// <summary>
 /// Initializes a new combined trait.
 /// </summary>
 internal CKTrait(CKTraitContext ctx, string combinedTrait, IReadOnlyList <CKTrait> traits)
 {
     Debug.Assert(combinedTrait.IndexOf(ctx.Separator) > 0 && traits.Count > 1, "There is more than one trait in a Combined Trait.");
     Debug.Assert(traits.All(m => m.IsAtomic), "Provided traits are all atomic.");
     Debug.Assert(traits.GroupBy(m => m).Where(g => g.Count() != 1).Count() == 0, "No duplicate in atomic in traits.");
     _context = ctx;
     _trait   = combinedTrait;
     _traits  = traits;
 }
예제 #5
0
 static Tags()
 {
     Context                 = new CKTraitContext("ActivityMonitor");
     Empty                   = Context.EmptyTrait;
     UserConclusion          = Context.FindOrCreate("c:User");
     GetTextConclusion       = Context.FindOrCreate("c:GetText");
     MonitorTopicChanged     = Context.FindOrCreate("MonitorTopicChanged");
     CreateDependentActivity = Context.FindOrCreate("dep:CreateActivity");
     StartDependentActivity  = Context.FindOrCreate("dep:StartActivity");
 }
예제 #6
0
 ArtifactType(string name, bool installable, char savorSeparator)
 {
     Name          = name;
     IsInstallable = installable;
     ContextSavors = savorSeparator == 0 ? null : CKTraitContext.Create("ArtifactType:" + name, savorSeparator);
 }