• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Documents.Adorner类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Documents.Adorner的典型用法代码示例。如果您正苦于以下问题:C# Adorner类的具体用法?C# Adorner怎么用?C# Adorner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Adorner类属于System.Windows.Documents命名空间,在下文中一共展示了Adorner类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ResizeThumb_DragStarted

        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = this.DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as ContentPresenter;

                if (this.canvas != null)
                {
                    this.transformOrigin = this.designerItem.RenderTransformOrigin;

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform != null)
                    {
                        this.angle = this.rotateTransform.Angle * Math.PI / 180.0;
                    }
                    else
                    {
                        this.angle = 0.0d;
                    }

                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                    if (adornerLayer != null)
                    {
                        this.adorner = new SizeAdorner(this.designerItem);
                        adornerLayer.Add(this.adorner);
                    }
                }
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:31,代码来源:ResizeThumb.cs


示例2: item_OnDragStart

 private void item_OnDragStart(Adorner adorner)
 {
     if (OnDragStart != null)
     {
         OnDragStart(adorner);
     }
 }
开发者ID:marquinio007,项目名称:Touchmote,代码行数:7,代码来源:KeymapOutputRow.xaml.cs


示例3: ShowAdorner

        public void ShowAdorner()
        {
            if (this.adorner == null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    ContentControl element = this.DataContext as ContentControl;
                    Canvas canvas = VisualTreeHelper.GetParent(element) as Canvas;
                    this.adorner = new ResizeAdorner(element);
                    adornerLayer.Add(this.adorner);
                    if (this.ShowDecorator)
                    {
                        this.adorner.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        this.adorner.Visibility = Visibility.Hidden;
                    }
                }
            }
            else
            {
                this.adorner.Visibility = Visibility.Visible;
            }
        }
开发者ID:AaronRevilla,项目名称:TT_2012b-049_ComputerGraphics,代码行数:27,代码来源:ResizeDecorator.cs


示例4: OnLoaded

 private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
 {
     canvas = this.GetVisualChild<Canvas>();
     adornerlayer = AdornerLayer.GetAdornerLayer(this);
     var designableDragAndResizeChrome = new DesignableResizeChrome(selection);
     selectionAdorner = new DesignableResizeAdorner(canvas, selection, designableDragAndResizeChrome);
 }
开发者ID:modulexcite,项目名称:Glass-Legacy,代码行数:7,代码来源:Designer.cs


示例5: AssertTemplatedAdornerTypee

 private static void AssertTemplatedAdornerTypee(Adorner adorner, [CallerMemberName] string caller = null)
 {
     if (adorner?.GetType() != TemplatedAdornerType)
     {
         throw new InvalidOperationException($"{caller} can only be called on {TemplatedAdornerType}");
     }
 }
开发者ID:JohanLarsson,项目名称:Gu.Wpf.Adorners,代码行数:7,代码来源:TemplatedAdorner.cs


示例6: ShowAdorner

        private void ShowAdorner()
        {
            if (this.adorner == null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    ContentControl designerItem = this.DataContext as ContentControl;
                    Canvas canvas = VisualTreeHelper.GetParent(designerItem) as Canvas;
                    this.adorner = new ResizeRotateAdorner(designerItem);
                    adornerLayer.Add(this.adorner);

                    if (this.ShowDecorator)
                    {
                        this.adorner.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        this.adorner.Visibility = Visibility.Hidden;
                    }
                }
            }
            else
            {
                this.adorner.Visibility = Visibility.Visible;
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:28,代码来源:DesignerItemDecorator.cs


示例7: ShowAdorner

        private void ShowAdorner()
        {
            if (adorner == null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    ContentControl designerItem = this.DataContext as ContentControl;
                    Canvas canvas = Algorithm.FindVisualParent<Canvas>(designerItem);
                    adorner = new DesignerItemAdorner(designerItem,new ResizeRotateControl());
                    adornerLayer.Add(adorner);

                    if (ShowDecorator)
                    {
                        adorner.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        adorner.Visibility = Visibility.Collapsed;
                    }
                }
            }
            else
            {
                adorner.Visibility = Visibility.Visible;
            }
        }
