FilterableData.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / FilterableData.cs / 1305376 / FilterableData.cs

                            //---------------------------------------------------------------- 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//---------------------------------------------------------------

namespace System.Activities.Presentation.View 
{
    using System.Windows; 
    using System.Globalization; 
    using System.Runtime;
 
    class FilterableData : DependencyObject
    {
        public static readonly DependencyProperty DataProperty =
            DependencyProperty.Register("Data", typeof(object), typeof(FilterableData), new UIPropertyMetadata(null)); 

        public static readonly DependencyProperty IsSelectedProperty = 
            DependencyProperty.Register("IsSelected", typeof(bool), typeof(FilterableData), new UIPropertyMetadata(false)); 

        public static readonly DependencyProperty VisibilityProperty = 
            DependencyProperty.Register("Visibility", typeof(Visibility), typeof(FilterableData), new UIPropertyMetadata(Visibility.Visible));

        public object Data
        { 
            get { return (object)GetValue(DataProperty); }
            set { SetValue(DataProperty, value); } 
        } 

        public bool IsSelected 
        {
            get { return (bool)GetValue(IsSelectedProperty); }
            set { SetValue(IsSelectedProperty, value); }
        } 

        public Visibility Visibility 
        { 
            get { return (Visibility)GetValue(VisibilityProperty); }
            set { SetValue(VisibilityProperty, value); } 
        }

        internal object Owner
        { 
            get;
            set; 
        } 

        public override string ToString() 
        {
            return null == this.Data ? "" : this.Data.ToString();
        }
    } 

    class FilterableData < TData > : FilterableData 
    { 
        [Fx.Tag.KnownXamlExternal]
        public TData TypedData 
        {
            get { return (TData)base.Data; }
            set { base.Data = value; }
        } 

        public override string ToString() 
        { 
            return string.Format(CultureInfo.CurrentUICulture, "{0}:({1})", base.ToString(), typeof(TData).Name);
        } 
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//---------------------------------------------------------------- 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//---------------------------------------------------------------

namespace System.Activities.Presentation.View 
{
    using System.Windows; 
    using System.Globalization; 
    using System.Runtime;
 
    class FilterableData : DependencyObject
    {
        public static readonly DependencyProperty DataProperty =
            DependencyProperty.Register("Data", typeof(object), typeof(FilterableData), new UIPropertyMetadata(null)); 

        public static readonly DependencyProperty IsSelectedProperty = 
            DependencyProperty.Register("IsSelected", typeof(bool), typeof(FilterableData), new UIPropertyMetadata(false)); 

        public static readonly DependencyProperty VisibilityProperty = 
            DependencyProperty.Register("Visibility", typeof(Visibility), typeof(FilterableData), new UIPropertyMetadata(Visibility.Visible));

        public object Data
        { 
            get { return (object)GetValue(DataProperty); }
            set { SetValue(DataProperty, value); } 
        } 

        public bool IsSelected 
        {
            get { return (bool)GetValue(IsSelectedProperty); }
            set { SetValue(IsSelectedProperty, value); }
        } 

        public Visibility Visibility 
        { 
            get { return (Visibility)GetValue(VisibilityProperty); }
            set { SetValue(VisibilityProperty, value); } 
        }

        internal object Owner
        { 
            get;
            set; 
        } 

        public override string ToString() 
        {
            return null == this.Data ? "" : this.Data.ToString();
        }
    } 

    class FilterableData < TData > : FilterableData 
    { 
        [Fx.Tag.KnownXamlExternal]
        public TData TypedData 
        {
            get { return (TData)base.Data; }
            set { base.Data = value; }
        } 

        public override string ToString() 
        { 
            return string.Format(CultureInfo.CurrentUICulture, "{0}:({1})", base.ToString(), typeof(TData).Name);
        } 
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK