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


C# Iterator.Start方法代码示例

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


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

示例1: Window_Loaded


//.........这里部分代码省略.........
            Mode = BindingMode.OneWay,
              };

              visSourceBinding = new Binding("Source") {
            Source = vis,
            Mode = BindingMode.OneWay,
              };

              BindingOperations.SetBinding(iter, Iterator.WidthProperty, iterWidthBinding);
              BindingOperations.SetBinding(iter, Iterator.HeightProperty, iterHeightBinding);
              BindingOperations.SetBinding(Img, Image.SourceProperty, visSourceBinding);

              iter.CenterX = 0;
              iter.CenterY = 0;
              iter.Scale = 1;

            #if true
              vis.SetPalette(new[] {
              Colors.LightSeaGreen,
              Colors.LightSkyBlue,
              Colors.DarkSlateBlue,
              Colors.DarkOrchid,
              Colors.Firebrick,
              Colors.Crimson,
              Colors.Gold,
              Colors.PaleGreen,
              Colors.ForestGreen,
            });

              vis.LiveColor = Colors.Black;
              vis.PaletteType = VisPaletteType.Relative;
              vis.Scale = 1;
              vis.Offset = 0;
            #else
            #if false
              vis.SetPalette(new[] {
              Colors.Firebrick,
              Colors.Gold,
              //Colors.Linen,
              Colors.FloralWhite,
            }, false);
            #else
              vis.SetPalette(new[] {
            Colors.MidnightBlue,
            Colors.DarkSlateBlue,
            Colors.SlateBlue,
            Colors.Lavender,
            Colors.GhostWhite,
              }, false);
            #endif
              vis.LiveColor = Colors.Black;
              vis.PaletteType = VisPaletteType.Relative;
              vis.Scale = 1;
              vis.Offset = 0;
            #endif

              iter.Resized += delegate (int bWidth, int bHeight, int iWidth, int iHeight, int spls, long bLength) {
            MinProgress.IsIndeterminate =
              MaxProgress.IsIndeterminate = true;

            Progress.Visibility = Visibility.Visible;
            //Palette.Visibility = Visibility.Hidden;

            TaskbarInfo.ProgressState = TaskbarItemProgressState.Indeterminate;
              };

              iter.Iterated += async delegate (Iterator sender2, IteratedEventArgs e2) {
            try {
              await Dispatcher.BeginInvoke(new Action(delegate () {
            this.Title = String.Format("{1}Iteration {0} ({2:000.00}%); Center ({3:E6}, {4:E6}); Zoom {5}",
              e2.Current + 1,
              e2.IsDone ? "[Done] " : "",
              Math.Floor(e2.Progress * 10000) / 100,
              iter.CenterX,
              iter.CenterY,
              exp);

            MinProgress.IsIndeterminate =
              MaxProgress.IsIndeterminate = false;
            MinProgress.Value = Math.Min(e2.PixelProgress, e2.IterProgress);
            MaxProgress.Value = Math.Max(e2.PixelProgress, e2.IterProgress);

            if (e2.IsDone) {
              Progress.Visibility = Visibility.Hidden;
              Palette.Visibility = Visibility.Visible;
            }

            TaskbarInfo.ProgressState = e2.IsDone ? TaskbarItemProgressState.None : TaskbarItemProgressState.Normal;
            TaskbarInfo.ProgressValue = e2.Progress;
              }));
            }
            catch (TaskCanceledException) { }
              };

              TaskbarInfo.ProgressState = TaskbarItemProgressState.Indeterminate;

              iter.Start();

              PaletteImg.Source = vis.DrawGradient((int)PaletteGrid.ActualWidth, (int)PaletteGrid.ActualHeight);
        }
开发者ID:rookie1024,项目名称:JuliaSet,代码行数:101,代码来源:MainWindow.xaml.cs


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