ParallelSeparator.xaml.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Core.Presentation / System / Activities / Core / Presentation / ParallelSeparator.xaml.cs / 1305376 / ParallelSeparator.xaml.cs

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

namespace System.Activities.Core.Presentation 
{
    using System.Activities.Presentation; 
    using System.Activities.Presentation.Hosting; 
    using System.Windows;
    using System.Windows.Media.Animation; 

    partial class ParallelSeparator
    {
        public static readonly DependencyProperty AllowedItemTypeProperty = 
            DependencyProperty.Register("AllowedItemType", typeof(Type), typeof(ParallelSeparator), new UIPropertyMetadata(typeof(object)));
 
        public static readonly DependencyProperty ContextProperty = DependencyProperty.Register( 
            "Context",
            typeof(EditingContext), 
            typeof(ParallelSeparator));

        public ParallelSeparator()
        { 
            this.InitializeComponent();
        } 
 
        public Type AllowedItemType
        { 
            get { return (Type)GetValue(AllowedItemTypeProperty); }
            set { SetValue(AllowedItemTypeProperty, value); }
        }
 
        public EditingContext Context
        { 
            get { return (EditingContext)GetValue(ContextProperty); } 
            set { SetValue(ContextProperty, value); }
        } 

        protected override void OnDragEnter(DragEventArgs e)
        {
            CheckAnimate(e, "Expand"); 
            this.dropTarget.Visibility = Visibility.Visible;
        } 
 
        protected override void OnDragLeave(DragEventArgs e)
        { 
            CheckAnimate(e, "Collapse");
            this.dropTarget.Visibility = Visibility.Collapsed;
        }
 
        protected override void OnDrop(DragEventArgs e)
        { 
            this.dropTarget.Visibility = Visibility.Collapsed; 
            base.OnDrop(e);
        } 

        void CheckAnimate(DragEventArgs e, string storyboardResourceName)
        {
            if (!e.Handled) 
            {
                if (!this.Context.Items.GetValue().IsReadOnly && 
                    DragDropHelper.AllowDrop(e.Data, this.Context, this.AllowedItemType)) 
                {
                    BeginStoryboard((Storyboard)this.Resources[storyboardResourceName]); 
                    return;
                }
                else
                { 
                    e.Effects = DragDropEffects.None;
                } 
                e.Handled = true; 
            }
        } 
    }
}

// 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