/// <summary> /// Finds all nested items under a parent group and creates new WixGroup data for them. /// </summary> /// <param name="parentType">The group type for the parent group to flatten.</param> /// <param name="parentId">The identifier of the parent group to flatten.</param> /// <param name="removeUsedRows">Whether to remove used group rows before returning.</param> public void FlattenAndRewriteRows(ComplexReferenceChildType parentType, string parentId, bool removeUsedRows) { var parentTypeString = parentType.ToString(); Debug.Assert(this.groupTypes.Contains(parentTypeString)); this.CreateOrderedList(parentTypeString, parentId, out var orderedItems); if (this.Messaging.EncounteredError) { return; } this.CreateNewGroupRows(parentTypeString, parentId, orderedItems); if (removeUsedRows) { this.RemoveUsedGroupRows(); } }
// TODO: Should we define our own enum for this, just to ensure there's no "cross-contamination"? // TODO: Also, we could potentially include an 'Attributes' field to track things like // 'before' vs. 'after', and explicit vs. inferred dependencies. private void CreateWixOrderingRow(SourceLineNumberCollection sourceLineNumbers, ComplexReferenceChildType itemType, string itemId, ComplexReferenceChildType dependsOnType, string dependsOnId) { if (!this.core.EncounteredError) { Row row = this.core.CreateRow(sourceLineNumbers, "WixOrdering"); row[0] = itemType.ToString(); row[1] = itemId; row[2] = dependsOnType.ToString(); row[3] = dependsOnId; } }
private string CombineTypeAndId(ComplexReferenceChildType type, string id) { return String.Format("{0}:{1}", type.ToString(), id); }