Format:
Recent snippets for: Athens Springer
/// <summary> /// State flag which indicates whether the grid is in edit /// mode or not. /// </summary> public bool IsEditing { get; set; } private void OnBeginEdit(object sender, DataGridBeginningEditEventArgs e) { IsEditing = true; //in case we are in the middle of a drag/drop operation, cancel it...
114 Views
no comments
<Popup x:Name="popup1" IsHitTestVisible="False" Placement="RelativePoint" PlacementTarget="{Binding ElementName=me}" AllowsTransparency="True"> <Border BorderBrush="{DynamicResource CellBorderBrush}" BorderThickness="2" Background="White"
102 Views
no comments
<Style.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" Value="#EEEEEE" /> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="HasItems" Value="false" /> <Condition Property="Width" Value="Auto" /> </MultiTrigger.Conditions>
158 Views
no comments
// DRAG private void List_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // Store the mouse position startPoint = e.GetPosition(null); } private void List_MouseMove(object sender, MouseEventArgs e) {
276 Views
no comments
public class DelegateCommand : ICommand { private readonly Predicate<object> _canExecute; private readonly Action<object> _execute; public event EventHandler CanExecuteChanged; public DelegateCommand(Action<object> execute) : this(execute, null) {
152 Views
no comments
private static readonly log4net.ILog _logger = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod() .DeclaringType);
183 Views
no comments
public static decimal Accumulate(IEnumerable e) { decimal sum = 0; foreach (Account a in e) sum += a.Balance; return sum; }
129 Views
no comments
public int CryptoHash(string strValue) { int hashCode = 0; if (strValue ! = null) { byte[ ] encodedUnHashedString = Encoding. Unicode. GetBytes(strValue) ; byte[ ] key = new byte[ 16] ; RandomNumberGenerator. Create( ). GetBytes(key); MACTripleDES hashingObj = new MACTripleDES(key) ; byte[ ] code = hashingObj. ComputeHash(encodedUnHashedString) ;
159 Views
no comments
using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.InteropServices; using System.Text;
334 Views
no comments
/// <summary> /// Static class that provides services to serialize and deserialize an IDynamiteXml. /// </summary> public static class DynamiteXmlLogic { /// <summary> /// Service to serialize an IDynamiteXml implementing object. /// Use the Deserialize method of this class to get the IDynamiteXml back. /// </summary> /// <param name="DynamiteXml">
189 Views
no comments
public class Tail
{
public static Action<T> RecursiveAction<T>(Action<T> a)
{
var methodInfo = Recursive(a.Method);
Action<T> action = p =>
{
var t = methodInfo.DeclaringType;
t.InvokeMember(methodInfo.Name, BindingFlags.InvokeMethod, null, t, new object[] { p });
270 Views
no comments
[XmlRoot("dictionary")] public class XmlSerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IXmlSerializable { #region Constructors public XmlSerializableDictionary() : base() { } public XmlSerializableDictionary(IDictionary<TKey, TValue> dictionary) : base(dictionary) { } public XmlSerializableDictionary(IEqualityComparer<TKey> comparer) : base(comparer) { }
319 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using LinqExtender.Configuration.Serialization; namespace LinqExtender.Configuration { /// <summary>
185 Views
no comments
using LinqExtender.Configuration.Serialization; namespace LinqExtender.Configuration { /// <summary> /// Fluent generic entry point for configuration settings. /// </summary> /// <typeparam name="T">query object</typeparam> public class Extender<T> : IClassSettings<T> {
161 Views
no comments
using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; using System.Linq; using LinqExtender.Attributes; using LinqExtender.Configuration.Serialization; using LinqExtender.Interfaces; namespace LinqExtender
528 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Collections; using System.Reflection; using LinqExtender.Collection; using LinqExtender.Interfaces;
163 Views
no comments
using System; using System.Collections.Generic; using System.Reflection; using System.Reflection.Emit; using LinqExtender.Interfaces; namespace LinqExtender { /// <summary> /// Generates a new object from existing one using the user's setup.
345 Views
no comments
Data units of msec resolution = 0.000301 usec 10 typeof(string) : count: 10000 0.285 +- 0% msec 10 typeof(string).TypeHandle : count: 10000 0.030 +- 3% msec 10 anObj.GetType() == type : count: 10000 0.444 +- 6% msec 10 Type.GetTypeHandle(obj).Equals(tHnd) : count: 10000 0.589 +- 1% msec 10 anObj.GetType() == typeof(string) : count: 10000 0.057 +- 2% msec 10 (anObj is string) : count: 10000 0.113 +- 10% msec
418 Views
no comments
[ClassInterface(ClassInterfaceType.None), ComDefaultInterface(typeof(_ILGenerator)), ComVisible(true)] public class ILGenerator : _ILGenerator { // Fields internal const int DefaultExceptionArraySize = 8; internal const int DefaultFixupArraySize = 0x40; internal const int DefaultLabelArraySize = 0x10; internal const int defaultSize = 0x10; internal __ExceptionInfo[] m_currExcStack; internal int m_currExcStackCount;
271 Views
no comments
[ClassInterface(ClassInterfaceType.None), ComDefaultInterface(typeof(_MethodRental)), ComVisible(true), HostProtection(SecurityAction.LinkDemand, MayLeakOnAbort=true)] public sealed class MethodRental : _MethodRental { // Fields public const int JitImmediate = 1; public const int JitOnDemand = 0; // Methods private MethodRental() {
321 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
