Format:
Recent snippets matching tags of property
<!-- CTRL+K, CTRL+X = Insert Snippet --> <!-- CTRL+K, CTRL+B = Manage Snippets --> <CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <Header> <Title>Property with NotifyPropertyChanged</Title> <Author>Jerry Nixon</Author> <Shortcut>propnote</Shortcut> <Description>Property with NotifyPropertyChanged</Description>
284 Views
1 comments
public class Button : ButtonBase { // The dependency property public static readonly DependencyProperty IsDefaultProperty; static Button() { // Register the property Button.IsDefaultProperty = DependencyProperty.Register(“IsDefault”, typeof(bool), typeof(Button), new FrameworkPropertyMetadata(false,
102 Views
no comments
/// <summary> /// Get the file that will be read/written to /// </summary> /// <returns></returns> public UnifiedFile GetFileFromProperty(PageData page, string propertyName) { var filePath = page.Property[propertyName] != null ? (string)page.Property[propertyName].Value : string.Empty; if (string.IsNullOrEmpty(filePath)) return null;
211 Views
no comments
protected void Map(Expression<Func<T, object>> property, Func<PropertyDescriptor, string> columnNamer) { MemberInfo memberInfo; if (property.Body is MemberExpression) memberInfo = ((MemberExpression)property.Body).Member; else memberInfo = ((MemberExpression)((UnaryExpression)property.Body).Operand).Member; Map(memberInfo.Name, columnNamer);
184 Views
no comments
<TemplatesExport family="Live Templates"> <Template uid="a008a808-07e4-4027-9ed7-99167b28a16f" shortcut="dprop" description="Property wrapper that works with a Dependency Property" text="public $type$ $name$
{
 get { return ($type$) GetValue($name$Property); }
 set { SetValue($name$Property, value); }
}" reformat="True" shortenQualifiedReferences="True"> <Categories /> <Variables> <Variable name="type" expression="fixedTypeName()" initialRange="0" /> <Variable name="name" expression="suggestVariableName()" initialRange="0" /> </Variables> <CustomProperties /> </Template> </TemplatesExport>
326 Views
no comments
// Define a list by enclosing the item type in brackets [int] // and initialize its value. Scores : [int] = [ 92, 100, 85, 62, 81, 100 ]; // Option A // require the stream type to be specified on a property PassingScores : int* {
234 Views
no comments
private IEnumerable<MemberInfo> GetImportMembers(Type type) { var local = new HashSet<string>(); if (type.IsAbstract) { yield break; } foreach (var member in GetDeclaredOnlyImportMembers(type)) {
308 Views
no comments
namespace Entity { public interface IBase { string Name { get; } } [Export("Base2", typeof(IBase))] [PartCreationPolicy(CreationPolicy.NonShared)] public class Base2 : IBase
368 Views
no comments
//this is the MEF Team Code namespace System.ComponentModel.Composition.AttributedModel { internal class AttributedPartCreationInfo : IReflectionPartCreationInfo { private IEnumerable<MemberInfo> GetImportMembers(Type type) { if (type.IsAbstract) { yield break;
314 Views
no comments
namespace Nowcom.Quicksilver { using System.ComponentModel; using System.Linq.Expressions; using System; public abstract class PropertyChangedBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged;
419 Views
1 comments
/// <summary> /// Return all properties from a type up to a specified base type in the inheritance hierarchy /// </summary> /// <param name="type">Type that will be examined</param> /// <param name="baseType">Where to stop in the inheritance hierarchy. Must be a type that first parameter inherits from /// </param> /// <returns>A list of all found properties</returns> public static List<PropertyInfo> GetAllProperties(Type type, Type baseType) { List<PropertyInfo> properties = new List<PropertyInfo>();
437 Views
no comments
/// <summary> /// Return all properties from a type up to a specified base type in the inheritance hierarchy /// </summary> /// <param name="type">Type that will be examined</param> /// <param name="baseType">Where to stop in the inheritance hierarchy. Must be a type that first parameter inherits from /// </param> /// <returns>A list of all found properties</returns> public static List<PropertyInfo> GetAllProperties(Type type, Type baseType) { List<PropertyInfo> properties = new List<PropertyInfo>();
288 Views
no comments
private static PropertyChangedEventArgs CurrentItemChangedEventArgs = new PropertyChangedEventArgs("CurrentItem"); private static PropertyChangedEventArgs CurrentPositionChangedEventArgs = new PropertyChangedEventArgs("CurrentPosition"); private static PropertyChangedEventArgs IsCurrentBeforeFirstChangedEventArgs = new PropertyChangedEventArgs("IsCurrentBeforeFirst"); ... this.PropertyChanged(this, CurrentItemChangedEventArgs); this.PropertyChanged(this, CurrentPositionChangedEventArgs); this.PropertyChanged(this, IsCurrentBeforeFirstChangedEventArgs);
378 Views
no comments
SELECT SERVERPROPERTY('BuildClrVersion') AS [BuildClrVersion] GO SELECT SERVERPROPERTY('Collation') AS [Collation] GO SELECT SERVERPROPERTY('CollationID') AS [CollationID] GO SELECT SERVERPROPERTY('ComparisonStyle') AS [ComparisonStyle] GO SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS [ComputerNamePhysicalNetBIOS] GO
441 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