开发者ID:huangjia2107,项目名称:MouseRegion,代码行数:28,代码来源:DesignerItemDecorator.cs


示例8: item_OnDragStop

 private void item_OnDragStop(Adorner adorner)
 {
     if (OnDragStop != null)
     {
         OnDragStop(adorner);
     }
 }
开发者ID:marquinio007,项目名称:Touchmote,代码行数:7,代码来源:KeymapOutputRow.xaml.cs


示例9: AdorneredTooltip

        public AdorneredTooltip(Adorner adorner, bool adornerLayerVisible)
        {
            Argument.IsNotNull(() => adorner);

            _adornerLayerVisible = adornerLayerVisible;
            _adorner = adorner;
            _visible = _adorner.Visibility == Visibility.Visible;
        }
开发者ID:icygit,项目名称:Orchestra,代码行数:8,代码来源:AdorneredTooltip.cs


示例10: Add

        public void Add(FrameworkElement parentControl, Adorner tooltip, bool adornerLayerVisibility)
        {
            if (!Contains(parentControl))
            {
                CreateAdornersList(parentControl);
            }

            GetAdorners(parentControl).Add(_factory.Create(tooltip, adornerLayerVisibility));
        }
开发者ID:icygit,项目名称:Orchestra,代码行数:9,代码来源:AdorneredTooltipsCollection.cs


示例11: ResizeDecorator_Unloaded

 private void ResizeDecorator_Unloaded(object sender, RoutedEventArgs e)
 {
     if (_adorner != null)
     {
         AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
         if (adornerLayer != null)
             adornerLayer.Remove(_adorner);
         _adorner = null;
     }
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:10,代码来源:ResizeDecorator.cs


示例12: ResizeThumb_DragCompleted

        private void ResizeThumb_DragCompleted(object sender, DragCompletedEventArgs e)
        {
            if (adorner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                if (adornerLayer != null)
                {
                    adornerLayer.Remove(this.adorner);
                }

                adorner = null;
            }
        }
开发者ID:benneeh,项目名称:wScreenshot,代码行数:13,代码来源:ResizeThumb.cs


示例13: DesignerItemDecorator_Unloaded

        private void DesignerItemDecorator_Unloaded(object sender, RoutedEventArgs e)
        {
            if (this.adorner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
                if (adornerLayer != null)
                {
                    adornerLayer.Remove(this.adorner);
                }

                this.adorner = null;
            }
        }
开发者ID:jgkim999,项目名称:WpfExample,代码行数:13,代码来源:DesignerItemDecorator.cs


示例14: dc_PropertyChanged

 void dc_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "LeftPictureLocation")
     {
         var doesThisWork = VisualTreeHelper.GetChild(leftItemsControl, 0);
         var doesThisWorkt = VisualTreeHelper.GetChild(doesThisWork, 0);
         var doesThisWorktt = VisualTreeHelper.GetChild(doesThisWorkt, 0);
         canvasToTouch = (Canvas)doesThisWorktt;
         myAdornerLayer = AdornerLayer.GetAdornerLayer((Visual)doesThisWorktt);
         ad = new SimpleCircleAdorner((UIElement)doesThisWorktt);
         myAdornerLayer.Add(ad);
         myAdornerLayer.IsHitTestVisible = false;
     }
 }
开发者ID:millertrevor,项目名称:visionexperiments,代码行数:14,代码来源:MainWindow.xaml.cs


示例15: Show

 private static void Show(Adorner adorner, bool retry)
 {
     var adornerLayer = AdornerLayer.GetAdornerLayer(adorner.AdornedElement);
     if (adornerLayer != null)
     {
         ////Debug.WriteLine(nameof(Show));
         adornerLayer.Remove(adorner);
         adornerLayer.Add(adorner);
     }
     else if (retry)
     {
         // try again later, perhaps giving layout a chance to create the adorner layer
         adorner.Dispatcher.BeginInvoke(
             DispatcherPriority.Loaded,
             new DispatcherOperationCallback(ShowAdornerOperation),
             new object[] { adorner });
     }
 }
开发者ID:JohanLarsson,项目名称:Gu.Wpf.Adorners,代码行数:18,代码来源:AdornerService.cs


示例16: ShowAdorner

 private void ShowAdorner()
 {
     if (_adorner == null)
     {
         AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
         if (adornerLayer != null)
         {
             DesignerItem designerItem = DataContext as DesignerItem;
             _adorner = new ResizeAdorner(designerItem);
             adornerLayer.Add(_adorner);
             if (ShowDecorator)
                 _adorner.Visibility = Visibility.Visible;
             else
                 _adorner.Visibility = Visibility.Hidden;
         }
     }
     else
         _adorner.Visibility = Visibility.Visible;
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:19,代码来源:ResizeDecorator.cs


示例17: Remove

        public void Remove(Adorner adorner)
        {
            if (_Adorners.ContainsValue(adorner))
            {
                _AdornerLayer.Remove(adorner);

                string name = string.Empty;

                foreach (string key in _Adorners.Keys)
                {
                    if (_Adorners[key].Equals(adorner))
                    {
                        name = key;
                        break;
                    }
                }

                if (!String.IsNullOrWhiteSpace(name))
                {
                    _Adorners.Remove(name);
                }
            }
        }
开发者ID:BdGL3,项目名称:CXPortal,代码行数:23,代码来源:AdornerLayerManager.cs


示例18: CircleCanvas_OnMouseLeftButtonDown

        private void CircleCanvas_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Console.Out.WriteLine("OnMouseLeftButtonDown");
            var layer = AdornerLayer.GetAdornerLayer(this.CircleCanvas);
            if (this.adorner != null)
            {
                layer.Remove(this.adorner);
                this.adorner = null;
            }

            var shape = e.Source as Shape;
            if (shape != null)
            {
                shape.InputHitTest(e.GetPosition(shape));
                this.isMoving = true;
                this.currentPoint = e.GetPosition(this.CircleCanvas);
                this.currentShape = shape;
                this.adorner = new Resources.Controls.Adorners.SelectionAdorner(shape);
                layer.Add(this.adorner);
                this.CircleCanvas.CaptureMouse();
            }

            e.Handled = true;
        }
开发者ID:Orange637,项目名称:WpfStudy,代码行数:24,代码来源:SelectionAdorner.xaml.cs


示例19: ShowAdorner

        private void ShowAdorner()
        {
            // the ConnectionAdorner is created once for each Connection
            if (this.connectionAdorner == null)
            {
                DesignerCanvas designer = VisualTreeHelper.GetParent(this) as DesignerCanvas;

                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
                if (adornerLayer != null)
                {
                    this.connectionAdorner = new ConnectionAdorner(designer, this);
                    adornerLayer.Add(this.connectionAdorner);
                }
            }
            this.connectionAdorner.Visibility = Visibility.Visible;
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:16,代码来源:Connection.cs


示例20: Connection_Unloaded

        void Connection_Unloaded(object sender, RoutedEventArgs e)
        {
            // do some housekeeping when Connection is unloaded

            // remove event handler
            source.PropertyChanged -= new PropertyChangedEventHandler(OnConnectorPositionChanged);
            sink.PropertyChanged -= new PropertyChangedEventHandler(OnConnectorPositionChanged);

            // remove adorner
            if (this.connectionAdorner != null)
            {
                DesignerCanvas designer = VisualTreeHelper.GetParent(this) as DesignerCanvas;

                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(designer);
                if (adornerLayer != null)
                {
                    adornerLayer.Remove(this.connectionAdorner);
                    this.connectionAdorner = null;
                }
            }
        }
开发者ID:NKnusperer,项目名称:DEISE,代码行数:21,代码来源:Connection.cs



注:本文中的System.Windows.Documents.Adorner类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Documents.Block类代码示例发布时间:2022-05-26
下一篇:
C# Data.PagedCollectionView类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap