Skip to content

Instantly share code, notes, and snippets.

View KalinovDmitri's full-sized avatar

Dmitry Kalinov KalinovDmitri

  • pravo.ru
  • Russia, Samara
View GitHub Profile
<ComboBox IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding AvailableComboBoxValues}" SelectedItem="{Binding SelectedComboBoxItem}" />
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace CodeExamples.Wpf.Interactivity
{
public abstract class ViewModelBase : IViewModel
{
#region Events
using System;
using System.Runtime.CompilerServices;
using System.Windows.Input;
namespace CodeExamples.Wpf.Interactivity
{
public class MainWindowViewModel : ViewModelBase
{
#region Fields and properties
using System;
using System.IO;
using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CodeExamples.Tests
{
[TestClass]
public class FileWebRequestTests
public static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null)
{
var filePath = assembly.Location;
const int c_PeHeaderOffset = 60;
const int c_LinkerTimestampOffset = 8;
var buffer = new byte[2048];
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
stream.Read(buffer, 0, 2048);
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
<Style x:Key="UnderlinedOnMouseOverButtonStyle" TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock TextDecorations="Underline" Text="{TemplateBinding Content}"/>
</DataTemplate>
</Setter.Value>
</Setter>
public class SomeCalcController : Controller
{
public ActionResult DoCalc(SomeCalc calc)
{
calc.DoCalc();
calc.Save();
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CodeSamples.Common.Diagnostics
{
-- declare all required tables
CREATE TABLE [dbo].[Abonents]
(
[Id] BIGINT NOT NULL IDENTITY(1, 1) PRIMARY KEY NONCLUSTERED,
[FirstName] NVARCHAR(64) NOT NULL,
[LastName] NVARCHAR(64) NOT NULL,
[Phone1] VARCHAR(20) NULL,
[Phone2] VARCHAR(20) NULL,