/// <summary> /// Gets the or create border. /// </summary> /// <param name="index">The index.</param> /// <param name="source">The source.</param> /// <param name="target">The target.</param> /// <returns></returns> private static uint GetOrCreateBorder(uint index, Stylesheet source, Stylesheet target) { var child = SafeIndex <Borders, Border>(source.Borders, (int)index); if (child == null) { return(0); } uint id = 0; if (target.TryMatchBorder(child, out id)) { return(id); } return(target.AddBorder(child)); }