Skip to content

Commit

Permalink
Removed visibility null constraint in order to be more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiser-san committed Nov 23, 2017
1 parent d52f4e7 commit 91d5b43
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions Xbim.BCF/XMLNodes/BCFComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ public bool ShouldSerializeSelection()
public BCFComponentVisibility Visibility
{
get { return _visibility; }
set
{
if (ReferenceEquals(value, null))
{
throw new ArgumentException(this.GetType().Name + " - Visibility is mandatory");
}
else
{
_visibility = value;
}
}
set { _visibility = value; }
}
public bool ShouldSerializeVisibility()
{
return Visibility != null;
}

[XmlArray(ElementName = "Coloring", Order = 4)]
Expand Down Expand Up @@ -79,7 +73,7 @@ public BCFComponents(XElement node, string version)
var selection = node.Element("Selection");
Selection = selection != null ? new BCFComponentSelection(selection, version) : null;
var visibility = node.Element("Visibility");
Visibility = new BCFComponentVisibility(visibility, version);
Visibility = visibility != null ? new BCFComponentVisibility(visibility, version) : null;
var coloring = node.Element("Coloring");
if (coloring != null)
Colorings = new List<BCFComponentColoringColor>(coloring.Elements("Color").Select(c => new BCFComponentColoringColor(c.Attribute("Color")?.Value)));
Expand Down

0 comments on commit 91d5b43

Please sign in to comment.