You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @Jack251970.
* #3500 (comment)
The following files were modified:
* `Flow.Launcher.Infrastructure/Storage/JsonStorage.cs`
* `Flow.Launcher/Storage/TopMostRecord.cs`
* `Flow.Launcher/ViewModel/MainViewModel.cs`
/// Initializes the top most records storage, handling migration from the old single-record-per-query format to the new multiple-records-per-query format if necessary.
19
+
/// </summary>
20
+
/// <remarks>
21
+
/// If new-format data exists, it loads it and deletes any old-format data. If only old-format data exists, it migrates the data to the new format, deletes the old data, and saves the new structure. If neither exists, it initializes an empty new-format storage.
22
+
/// </remarks>
17
23
publicFlowLauncherJsonStorageTopMostRecord()
18
24
{
19
25
// Get old data & new data
@@ -63,21 +69,35 @@ public FlowLauncherJsonStorageTopMostRecord()
63
69
}
64
70
}
65
71
72
+
/// <summary>
73
+
/// Persists the current top most records to storage.
74
+
/// </summary>
66
75
publicvoidSave()
67
76
{
68
77
_topMostRecordStorage.Save();
69
78
}
70
79
80
+
/// <summary>
81
+
/// Determines whether the specified result is marked as top most in the current records.
82
+
/// </summary>
83
+
/// <param name="result">The result to check.</param>
84
+
/// <returns>True if the result is marked as top most; otherwise, false.</returns>
71
85
publicboolIsTopMost(Resultresult)
72
86
{
73
87
return_topMostRecord.IsTopMost(result);
74
88
}
75
89
90
+
/// <summary>
91
+
/// Removes the specified result from the top most records if it exists.
92
+
/// </summary>
76
93
publicvoidRemove(Resultresult)
77
94
{
78
95
_topMostRecord.Remove(result);
79
96
}
80
97
98
+
/// <summary>
99
+
/// Adds a result to the top most records or updates it if it already exists.
/// Adds or updates the top most record for the specified result's query, replacing any existing record for that query.
148
+
/// </summary>
149
+
/// <param name="result">The result whose information is to be stored as the top most record for its originating query. If <c>OriginQuery</c> is null, no action is taken.</param>
121
150
internalvoidAddOrUpdate(Resultresult)
122
151
{
123
152
// origin query is null when user select the context menu item directly of one item from query list
@@ -147,6 +176,10 @@ internal class MultipleTopMostRecord
/// Deserializes JSON into a <see cref="ConcurrentDictionary{TKey, TValue}"/> mapping strings to <see cref="ConcurrentBag{T}"/> of <see cref="Record"/>.
305
+
/// </summary>
306
+
/// <param name="reader">The JSON reader positioned at the start of the object.</param>
307
+
/// <param name="typeToConvert">The type to convert (ignored).</param>
308
+
/// <param name="options">Serialization options to use during deserialization.</param>
309
+
/// <returns>A concurrent dictionary where each key maps to a concurrent bag of records.</returns>
Copy file name to clipboardExpand all lines: Flow.Launcher/ViewModel/MainViewModel.cs
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
usingSystem;
1
+
usingSystem;
2
2
usingSystem.Collections.Generic;
3
3
usingSystem.ComponentModel;
4
4
usingSystem.Globalization;
@@ -54,6 +54,9 @@ public partial class MainViewModel : BaseModel, ISavable, IDisposable
54
54
55
55
#region Constructor
56
56
57
+
/// <summary>
58
+
/// Initializes a new instance of the MainViewModel class, setting up application state, loading persistent data, configuring results view models, and registering property change handlers and background update tasks.
59
+
/// </summary>
57
60
publicMainViewModel()
58
61
{
59
62
_queryTextBeforeLeaveResults="";
@@ -1605,6 +1608,8 @@ public async void Hide()
1605
1608
1606
1609
/// <summary>
1607
1610
/// Save history, user selected records and top most records
1611
+
/// <summary>
1612
+
/// Persists the current history, user-selected records, and top-most records to storage.
0 commit comments