当前位置: 首页>>代码示例>>C#>>正文


C# Entry.Tick方法代码示例

本文整理汇总了C#中Entry.Tick方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.Tick方法的具体用法?C# Entry.Tick怎么用?C# Entry.Tick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry.Tick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SimpleCarouselControl

        public SimpleCarouselControl(int DefaultWidth, int DefaultHeight)
        {
            this.Container = new Canvas
            {
                Width = DefaultWidth,
                Height = DefaultHeight
            };

            var ContentContainer = new Canvas
            {
                Width = DefaultWidth,
                Height = DefaultHeight
            }.AttachTo(this.Container);

            this.Caption = new TextBox
            {
                Width = DefaultWidth,
                Height = 32,
                TextAlignment = TextAlignment.Center,
                Foreground = Brushes.White,
                BorderThickness = new Thickness(0),
                Background = Brushes.Transparent,
                IsReadOnly = true
            }.MoveTo(0, (DefaultHeight - 32) / 2).AttachTo(this.Container);

            this.Overlay = new Canvas
            {
                Width = DefaultWidth,
                Height = DefaultHeight,
            };

            var OverlayFill = new Rectangle
            {
                Width = DefaultWidth,
                Height = DefaultHeight,
                Fill = Brushes.Red,
                Opacity = 0
            }.AttachTo(this.Overlay);

            var a = new List<Entry>();

            var OverlayReorderingEnabled = true;

            #region Timer
            this.Timer = (1000 / 30).AtInterval(
                delegate
                {
                    a.ForEach(k => k.Tick());

                    a.OrderBy(k => k.cy).ForEach(
                        k =>
                        {

                            if (OverlayReorderingEnabled)
                            {
                                // in javascript reordering an element under mouse
                                // will leave you without the leave event
                                // we could sort other nodes around it tho

                                k.Overlay.Orphanize();
                                k.Overlay.AttachTo(this.Overlay);
                            }

                            k.pc.Orphanize();
                            k.pc.AttachTo(this.Container);

                        }
                    );
                }
            );
            #endregion


            var s = 0.01;

            this.AddEntry =
                e =>
                {
                    var pc_Width = 166 + 9;
                    var pc_Height = 90 + 9 * 2;

                    var pc = new Canvas
                    {
                        //Background = Brushes.Green,
                        Width = pc_Width,
                        Height = pc_Height
                    }.AttachTo(ContentContainer);

                    const string Assets = "assets/ScriptCoreLib.Avalon.Carousel";

                    var p = new Image
                    {
                        Width = 166,
                        Height = 90,
                        Stretch = Stretch.Fill,
                        Source = (Assets + "/PreviewShadow.png").ToSource()
                    }.AttachTo(pc);


                    var ps = new Image
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:SimpleCarouselControl.cs


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