Skip to content

Commit 8b39944

Browse files
committed
Set added component status to Added instead of Unchanged
1 parent f916e83 commit 8b39944

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

RetailCoder.VBE/App.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ async void sink_ComponentAdded(object sender, DispatcherEventArgs<VBComponent> e
351351
return;
352352
}
353353

354+
_panelVM.AddComponent(e.Item);
355+
354356
_logger.Debug("Component '{0}' was added.", e.Item.Name);
355357
_parser.State.OnParseRequested(sender, e.Item);
356358
}

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ public void SetTab(SourceControlTab tab)
9090
SelectedItem = TabItems.First(t => t.ViewModel.Tab == tab);
9191
}
9292

93+
public void AddComponent(VBComponent component)
94+
{
95+
if (Provider == null) { return; }
96+
97+
var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == component.Name);
98+
if (fileStatus != null)
99+
{
100+
Provider.AddFile(fileStatus.FilePath);
101+
}
102+
}
103+
93104
private static readonly IDictionary<NotificationType, BitmapImage> IconMappings =
94105
new Dictionary<NotificationType, BitmapImage>
95106
{

0 commit comments

Comments
 (0)