Skip to content

Commit 2b3917d

Browse files
author
LoneWandererProductions
committed
Smaller cleanups
1 parent 9c52436 commit 2b3917d

24 files changed

Lines changed: 199 additions & 201 deletions
0 Bytes
Loading
0 Bytes
Loading

Imaging/ImageRender.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public Bitmap CutBitmap(Bitmap image, int x, int y, int height, int width)
227227
/// <param name="startPoint">The start point.</param>
228228
/// <returns>The selected Image area.</returns>
229229
/// <exception cref="T:System.ArgumentOutOfRangeException">shape - null</exception>
230-
public Bitmap CutBitmap(Bitmap image, int width, int height, MaskShape shape, object shapeParams = null,
230+
public Bitmap CutBitmap(Bitmap image, int width, int height, MaskShape shape, object? shapeParams = null,
231231
Point? startPoint = null)
232232
{
233233
var btm = ImageStream.CutBitmap(image, 0, 0, image.Height, image.Width);
@@ -331,7 +331,7 @@ public BitmapImage GetBitmapImage(string path, int width, int height)
331331
/// <exception cref="IOException">Error while we try to access the File</exception>
332332
/// <exception cref="InvalidOperationException">Could not get correct access to the Object</exception>
333333
/// <exception cref="IOException">Could not find the File</exception>
334-
public BitmapImage GetBitmapImageFileStream(string path)
334+
public BitmapImage? GetBitmapImageFileStream(string path)
335335
{
336336
return ImageStreamMedia.GetBitmapImageFileStream(path);
337337
}
@@ -352,7 +352,7 @@ public BitmapImage GetBitmapImageFileStream(string path)
352352
/// <exception cref="NotSupportedException">File Type provided was not supported</exception>
353353
/// <exception cref="InvalidOperationException">Could not get correct access to the Object</exception>
354354
/// <exception cref="IOException">Error while we try to access the File</exception>
355-
public BitmapImage GetBitmapImageFileStream(string path, int width, int height)
355+
public BitmapImage? GetBitmapImageFileStream(string path, int width, int height)
356356
{
357357
return ImageStreamMedia.GetBitmapImageFileStream(path, width, height);
358358
}

Imaging/Interfaces/IImageRender.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Bitmap CutBitmap(Bitmap image, int width, int height, MaskShape shape, object sh
234234
/// <exception cref="IOException">Error while we try to access the File</exception>
235235
/// <exception cref="InvalidOperationException">Could not get correct access to the Object</exception>
236236
/// <exception cref="IOException">Could not find the File</exception>
237-
BitmapImage GetBitmapImageFileStream(string path);
237+
BitmapImage? GetBitmapImageFileStream(string path);
238238

239239
/// <summary>
240240
/// Loads File in a Stream
@@ -251,7 +251,7 @@ Bitmap CutBitmap(Bitmap image, int width, int height, MaskShape shape, object sh
251251
/// <exception cref="NotSupportedException">File Type provided was not supported</exception>
252252
/// <exception cref="InvalidOperationException">Could not get correct access to the Object</exception>
253253
/// <exception cref="IOException">Error while we try to access the File</exception>
254-
BitmapImage GetBitmapImageFileStream(string path, int width, int height);
254+
BitmapImage? GetBitmapImageFileStream(string path, int width, int height);
255255

256256
/// <summary>
257257
/// Bitmaps to bitmap image.
@@ -261,7 +261,7 @@ Bitmap CutBitmap(Bitmap image, int width, int height, MaskShape shape, object sh
261261
/// The Image as <see cref="BitmapImage" />.
262262
/// </returns>
263263
/// <exception cref="ArgumentNullException"></exception>
264-
BitmapImage BitmapToBitmapImage(Bitmap image);
264+
BitmapImage? BitmapToBitmapImage(Bitmap image);
265265

266266
/// <summary>
267267
/// Bitmaps the image bitmap.

SQLiteHelper/DataSet.cs

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* COPYRIGHT: See COPYING in the top level directory
3+
* PROJECT: SqliteHelper
4+
* FILE: DataSet.cs
5+
* PURPOSE: Used in add Statement and Select
6+
* PROGRAMER: Peter Geinitz (Wayfarer)
7+
*/
8+
9+
// ReSharper disable UnusedMember.Global
10+
// ReSharper disable MemberCanBeInternal
11+
12+
using System.Collections.Generic;
13+
using System.Data;
14+
using System.Linq;
15+
16+
namespace SqliteHelper
17+
{
18+
/// <summary>
19+
/// Alternative View of the select unlike Data View for Data Binding, with some added extras
20+
/// </summary>
21+
public sealed class DataSet
22+
{
23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="DataSet" /> class.
25+
/// </summary>
26+
internal DataSet()
27+
{
28+
Row = new List<TableSet>();
29+
}
30+
31+
/// <summary>
32+
/// Gets the height.
33+
/// </summary>
34+
public int Height => Row.Count;
35+
36+
/// <summary>
37+
/// Gets the width.
38+
/// </summary>
39+
public int Width => Row[0].Row.Count;
40+
41+
/// <summary>
42+
/// Only Used for DataBinding
43+
/// </summary>
44+
public DataView Raw { get; internal set; }
45+
46+
/// <summary>
47+
/// Custom Data View,
48+
/// Infos about the Table and the Data it Contains
49+
/// </summary>
50+
public List<TableSet> Row { get; internal init; }
51+
52+
/// <summary>
53+
/// Get a specific Column of the Data set
54+
/// </summary>
55+
/// <param name="height">Height of the Column</param>
56+
/// <returns>
57+
/// Specific Column at that position, on Error return null.
58+
/// </returns>
59+
public List<string> Columns(int height)
60+
{
61+
if (height >= Height || height < 0)
62+
{
63+
return null;
64+
}
65+
66+
return Row?[height].Row;
67+
}
68+
69+
/// <summary>
70+
/// Rows the specified width.
71+
/// </summary>
72+
/// <param name="width">The width.</param>
73+
/// <returns>
74+
/// Specific row at that position, on Error return null.
75+
/// </returns>
76+
public List<string> Rows(int width)
77+
{
78+
if (width >= Width || width < 0)
79+
{
80+
return null;
81+
}
82+
83+
if (Row == null)
84+
{
85+
return null;
86+
}
87+
88+
var lst = new List<string>(Width);
89+
90+
lst.AddRange(from TableSet cell in Row
91+
let element = cell.Row[width]
92+
select element);
93+
return lst;
94+
}
95+
96+
/// <summary>
97+
/// Get a specific cell of the DataSet
98+
/// </summary>
99+
/// <param name="height">Height of the Column</param>
100+
/// <param name="width">Width of the Row</param>
101+
/// <returns>Specific element at that position</returns>
102+
public string Cell(int height, int width)
103+
{
104+
if (height >= Height || height < 0)
105+
{
106+
return null;
107+
}
108+
109+
if (width >= Width || width < 0)
110+
{
111+
return null;
112+
}
113+
114+
var lst = Row[height].Row;
115+
116+
return lst[width];
117+
}
118+
}
119+
}

SQLiteHelper/ISqliteDatabase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: SqliteHelper
4-
* FILE: SqliteHelper/ISqliteDatabase.cs
4+
* FILE: ISqliteDatabase.cs
55
* PURPOSE: SQLiteHelper Interface
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/

SQLiteHelper/ISqliteUtility.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: SqliteHelper
4-
* FILE: SqliteHelper/ISqliteUtility.cs
4+
* FILE: ISqliteUtility.cs
55
* PURPOSE: Interface Tools for SqlLite
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
88

9-
using System.Collections.Generic;
10-
119
// ReSharper disable UnusedMemberInSuper.Global
1210

11+
using System.Collections.Generic;
12+
1313
namespace SqliteHelper
1414
{
1515
/// <summary>

SQLiteHelper/MessageHandling.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: SqliteHelper
4-
* FILE: SqliteHelper/MessageHandling.cs
4+
* FILE: MessageHandling.cs
55
* PURPOSE: Collects all Errors and Status Messages
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
@@ -37,7 +37,7 @@ internal static class MessageHandling
3737
/// <summary>
3838
/// Last Message
3939
/// </summary>
40-
internal static string LastError { get; private set; }
40+
internal static string? LastError { get; private set; }
4141

4242
/// <summary>
4343
/// List of Errors

SQLiteHelper/SqLiteHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: SqliteHelper
4-
* FILE: SqliteHelper/SqliteHelper.cs
4+
* FILE: SqliteHelper.cs
55
* PURPOSE: Helper Class for some Conversions
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/

SQLiteHelper/SqliteConnectionConfig.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: SqliteHelper
4-
* FILE: SqliteHelper/SqliteConnectionConfig.cs
4+
* FILE: SqliteConnectionConfig.cs
55
* PURPOSE: Connection Strings
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
@@ -18,12 +18,12 @@ internal static class SqliteConnectionConfig
1818
/// <summary>
1919
/// Gets or sets the location.
2020
/// </summary>
21-
internal static string? Location { get; set; }
21+
internal static string Location { get; set; } = null!;
2222

2323
/// <summary>
2424
/// Gets or sets the db name.
2525
/// </summary>
26-
internal static string? DbName { get; set; }
26+
internal static string DbName { get; set; } = null!;
2727

2828
/// <summary>
2929
/// Basic Value is 3

0 commit comments

Comments
 (0)