-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (33 loc) · 1.23 KB
/
Program.cs
File metadata and controls
37 lines (33 loc) · 1.23 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
namespace Microsoft.Psi.Samples.LinuxWebcamWithAudioSample
{
using System.IO;
using System.Reflection;
/// <summary>
/// Webcam with audio sample program.
/// </summary>
public class Program
{
/// <summary>
/// Main entry point.
/// </summary>
public static void Main()
{
Gtk.Application.Init();
InitializeCssStyles();
var window = new MainWindow();
window.Destroyed += (sender, e) => Gtk.Application.Quit();
window.ShowAll();
Gtk.Application.Run();
}
private static void InitializeCssStyles()
{
var styleProvider = new Gtk.CssProvider();
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Microsoft.Psi.Samples.LinuxWebcamWithAudioSample.Styles.css");
using StreamReader reader = new StreamReader(stream);
styleProvider.LoadFromData(reader.ReadToEnd());
Gtk.StyleContext.AddProviderForScreen(Gdk.Display.Default.DefaultScreen, styleProvider, Gtk.StyleProviderPriority.Application);
}
}
}