Skip to content

Commit

Permalink
Fixed error when trying to add references without Drawing View Name i…
Browse files Browse the repository at this point in the history
…n the view label
  • Loading branch information
bretleasure committed Feb 13, 2024
1 parent fa5c039 commit 99338b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Extensions/DrawingViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ internal static bool ViewHasReferences(this DrawingView view)

internal static bool ShouldAddReferences(this DrawingView view, ViewReferenceSettings settings)
{
return view.ViewType switch
var shouldAddToViewType = view.ViewType switch
{
DrawingViewTypeEnum.kDetailDrawingViewType => settings.AddReferencesToDetailViews,
DrawingViewTypeEnum.kSectionDrawingViewType => settings.AddReferencesToSectionViews,
DrawingViewTypeEnum.kAuxiliaryDrawingViewType => settings.AddReferencesToAuxiliaryViews,
DrawingViewTypeEnum.kProjectedDrawingViewType => settings.AddReferencesToProjectedViews,
_ => false
};

var labelContainsDrawingViewName = view.Label.FormattedText.Contains("<DrawingViewName/>");

return shouldAddToViewType && labelContainsDrawingViewName;
}

internal static string GetReferenceLabelStyle(this DrawingView view, ViewReferenceSettings settings)
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
next-version: 5.1.0
next-version: 5.2.0

0 comments on commit 99338b2

Please sign in to comment.