Skip to content

Commit

Permalink
Merge pull request #161 from solarwinds/VT/bugfix_160
Browse files Browse the repository at this point in the history
Fixed update CRUD dialog
  • Loading branch information
nothrow committed Dec 21, 2018
2 parents 8d882be + b5aeb72 commit 77501ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Src/SwqlStudio/CrudProperty.cs
Expand Up @@ -5,10 +5,12 @@ namespace SwqlStudio
{
public class CrudProperty
{
public bool UseInPropertyBag { get; }
private readonly Property _property;

public CrudProperty(Property property)
public CrudProperty(Property property, bool useInPropertyBag = true)
{
UseInPropertyBag = useInPropertyBag;
_property = property;
}

Expand Down
6 changes: 3 additions & 3 deletions Src/SwqlStudio/CrudTab.cs
Expand Up @@ -46,12 +46,12 @@ private void BindProperties()
createProperties = false;
goto case CrudOperation.Update;
case CrudOperation.Update:
crudPropertyBindingSource.Add(new CrudProperty(new Property()
crudPropertyBindingSource.Add(new CrudProperty(new Property
{
IsKey = true,
Name = SwisUri,
Type = typeof(string).Name
}));
}, false));
break;
default:
throw new ArgumentOutOfRangeException();
Expand Down Expand Up @@ -116,7 +116,7 @@ private PropertyBag CreatePropertyBag()
var rv = new PropertyBag();
foreach (CrudProperty property in crudPropertyBindingSource)
{
if (!string.IsNullOrEmpty(property.Value))
if (property.UseInPropertyBag && !string.IsNullOrEmpty(property.Value))
{
rv[property.Name] = property.Value;
}
Expand Down

0 comments on commit 77501ba

Please sign in to comment.