本文整理汇总了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);
}