-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWindowAttachmentService.cs
More file actions
698 lines (576 loc) · 23.8 KB
/
WindowAttachmentService.cs
File metadata and controls
698 lines (576 loc) · 23.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.UI.Xaml;
namespace NoteUI;
/// <summary>
/// Monitors foreground windows and open Explorer folders to auto-show/hide
/// notes that are attached to a specific process, window title, or folder path.
/// </summary>
public sealed class WindowAttachmentService : IDisposable
{
private readonly NotesManager _notes;
private readonly string _selfProcessName;
private readonly DispatcherTimer _foregroundTimer;
private readonly DispatcherTimer _explorerTimer;
private readonly HashSet<string> _visibleNoteIds = [];
private readonly Dictionary<string, int> _attachmentMissCounts = [];
private IntPtr _foregroundHook;
private WinEventDelegate? _foregroundDelegate; // prevent GC collection
// Current foreground info (updated on each EVENT_SYSTEM_FOREGROUND)
private string? _currentForegroundProcess;
private IntPtr _currentForegroundHwnd;
public event Action<NoteEntry, IntPtr>? ShowRequested;
public event Action<string>? HideRequested;
public WindowAttachmentService(NotesManager notes)
{
_notes = notes;
_selfProcessName = NormalizeProcessName(Process.GetCurrentProcess().ProcessName);
_foregroundTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(800) };
_foregroundTimer.Tick += ForegroundTimer_Tick;
_explorerTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1500) };
_explorerTimer.Tick += ExplorerTimer_Tick;
}
public void Start()
{
// Hook foreground window changes
_foregroundDelegate = OnForegroundChanged;
_foregroundHook = SetWinEventHook(
EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND,
IntPtr.Zero, _foregroundDelegate,
0, 0, WINEVENT_OUTOFCONTEXT);
_foregroundTimer.Start();
_explorerTimer.Start();
// Initial check
CheckForegroundWindow();
CheckExplorerFolders();
}
public void Stop()
{
_foregroundTimer.Stop();
_explorerTimer.Stop();
if (_foregroundHook != IntPtr.Zero)
{
UnhookWinEvent(_foregroundHook);
_foregroundHook = IntPtr.Zero;
}
}
/// <summary>Call when notes are added/removed/modified to re-evaluate attachments.</summary>
public void Refresh()
{
CheckForegroundWindow();
CheckExplorerFolders();
}
public void Dispose()
{
Stop();
_foregroundTimer.Tick -= ForegroundTimer_Tick;
_explorerTimer.Tick -= ExplorerTimer_Tick;
}
// ── Foreground process monitoring ───────────────────────────────
private void OnForegroundChanged(IntPtr hWinEventHook, uint eventType, IntPtr hwnd,
int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
{
CheckForegroundWindow();
}
private void ForegroundTimer_Tick(object? sender, object e)
{
CheckForegroundWindow();
}
private void CheckForegroundWindow()
{
var hwnd = GetForegroundWindow();
string? processName = null;
string? title = null;
if (hwnd != IntPtr.Zero)
{
GetWindowThreadProcessId(hwnd, out var pid);
if (pid != 0)
{
try
{
processName = Process.GetProcessById((int)pid).ProcessName;
}
catch { }
}
var titleBuilder = new System.Text.StringBuilder(512);
GetWindowText(hwnd, titleBuilder, titleBuilder.Capacity);
var windowTitle = titleBuilder.ToString();
if (!string.IsNullOrWhiteSpace(windowTitle))
title = windowTitle;
}
_currentForegroundProcess = processName;
_currentForegroundHwnd = hwnd;
EvaluateProcessAttachments(processName, hwnd);
EvaluateWindowTitleAttachments(title, hwnd);
}
private void EvaluateProcessAttachments(string? foregroundProcess, IntPtr hwnd)
{
var processNotes = _notes.Notes
.Where(n => n.AttachMode == "process" && !string.IsNullOrEmpty(n.AttachTarget))
.ToList();
var isOwnProcessForeground = IsOwnProcessForeground(foregroundProcess);
foreach (var note in processNotes)
{
var matches = IsSameProcessTarget(note.AttachTarget, foregroundProcess);
if (matches && !IsIconic(hwnd))
{
MarkAttachmentMatch(note.Id);
if (_visibleNoteIds.Add(note.Id))
ShowRequested?.Invoke(note, hwnd);
}
else if (isOwnProcessForeground && _visibleNoteIds.Contains(note.Id))
{
// Keep already-attached note visible while user interacts with it
// (drag/edit focuses NoteUI, not the target process),
// but only while the target window is still actually visible.
if (HasAnyVisibleWindowForProcess(note.AttachTarget))
{
MarkAttachmentMatch(note.Id);
continue;
}
}
if (ShouldHideAfterMiss(note.Id) && _visibleNoteIds.Remove(note.Id))
{
ClearAttachmentState(note.Id);
HideRequested?.Invoke(note.Id);
}
}
}
private bool IsOwnProcessForeground(string? foregroundProcess)
{
if (string.IsNullOrWhiteSpace(foregroundProcess))
return false;
return string.Equals(NormalizeProcessName(foregroundProcess), _selfProcessName, StringComparison.OrdinalIgnoreCase);
}
private static bool IsSameProcessTarget(string? configuredTarget, string? foregroundProcess)
{
if (string.IsNullOrWhiteSpace(configuredTarget) || string.IsNullOrWhiteSpace(foregroundProcess))
return false;
var configured = NormalizeProcessName(configuredTarget);
var foreground = NormalizeProcessName(foregroundProcess);
return string.Equals(configured, foreground, StringComparison.OrdinalIgnoreCase);
}
private static string NormalizeProcessName(string raw)
{
var value = raw.Trim();
if (value.Length == 0)
return value;
var withoutPath = Path.GetFileName(value);
if (string.IsNullOrWhiteSpace(withoutPath))
withoutPath = value;
if (withoutPath.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
withoutPath = Path.GetFileNameWithoutExtension(withoutPath);
return withoutPath.Trim();
}
private void EvaluateWindowTitleAttachments(string? foregroundTitle, IntPtr hwnd)
{
var titleNotes = _notes.Notes
.Where(n => n.AttachMode == "title" && !string.IsNullOrEmpty(n.AttachTarget))
.ToList();
var isOwnProcessForeground = IsOwnProcessForeground(_currentForegroundProcess);
foreach (var note in titleNotes)
{
var matches = IsWindowTitleMatch(note.AttachTarget, foregroundTitle);
if (matches && !IsIconic(hwnd))
{
MarkAttachmentMatch(note.Id);
if (_visibleNoteIds.Add(note.Id))
ShowRequested?.Invoke(note, hwnd);
}
else if (isOwnProcessForeground && _visibleNoteIds.Contains(note.Id))
{
// Keep already-attached note visible while user interacts with it,
// but only while a matching target window is still actually visible.
if (HasAnyVisibleWindowForTitle(note.AttachTarget))
{
MarkAttachmentMatch(note.Id);
continue;
}
}
if (ShouldHideAfterMiss(note.Id) && _visibleNoteIds.Remove(note.Id))
{
ClearAttachmentState(note.Id);
HideRequested?.Invoke(note.Id);
}
}
}
private static bool IsWindowTitleMatch(string? configuredTarget, string? foregroundTitle)
{
if (string.IsNullOrWhiteSpace(configuredTarget) || string.IsNullOrWhiteSpace(foregroundTitle))
return false;
var target = NormalizeWindowTitle(configuredTarget);
if (target.EndsWith("...", StringComparison.Ordinal))
target = target[..^3].Trim();
var title = NormalizeWindowTitle(foregroundTitle);
if (target.Length == 0 || title.Length == 0)
return false;
if (string.Equals(target, title, StringComparison.OrdinalIgnoreCase))
return true;
if (title.Contains(target, StringComparison.OrdinalIgnoreCase))
return true;
if (target.Contains(title, StringComparison.OrdinalIgnoreCase))
return true;
return false;
}
private static string NormalizeWindowTitle(string raw)
{
var value = raw.Trim();
if (value.Length == 0)
return value;
string[] browserSuffixes =
[
" - Google Chrome",
" - Microsoft Edge",
" - Mozilla Firefox",
" - Brave",
" - Opera",
" - Arc",
" - Vivaldi",
" - Chromium",
" - Internet Explorer"
];
foreach (var suffix in browserSuffixes)
{
if (value.EndsWith(suffix, StringComparison.OrdinalIgnoreCase))
{
value = value[..^suffix.Length].Trim();
break;
}
}
return value;
}
private bool HasAnyVisibleWindowForProcess(string? configuredTarget)
{
if (string.IsNullOrWhiteSpace(configuredTarget))
return false;
var found = false;
EnumWindows((candidateHwnd, _) =>
{
if (!IsWindowVisible(candidateHwnd) || IsIconic(candidateHwnd))
return true;
GetWindowThreadProcessId(candidateHwnd, out var pid);
if (pid == 0)
return true;
try
{
var processName = Process.GetProcessById((int)pid).ProcessName;
if (IsSameProcessTarget(configuredTarget, processName))
{
found = true;
return false;
}
}
catch { }
return true;
}, IntPtr.Zero);
return found;
}
private bool HasAnyVisibleWindowForTitle(string? configuredTarget)
{
if (string.IsNullOrWhiteSpace(configuredTarget))
return false;
var found = false;
EnumWindows((candidateHwnd, _) =>
{
if (!IsWindowVisible(candidateHwnd) || IsIconic(candidateHwnd))
return true;
// Ignore NoteUI windows so matching relies on real target windows.
GetWindowThreadProcessId(candidateHwnd, out var pid);
if (pid != 0)
{
try
{
var processName = Process.GetProcessById((int)pid).ProcessName;
if (IsOwnProcessForeground(processName))
return true;
}
catch { }
}
var titleBuilder = new System.Text.StringBuilder(512);
GetWindowText(candidateHwnd, titleBuilder, titleBuilder.Capacity);
var title = titleBuilder.ToString();
if (!string.IsNullOrWhiteSpace(title) && IsWindowTitleMatch(configuredTarget, title))
{
found = true;
return false;
}
return true;
}, IntPtr.Zero);
return found;
}
private void MarkAttachmentMatch(string noteId)
{
_attachmentMissCounts.Remove(noteId);
}
private bool ShouldHideAfterMiss(string noteId, int requiredMisses = 2)
{
var misses = 1;
if (_attachmentMissCounts.TryGetValue(noteId, out var current))
misses = current + 1;
_attachmentMissCounts[noteId] = misses;
return misses >= requiredMisses;
}
private void ClearAttachmentState(string noteId)
{
_attachmentMissCounts.Remove(noteId);
}
// ── Explorer folder monitoring ──────────────────────────────────
private void ExplorerTimer_Tick(object? sender, object e)
{
CheckExplorerFolders();
}
private void CheckExplorerFolders()
{
var folderNotes = _notes.Notes
.Where(n => n.AttachMode == "folder" && !string.IsNullOrEmpty(n.AttachTarget))
.ToList();
if (folderNotes.Count == 0)
{
// Hide any previously visible folder-attached notes
foreach (var id in _visibleNoteIds.ToList())
{
var note = _notes.Notes.FirstOrDefault(n => n.Id == id);
if (note?.AttachMode == "folder")
{
_visibleNoteIds.Remove(id);
HideRequested?.Invoke(id);
}
}
return;
}
var openPaths = GetOpenExplorerPaths();
foreach (var note in folderNotes)
{
string normalizedTarget;
try { normalizedTarget = Path.GetFullPath(note.AttachTarget!); }
catch { continue; }
var match = openPaths.FirstOrDefault(p =>
IsSamePath(p.Path, normalizedTarget));
if (match.Path != null)
{
if (_visibleNoteIds.Add(note.Id))
ShowRequested?.Invoke(note, match.Hwnd);
}
else
{
if (_visibleNoteIds.Remove(note.Id))
HideRequested?.Invoke(note.Id);
}
}
}
public static bool IsSamePath(string? left, string? right)
{
if (string.IsNullOrWhiteSpace(left) || string.IsNullOrWhiteSpace(right))
return false;
try
{
return string.Equals(NormalizePath(left), NormalizePath(right), StringComparison.OrdinalIgnoreCase);
}
catch
{
return string.Equals(left, right, StringComparison.OrdinalIgnoreCase);
}
}
private static string NormalizePath(string path)
{
var normalized = Path.GetFullPath(path)
.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
var root = Path.GetPathRoot(normalized);
if (!string.IsNullOrEmpty(root) &&
!string.Equals(normalized, root, StringComparison.OrdinalIgnoreCase))
{
normalized = normalized.TrimEnd(Path.DirectorySeparatorChar);
}
return normalized;
}
private static string NormalizeExplorerTitle(string title)
{
var normalized = title.Trim();
string[] knownSuffixes =
[
" - File Explorer",
" - Explorateur de fichiers",
" - Explorador de archivos",
" - Datei-Explorer",
" - Esplora file",
" - Windows Explorer"
];
foreach (var suffix in knownSuffixes)
{
if (normalized.EndsWith(suffix, StringComparison.OrdinalIgnoreCase))
return normalized[..^suffix.Length].Trim();
}
return normalized;
}
/// <summary>
/// Returns open Explorer folder paths. When multiple tabs exist in the same
/// Explorer window, tries to detect only the active tab by matching against
/// the window title (works best with "Display full path in title bar" enabled).
/// Falls back to returning all open paths if detection fails.
/// </summary>
public static List<(string Path, IntPtr Hwnd)> GetOpenExplorerPaths()
{
// Step 1: Get ALL open shell windows
var allShellWindows = new List<(string Path, IntPtr Hwnd, string LocationName)>();
try
{
var shellType = Type.GetTypeFromProgID("Shell.Application");
if (shellType == null) return [];
dynamic shell = Activator.CreateInstance(shellType)!;
dynamic windows = shell.Windows();
int count = windows.Count;
for (int i = 0; i < count; i++)
{
try
{
dynamic w = windows.Item(i);
string? fullName = w.FullName;
if (fullName == null || !fullName.EndsWith("explorer.exe", StringComparison.OrdinalIgnoreCase))
continue;
string? url = w.LocationURL;
if (string.IsNullOrEmpty(url)) continue;
var uri = new Uri(url);
if (!uri.IsFile) continue;
var hwnd = (IntPtr)(long)w.HWND;
string locationName = "";
try { locationName = w.LocationName ?? ""; } catch { }
var localPath = NormalizePath(uri.LocalPath);
if (string.IsNullOrWhiteSpace(localPath)) continue;
allShellWindows.Add((localPath, hwnd, locationName));
}
catch { }
}
}
catch { }
if (allShellWindows.Count <= 1)
return allShellWindows.Select(s => (s.Path, s.Hwnd)).ToList();
// Step 2: Try to filter to active tabs per Explorer window title.
// If title matching fails for a window, keep all its tabs to avoid false negatives.
try
{
var explorerTitlesByHwnd = new Dictionary<IntPtr, string>();
EnumWindows((hwnd, _) =>
{
if (!IsWindowVisible(hwnd)) return true;
var csb = new System.Text.StringBuilder(256);
GetClassName(hwnd, csb, csb.Capacity);
if (csb.ToString() != "CabinetWClass") return true;
var tsb = new System.Text.StringBuilder(512);
GetWindowText(hwnd, tsb, tsb.Capacity);
var t = tsb.ToString();
if (!string.IsNullOrEmpty(t))
explorerTitlesByHwnd[hwnd] = NormalizeExplorerTitle(t);
return true;
}, IntPtr.Zero);
if (explorerTitlesByHwnd.Count > 0)
{
var filtered = new List<(string Path, IntPtr Hwnd)>();
foreach (var group in allShellWindows.GroupBy(sw => sw.Hwnd))
{
if (!explorerTitlesByHwnd.TryGetValue(group.Key, out var title) ||
string.IsNullOrWhiteSpace(title))
{
filtered.AddRange(group.Select(s => (s.Path, s.Hwnd)));
continue;
}
var matchedInWindow = group.Where(sw =>
{
var trimmed = sw.Path.TrimEnd(
System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar);
var folderName = System.IO.Path.GetFileName(trimmed);
var locationName = sw.LocationName?.Trim();
return
(!string.IsNullOrEmpty(locationName) &&
title.Equals(locationName, StringComparison.OrdinalIgnoreCase)) ||
title.Equals(trimmed, StringComparison.OrdinalIgnoreCase) ||
(!string.IsNullOrEmpty(folderName) &&
title.Equals(folderName, StringComparison.OrdinalIgnoreCase));
}).Select(s => (s.Path, s.Hwnd)).ToList();
if (matchedInWindow.Count > 0)
filtered.AddRange(matchedInWindow);
else
filtered.AddRange(group.Select(s => (s.Path, s.Hwnd)));
}
if (filtered.Count > 0)
return filtered
.DistinctBy(p => (p.Path, p.Hwnd))
.ToList();
}
}
catch { }
// Fallback: return all open paths
return allShellWindows.Select(s => (s.Path, s.Hwnd)).ToList();
}
/// <summary>
/// Calculates the absolute position for an attached note given the target window handle.
/// Returns (x, y) or null if the target window is minimized or invalid.
/// </summary>
public static (int X, int Y)? GetAttachedPosition(NoteEntry note, IntPtr targetHwnd, int noteWidth = 400, int noteHeight = 450)
{
// Shell.Application may return a child HWND; get the top-level window
var topHwnd = GetAncestor(targetHwnd, GA_ROOT);
if (topHwnd == IntPtr.Zero) topHwnd = targetHwnd;
if (topHwnd == IntPtr.Zero || IsIconic(topHwnd))
return null;
if (!GetWindowRect(topHwnd, out var rect))
return null;
if (note.AttachOffsetX == 0 && note.AttachOffsetY == 0)
{
// Default: bottom-right corner of the target window, with margin
const int margin = 12;
return (rect.Right - noteWidth - margin, rect.Bottom - noteHeight - margin);
}
return (rect.Left + note.AttachOffsetX, rect.Top + note.AttachOffsetY);
}
/// <summary>
/// Saves the relative offset of the note window position to the target window.
/// </summary>
public static void SaveAttachOffset(NoteEntry note, IntPtr targetHwnd, int noteX, int noteY)
{
var topHwnd = GetAncestor(targetHwnd, GA_ROOT);
if (topHwnd == IntPtr.Zero) topHwnd = targetHwnd;
if (topHwnd == IntPtr.Zero || IsIconic(topHwnd))
return;
if (!GetWindowRect(topHwnd, out var rect))
return;
note.AttachOffsetX = noteX - rect.Left;
note.AttachOffsetY = noteY - rect.Top;
}
/// <summary>Returns the current foreground window handle (for saving offsets on hide).</summary>
public IntPtr CurrentForegroundHwnd => _currentForegroundHwnd;
// ── Win32 P/Invoke ──────────────────────────────────────────────
private const uint EVENT_SYSTEM_FOREGROUND = 0x0003;
private const uint WINEVENT_OUTOFCONTEXT = 0x0000;
private delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd,
int idObject, int idChild, uint dwEventThread, uint dwmsEventTime);
[DllImport("user32.dll")]
private static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc,
WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);
[DllImport("user32.dll")]
private static extern bool UnhookWinEvent(IntPtr hWinEventHook);
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
[DllImport("user32.dll")]
private static extern bool GetWindowRect(IntPtr hWnd, out RECT rect);
[DllImport("user32.dll")]
private static extern bool IsIconic(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern IntPtr GetAncestor(IntPtr hwnd, uint gaFlags);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern int GetWindowText(IntPtr hWnd, System.Text.StringBuilder lpString, int nMaxCount);
private delegate bool EnumWindowsProc(IntPtr hwnd, IntPtr lParam);
[DllImport("user32.dll")]
private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
[DllImport("user32.dll")]
private static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern int GetClassName(IntPtr hWnd, System.Text.StringBuilder lpClassName, int nMaxCount);
private const uint GA_ROOT = 2;
[StructLayout(LayoutKind.Sequential)]
private struct RECT
{
public int Left, Top, Right, Bottom;
}
}