Skip to content

Commit

Permalink
Added:
Browse files Browse the repository at this point in the history
- delete from application window
- Class diagram
  • Loading branch information
malyda committed Dec 12, 2017
1 parent b6d755d commit fd5b613
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
44 changes: 44 additions & 0 deletions SQLite/SQLite/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Comment CommentText="Database location provider">
<Position X="5.521" Y="2.833" Height="0.75" Width="1.7" />
</Comment>
<Comment CommentText="Model class (entity)">
<Position X="8.052" Y="2.823" Height="0.75" Width="1.7" />
</Comment>
<Comment CommentText="Database Methods">
<Position X="10.865" Y="2.823" Height="0.75" Width="1.7" />
</Comment>
<Comment CommentText="Holder for database instace">
<Position X="3" Y="2.823" Height="0.75" Width="1.877" />
</Comment>
<Class Name="SQLite.App">
<Position X="3" Y="3.75" Width="1.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAA=</HashCode>
<FileName>App.xaml.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SQLite.FileHelper">
<Position X="5.25" Y="3.75" Width="2.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAA=</HashCode>
<FileName>FileHelper.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SQLite.Entity.TodoItem">
<Position X="7.75" Y="3.75" Width="2.25" />
<TypeIdentifier>
<HashCode>AABAAAAAAAAAgAAEAAAAAAQAAAAAAAAAAAAACAAAAAA=</HashCode>
<FileName>Entity\TodoItem.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SQLite.Entity.TodoItemDatabase">
<Position X="10.5" Y="3.75" Width="2.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAABACABAABAAAABAAAAAAAAAAAAQAAA=</HashCode>
<FileName>Entity\TodoItemDatabase.cs</FileName>
</TypeIdentifier>
</Class>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>
5 changes: 3 additions & 2 deletions SQLite/SQLite/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
xmlns:local="clr-namespace:SQLite"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<StackPanel Height="350">
<Button Click="Button_Click" >Delete from ListView</Button>
<Label x:Name="ItemsCount"></Label>
<ListView x:Name="ToDoItemsListView" SelectionChanged="ToDoItemsListView_OnSelectionChanged"></ListView>

<ListView x:Name="ToDoItemsListView" SelectionChanged="ToDoItemsListView_OnSelectionChanged" Height="198"></ListView>
</StackPanel>
</Window>
9 changes: 7 additions & 2 deletions SQLite/SQLite/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void ToDoItemsListView_OnSelectionChanged(object sender, SelectionChange
}
else
{
ItemsCount.Content = itemsFromDb.IndexOf(todoItem);
ItemsCount.Content = "ID"+todoItem.ID;
}

}
Expand All @@ -92,7 +92,12 @@ private void ToDoItemsListView_OnSelectionChanged(object sender, SelectionChange
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
if(itemsFromDb.Count > 0) itemsFromDb.RemoveAt(0);
if (itemsFromDb.Count > 0 && ToDoItemsListView.SelectedItem != null)
{
App.Database.DeleteItemAsync((TodoItem)ToDoItemsListView.SelectedItem);
itemsFromDb.Remove((TodoItem)ToDoItemsListView.SelectedItem);
ItemsCount.Content = "Item deleted";
}
}
}
}
1 change: 1 addition & 0 deletions SQLite/SQLite/SQLite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="ClassDiagram1.cd" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down

0 comments on commit fd5b613

Please sign in to comment.