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

C# Dock类代码示例

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

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



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

示例1: RenderSpiral

        public void RenderSpiral ()
        {
            var dock = new Dock()
                .AddChildren(
                    new Fill { Char = 'a', Width = 4, Margin = new Thickness(1, 1, 0, 1) }
                        .Set(Dock.ToProperty, DockTo.Left),
                    new Fill { Char = 'b', Height = 3, Margin = new Thickness(1, 1, 1, 0) }
                        .Set(Dock.ToProperty, DockTo.Top),
                    new Fill { Char = 'c', Width = 2, Margin = new Thickness(0, 1, 1, 1) }
                        .Set(Dock.ToProperty, DockTo.Right),
                    new Fill { Char = 'd', Height = 1, Margin = new Thickness(1, 0, 1, 1) }
                        .Set(Dock.ToProperty, DockTo.Bottom),
                    new Fill { Char = 'e', Margin = 1, Width = 2, Height = 2 }
                );

            GetRenderedText(dock, 12).Should().BeLines(
                "            ",
                " aaaa bbbbb ",
                " aaaa bbbbb ",
                " aaaa bbbbb ",
                " aaaa       ",
                " aaaa ee cc ",
                " aaaa ee cc ",
                " aaaa    cc ",
                " aaaa dd cc ",
                "            ");
        }
开发者ID:jhorv,项目名称:CsConsoleFormat,代码行数:27,代码来源:DockTests.cs


示例2: BoardInjector

 public BoardInjector()
 {
     dock = new Dock();
     DockPath = new LinkedList<MainTrack>();
     SavePath = new LinkedList<MainTrack>();
     SecondPath = new LinkedList<MainTrack>();
     ConSwitch = new ConvergingSwitch[5];
     for (int x = 0; x < ConSwitch.Length; x++)
     {
         ConSwitch[x] = new ConvergingSwitch();
     }
     DevSwitch = new DevergingSwitch[5];
     for (int x = 0; x < DevSwitch.Length; x++)
     {
         DevSwitch[x] = new DevergingSwitch();
     }
     Basis = new MainTrack[10];
     for (int x = 0; x < Basis.Length; x++)
     {
         Basis[x] = new MainTrack();
     }
     Warehouses = new Warehouse[3];
     for (int x = 0; x < Warehouses.Length; x++)
     {
         Warehouses[x] = new Warehouse();
     }
 }
开发者ID:glenndewildt,项目名称:Prog5RikGlenn,代码行数:27,代码来源:BoardInjector.cs


示例3: ShowInWindow

        /// <summary>
        /// Maximum Flexibility of Window Definition version of Show In Window
        /// </summary>
        /// <param name="window">THe Window in which to show this View</param>
        /// <param name="windowTitle">A Title for the Window</param>
        /// <param name="windowWidth">The Width of the Window</param>
        /// <param name="windowHeight">The Height of the Window</param>
        /// <param name="dock">How should the View be Docked</param>
        /// <param name="onWindowClosed">Event handler for when the window is closed</param>
        public void ShowInWindow(bool modal, ViewWindow window, string windowTitle, double windowWidth, double windowHeight, Dock dock, OnWindowClose onWindowClose)
        {
            this.onWindowClosed = onWindowClose;

            viewWindow = window;
            viewWindow.Title = windowTitle;

            DockPanel.SetDock(this, dock);
            // The viewWindow must have a dockPanel called WindowDockPanel. If you want to change this to use some other container on the window, then
            // the below code should be the only place it needs to be changed.
            viewWindow.WindowDockPanel.Children.Add(this);

            if (windowWidth == 0 && windowHeight == 0)
            {
                viewWindow.SizeToContent = SizeToContent.WidthAndHeight;
            }
            else
            {
                viewWindow.SizeToContent = SizeToContent.Manual;
                viewWindow.Width = windowWidth;
                viewWindow.Height = windowHeight;
            }

            if (modal)
            {
                viewWindow.ShowDialog();
            }
            else
            {
                viewWindow.Show();
            }
        }
开发者ID:ReneNNielsen,项目名称:SkemaMVVM,代码行数:41,代码来源:BaseView.cs


