CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of property
XML
<!-- 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>
by Jerry Nixon   November 08, 2011 @ 9:29am
284 Views
1 comments
 
C#
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,
by Vijay Sharma   April 22, 2011 @ 3:12am
102 Views
no comments
 
C#
/// <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;
by rawbert   February 25, 2011 @ 12:45am
211 Views
no comments
 
C#
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);
by Andy Sherwood   February 04, 2011 @ 3:24pm
184 Views
no comments
 
XML
<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$&#xD;&#xA;{&#xD;&#xA;   get { return ($type$) GetValue($name$Property); }&#xD;&#xA;   set { SetValue($name$Property, value); }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
    <Categories />
    <Variables>
      <Variable name="type" expression="fixedTypeName()" initialRange="0" />
      <Variable name="name" expression="suggestVariableName()" initialRange="0" />
    </Variables>
    <CustomProperties />
  </Template>
</TemplatesExport>
by Hadi Eskandari   January 31, 2011 @ 11:38pm
326 Views
no comments
 
C#
// 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*
{
by Dan Vanderboom   June 16, 2010 @ 1:07pm
234 Views
no comments
 
C#
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
 
C#
namespace Entity
{
public interface IBase
{
    string Name { get; }    
}
 
[Export("Base2", typeof(IBase))]
[PartCreationPolicy(CreationPolicy.NonShared)]
public class Base2 : IBase
by codding4fun   June 08, 2010 @ 1:55am
368 Views
no comments
 
C#
//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;
by codding4fun   June 08, 2010 @ 1:32am
314 Views
no comments
 
C#
 
by codding4fun   June 08, 2010 @ 1:27am
239 Views
no comments
 
C#
namespace Nowcom.Quicksilver
{
    using System.ComponentModel;
    using System.Linq.Expressions;
    using System;
 
    public abstract class PropertyChangedBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
by Robert Kozak   April 21, 2010 @ 3:52pm
419 Views
1 comments
 
C#
/// <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
 
C#
/// <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>();
by Robert Andersson   March 11, 2010 @ 12:25pm
288 Views
no comments
 
C#
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);
by Jeff Handley   August 14, 2009 @ 12:15am
378 Views
no comments
 
SQL
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
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate