Here are the examples of the csharp api System.Collections.Generic.ICollection.Add(Window) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5 Examples
19
Source : EnumWindows.cs
with MIT License
from AlexanderPro
with MIT License
from AlexanderPro
private static bool EnumWindowCallback(IntPtr hwnd, int lParam)
{
if (_filterHandles.Any(h => h == hwnd)) return true;
if (_windows.Any(w => w.Handle == hwnd)) return true;
int pid;
bool isAdd;
NativeMethods.GetWindowThreadProcessId(hwnd, out pid);
#if WIN32
isAdd = !Environment.Is64BitOperatingSystem || SystemUtils.IsWow64Process(pid);
#else
isAdd = Environment.Is64BitOperatingSystem && !SystemUtils.IsWow64Process(pid);
#endif
if (!isAdd) return true;
var window = new Window(hwnd, _menuItems, _languageSettings);
if (!window.Menu.Exists)
{
isAdd = false;
}
if (_filterreplacedles.Any(s => window.GetWindowText() == s))
{
isAdd = false;
}
if (isAdd)
{
_windows.Add(window);
}
return true;
}
19
Source : ThemeSelector.cs
with GNU General Public License v3.0
from Artentus
with GNU General Public License v3.0
from Artentus
public void EnableThemes(Window window)
{
if (window is null)
throw new ArgumentNullException(nameof(window));
if (_windows.Contains(window)) return;
_windows.Add(window);
if (!(SelectedTheme is null))
window.Styles.Add(SelectedTheme.Style);
}
19
Source : WindowProvider.cs
with GNU General Public License v3.0
from deccer
with GNU General Public License v3.0
from deccer
public void Load()
{
var windows = _serviceProvider.GetServices<Window>();
foreach (var window in windows)
{
_windows.Add(window);
}
}
19
Source : DockManager.cs
with MIT License
from npolyak
with MIT License
from npolyak
internal void AddWindow(Window window)
{
if (window is FloatingWindow floatingWindow)
{
_floatingWindows.Add(floatingWindow);
}
else
{
_predefinedWindows.Add(window);
}
}
19
Source : ExplorerShell.cs
with Mozilla Public License 2.0
from SafeExamBrowser
with Mozilla Public License 2.0
from SafeExamBrowser
public void HideAllWindows()
{
logger.Info("Searching for windows to be minimized...");
foreach (var handle in nativeMethods.GetOpenWindows())
{
var window = new Window
{
Handle = handle,
replacedle = nativeMethods.GetWindowreplacedle(handle)
};
minimizedWindows.Add(window);
logger.Info($"Found window '{window.replacedle}' with handle = {window.Handle}.");
}
logger.Info("Minimizing all open windows...");
nativeMethods.MinimizeAllOpenWindows();
logger.Info("Open windows successfully minimized.");
}