示例4: Dispatch

 //Undocks, sets crate, and triggers movement update
 public void Dispatch(Crate crate, Dock port)
 {
     HeldCrate = crate;
     Undock(port);
     reverse = port == Pipe.To;
     Move();
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:8,代码来源:Grabber.cs


示例5: OnGrabberDocked

 private void OnGrabberDocked(Dock port, Grabber grabber)
 {
     if(port == output && outputOverflow != null)
     {
         grabber.Dispatch(outputOverflow, port);
         outputOverflow = null;
     }
     else if(inputA.DockedGrabbers.Count > 0
        && inputB.DockedGrabbers.Count > 0
        && output.DockedGrabbers.Count > 0)
     {
         Crate inCrateA = inputA.DockedGrabbers[0].HeldCrate;
         Crate inCrateB = inputB.DockedGrabbers[0].HeldCrate;
         int featuresMoved = Mathf.Min (Crate.MaxFeatures - inCrateA.Features.Count, inCrateB.Features.Count);
         for(int i = 0; i < featuresMoved; i++)
         {
             inCrateA.Features.Add(inCrateB.Features[i]);
         }
         if(featuresMoved < inCrateB.Features.Count)
         {
             inCrateB.Features.RemoveRange (0, featuresMoved);
             outputOverflow = inCrateB;
         }
         inputA.DockedGrabbers[0].Dispatch(null, inputA);
         inputB.DockedGrabbers[0].Dispatch(null, inputB);
         output.DockedGrabbers[0].Dispatch(inCrateA, output);
     }
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:28,代码来源:PackRule.cs


示例6: OnMouseDown

        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            if (!IsEnabled) return;

            if (!IsMouseCaptured)
            {
                StartDragPoint = e.GetPosition(Parent as IInputElement);

                Panel ParentPanel = Parent as Panel;
                int i = ParentPanel.Children.IndexOf(this);

                // The splitter cannot be the first child of the parent DockPanel
                // The splitter works on the 'older' sibling
                if (i > 0 && ParentPanel.Children.Count > 0)
                {
                    _element = ParentPanel.Children[i - 1] as FrameworkElement;
                    _element = ParentPanel.Children[i - 1] as FrameworkElement;

                    if (_element != null)
                    {
                        _width = _element.ActualWidth;
                        _height = _element.ActualHeight;
                        _dock = DockPanel.GetDock(this);
                        CaptureMouse();
                    }
                }
            }

            base.OnMouseDown(e);
        }
开发者ID:vansickle,项目名称:dbexplorer,代码行数:30,代码来源:DockPanelSplitter.cs


示例7: DockablePane

        public DockablePane(ManagedContent content, Dock dock)
        {
            Dock = dock;
            _tabs.TabStripPlacement = Dock.Bottom;

            Add(content);
        }
开发者ID:truonghinh,项目名称:TnX,代码行数:7,代码来源:DockablePane.cs


示例8: SetDock

        /// <summary>
        /// Sets the value of the Dock attached property to a specified element.
        /// </summary>
        /// <param name="element">The element to which the attached property is written.</param>
        /// <param name="dock">The new Dock value.</param>
        public static void SetDock(UIElement element, Dock dock)
        {
            if (element == null)
                throw new ArgumentNullException("element");

            element.SetValue(DockProperty, dock);
        }
开发者ID:ComponentFactory,项目名称:Quicksilver,代码行数:12,代码来源:DockLayout.cs


示例9: Add

        public Pane Add(ManagedContent content, Dock dock)
        {
            DockablePane pane = new DockablePane(content, dock);

            Add(pane);

            return pane;
        }
开发者ID:truonghinh,项目名称:TnX,代码行数:8,代码来源:DockingGrid.cs


示例10: GrabberDocked

 void GrabberDocked(Dock dock, Grabber grabber)
 {
     if (grabber.HeldCrate == null)
     {
         Quantity--;
         grabber.Dispatch(new Crate(Crate), dock);
     }
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:8,代码来源:SupplyContract.cs


示例11: SlideMenu

        public SlideMenu(Dock docking, double width = 0)
        {
            InitializeComponent();
            Width = width;
            Show();
            Focus();
            SetDock(docking);

            Closed += SlideMenuClosed;
        }
开发者ID:ethanhs,项目名称:IronShell,代码行数:10,代码来源:SlideMenu.xaml.cs


示例12: BindPorts

 public void BindPorts(IList<Dock> inPorts, IList<Dock> outPorts)
 {
     inputA = inPorts[0];
     inputB = inPorts[1];
     output = outPorts[0];
     inputA.OnGrabberDocked += OnGrabberDocked;
     inputB.OnGrabberDocked += OnGrabberDocked;
     output.OnGrabberDocked += OnGrabberDocked;
     inputA.Effect = DockEffect.First;
     inputB.Effect = DockEffect.Last;
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:11,代码来源:PackRule.cs


示例13: BindPorts

 public void BindPorts(IList<Dock> inPorts, IList<Dock> outPorts)
 {
     input = inPorts[0];
     outputSingle = outPorts[0];
     outputRemainder = outPorts[1];
     input.OnGrabberDocked += OnGrabberDocked;
     outputSingle.OnGrabberDocked += OnGrabberDocked;
     outputRemainder.OnGrabberDocked += OnGrabberDocked;
     outputSingle.Effect = DockEffect.Last;
     outputRemainder.Effect = DockEffect.First;
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:11,代码来源:UnpackRule.cs


示例14: OverlayDockablePane

        public OverlayDockablePane(DockManager dockManager, DockableContent content, Dock initialDock)
            : base(dockManager, initialDock)
        {
            btnAutoHide.LayoutTransform = new RotateTransform(90);
            ReferencedPane = content.ContainerPane as DockablePane;
            ReferencedContent = content;
            Add(ReferencedContent);
            Show(ReferencedContent);
            ReferencedContent.SetContainerPane(ReferencedPane);

            _state = PaneState.AutoHide;
        }
开发者ID:vebin,项目名称:PhotoBrushProject,代码行数:12,代码来源:OverlayDockablePane.cs


示例15: GetAnchorForDock

 public IPipeDisplayAnchor GetAnchorForDock(Dock dock)
 {
     //TODO: Make not O(N)
     foreach(var anchor in pipeAnchors)
     {
         if(anchor.Dock == dock)
         {
             return anchor;
         }
     }
     return null;
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:12,代码来源:PipeEditManager.cs


示例16: OnMouseEnter

 protected override void OnMouseEnter(MouseEventArgs e)
 {
     base.OnMouseEnter(e);
     if (!IsEnabled) return;
     _dock = DockPanel.GetDock(this);
     if (_dock == Dock.Left || _dock == Dock.Right)
     {
         Cursor = Cursors.SizeWE;
     }
     else
     {
         Cursor = Cursors.SizeNS;
     }
 }
开发者ID:vansickle,项目名称:dbexplorer,代码行数:14,代码来源:DockPanelSplitter.cs


示例17: ChangeDock

        public void ChangeDock(DockablePane pane, Dock dock)
        {
            //if (dock == pane.Dock)
            //    return;

            //rimuovo innanizitutto il pane dalla griglia
            IPane resultPane = Remove(_rootPane, pane);
            if (resultPane != null)
                _rootPane = resultPane;

            pane.Dock = dock;
            //(pane.Parent as Grid).Children.Remove(pane);
            Add(pane);
        }
开发者ID:truonghinh,项目名称:TnX,代码行数:14,代码来源:DockingGrid.cs


示例18: GrabberDocked

 void GrabberDocked(Dock dock, Grabber grabber)
 {
     if (grabber.HeldCrate != null && grabber.HeldCrate.Features.Count == Crate.Features.Count)
     {
         for (int i = 0; i < grabber.HeldCrate.Features.Count; i++)
         {
             if (grabber.HeldCrate.Features[i] != Crate.Features[i])
             {
                 return;
             }
         }
         Quantity--;
         grabber.Dispatch(null, dock);
     }
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:15,代码来源:DeliveryContract.cs


示例19: GetPaneName

 private static string GetPaneName(Dock location)
 {
     switch (location)
     {
         case Dock.Left:
             return "LeftPane";
         case Dock.Right:
             return "RightPane";
         case Dock.Bottom:
             return "BottomPane";
         case Dock.Top:
             return "TopPane";
         default:
             throw new ArgumentOutOfRangeException("location");
     }
 }
开发者ID:DamianReeves,项目名称:SampleCode,代码行数:16,代码来源:LayoutInitializer.cs


示例20: Dock

 public void Dock(Dock dock)
 {
     DockedAt = dock;
     if(dock == Pipe.To)
     {
         NormalizedDistance = 1;
     }
     else if(dock == Pipe.From)
     {
         NormalizedDistance = 0;
     }
     else
     {
         Debug.LogError ("Grabber docked to port not on its pipe");
     }
     dock.DockGrabber(this);
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:17,代码来源:Grabber.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# DockAlignment类代码示例发布时间:2022-05-24
下一篇:
C# DocProject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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