public GenSegBody(GenContainerFragmentBase parentSegment, GenContainerFragmentBase parentContainer) { _fragment = new List <GenFragment>(); _secondaryFragment = new List <GenFragment>(); ParentSegment = parentSegment; ParentContainer = parentContainer; }
/// <summary> /// Parameters for creating a GenFragment /// </summary> /// <param name="genDataDef">The definition of the data being generated.</param> /// <param name="parentContainer">The container fragment conataining this fragment.</param> /// <param name="isPrimary">Is this fragmnent in the primary body?</param> public GenFragmentParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, bool isPrimary = true) { Contract.Requires(parentContainer != null && parentContainer != null); GenDataDef = genDataDef; ParentContainer = parentContainer; Container = ParentContainer == null ? null : (ContainerFragment)ParentContainer.Fragment; IsPrimary = isPrimary; }
public GenLookupParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, string condition, bool isPrimary = true) : base(genDataDef, parentContainer, FragmentType.Lookup, isPrimary: isPrimary) { var sa = condition.Split('='); Var1 = GenDataDef.GetId(sa[0]); Var2 = GenDataDef.GetId(sa[1]); }
/// <summary> /// Create a new <see cref="GenFragment" /> object. /// </summary> /// <param name="genFragmentParams">Data need to create the fragment object</param> protected GenFragment(GenFragmentParams genFragmentParams) { GenDataDef = genFragmentParams.GenDataDef; ParentContainer = genFragmentParams.ParentContainer; FragmentType = genFragmentParams.FragmentType; Fragment = genFragmentParams.Fragment; Contract.Assert(Fragment != null, "The fragment was not set up"); }
public GenConditionParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, ConditionParameters conditionParameters, bool isPrimary = true) : base(genDataDef, parentContainer, FragmentType.Condition, isPrimary: isPrimary) { Var1 = conditionParameters.Var1; Var2 = conditionParameters.Var2; GenComparison = conditionParameters.GenComparison; UseLit = conditionParameters.UseLit; Lit = conditionParameters.Lit; }
/// <summary> /// Parameters for creating a GenFragment /// </summary> /// <param name="genDataDef">The definition of the data being generated.</param> /// <param name="parentContainer">The container fragment conataining this fragment.</param> /// <param name="fragmentType">The type of fragment.</param> /// <param name="isPrimary">Is this fragmnent in the primary body?</param> public GenFragmentParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, FragmentType fragmentType, bool isPrimary = true) { Contract.Requires(parentContainer != null); Contract.Ensures(fragmentType == FragmentType.Profile || Fragment != null); GenDataDef = genDataDef; ParentContainer = parentContainer; Container = ParentContainer == null ? null : (ContainerFragment)ParentContainer.Fragment; IsPrimary = isPrimary; SetFragmentType(fragmentType); }
public GenFunctionParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, string functionName, bool isPrimary = true) : base(genDataDef, parentContainer, isPrimary: isPrimary) { FunctionName = functionName; }
/// <summary> /// Parameters for creating a GenFragment /// </summary> /// <param name="genDataDef">The definition of the data being generated.</param> /// <param name="parentContainer">The container fragment conataining this fragment.</param> /// <param name="text">The text to be generated.</param> /// <param name="isPrimary">The fragment is part of the primary part of the body.</param> public GenTextFragmentParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, string text, bool isPrimary = true) : base(genDataDef, parentContainer, FragmentType.Text, isPrimary: isPrimary) { ((Text)Fragment).TextValue = text; }
public GenPlaceholderFragmentParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, GenDataId id, bool isPrimary = true) : base(genDataDef, parentContainer, FragmentType.Placeholder, isPrimary: isPrimary) { Id = id; }
public override GenSegment ParseSegmentHeading(GenDataDef genDataDef, string segmentClass, GenContainerFragmentBase parentContainer, bool isPrimary) { var s = segmentClass.Substring(segmentClass.Length - 1); var c = segmentClass; var cardinality = GenCardinality.All; for (var i = 0; i < ActiveProfileFragmentSyntaxDictionary.GenCardinalityText.Length; i++) { var x = ActiveProfileFragmentSyntaxDictionary.GenCardinalityText[i]; if (s == x) { cardinality = (GenCardinality)i; c = segmentClass.Substring(0, segmentClass.Length - 1); break; } } return(new GenSegment(new GenSegmentParams(genDataDef, parentContainer, c, cardinality, isPrimary: isPrimary))); }
/// <summary> /// Parses the segment class text and returns an empty segment profile fragment /// </summary> /// <param name="genDataDef">The generator data definition.</param> /// <param name="segmentClass">The segment class text to be parsed.</param> /// <param name="parentContainer"></param> /// <param name="isPrimary"></param> /// <returns></returns> public abstract GenSegment ParseSegmentHeading(GenDataDef genDataDef, string segmentClass, GenContainerFragmentBase parentContainer, bool isPrimary);
public GenSegmentParams(GenDataDef genDataDef, GenContainerFragmentBase parentContainer, string className, GenCardinality cardinality, bool isPrimary = true) : base(genDataDef, parentContainer, isPrimary: isPrimary) { _className = className; _cardinality = cardinality; }