This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private XImage ScanOne() | |
{ | |
XImage ximage = null; | |
try | |
{ | |
// find our device (scanner previously selected with commonDialog.ShowSelectDevice) | |
DeviceManager manager = new DeviceManager(); | |
DeviceInfo deviceInfo = null; | |
foreach (DeviceInfo info in manager.DeviceInfos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfFocusScopeTest.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded"> | |
<Window.CommandBindings> | |
<CommandBinding Command="Paste" x:Name="bindingPaste" PreviewCanExecute="bindingPaste_PreviewCanExecute" /> | |
</Window.CommandBindings> | |
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto" /><RowDefinition Height="Auto" /><RowDefinition /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class MainWindow : Window | |
{ | |
private DependencyObject _menuFocusScope; | |
private DependencyObject _toolbarFocusScope; | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class NativeMethods | |
{ | |
/// | |
/// Reboot the computer | |
/// | |
public static void Reboot() | |
{ | |
IntPtr tokenHandle = IntPtr.Zero; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="geo"> | |
<span class="latitude">37.754849</span>, | |
<span class="longitude">-122.446607</span> | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BitmapSource shieldSource = null; | |
if (Environment.OSVersion.Version.Major >= 6) | |
{ | |
SHSTOCKICONINFO sii = new SHSTOCKICONINFO(); | |
sii.cbSize = (UInt32) Marshal.SizeOf(typeof(SHSTOCKICONINFO)); | |
Marshal.ThrowExceptionForHR(SHGetStockIconInfo(SHSTOCKICONID.SIID_SHIELD, | |
SHGSI.SHGSI_ICON | SHGSI.SHGSI_SMALLICON, | |
ref sii)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Application.Resources> | |
<ResourceDictionary> | |
<ResourceDictionary.MergedDictionaries> | |
<ResourceDictionary Source="MasterResources.xaml" /> | |
</ResourceDictionary.MergedDictionaries> | |
</ResourceDictionary> | |
</Application.Resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl.Resources> | |
<ResourceDictionary> | |
<ResourceDictionary.MergedDictionaries> | |
<ResourceDictionary Source="MasterResources.xaml" /> | |
</ResourceDictionary.MergedDictionaries> | |
</ResourceDictionary> | |
</UserControl.Resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ResourceDictionary> | |
<ResourceDictionary.MergedDictionaries> | |
<ResourceDictionary Source="/MyDll;component/ExternalResources.xaml" /> | |
</ResourceDictionary.MergedDictionaries> | |
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (SmtpClient smtp = new SmtpClient()) | |
{ | |
smtp.DeliveryMethod = SmtpDeliveryMethod.Network; | |
smtp.UseDefaultCredentials = false; | |
smtp.EnableSsl = true; | |
smtp.Host = "smtp.gmail.com"; | |
smtp.Port = 587; | |
smtp.Credentials = new NetworkCredential("email@gmail.com", "password"); | |
// send the email | |
} |