private void PopulateLayers() { if (this.ParentPanel == null) { return; } EnumerableFunctions.ForEachWithIndex <Panel>((IEnumerable <Panel>) this._layers.Values, (Action <Panel, int>)((item, index) => this.AddChildPanel((UIElement)item))); }
public void RemoveAllLayers() { if (this._parentPanel != null) { EnumerableFunctions.ForEachWithIndex <Panel>((IEnumerable <Panel>) this._layers.Values, (Action <Panel, int>)((item, index) => this.ParentPanel.Children.Remove((UIElement)item))); } this._layers.Clear(); }
protected virtual void CreateView() { EnumerableFunctions.ForEachWithIndex <AxisPresenter.AxisPanelType>((IEnumerable <AxisPresenter.AxisPanelType>) this.PanelsDictionary.Keys, (Action <AxisPresenter.AxisPanelType, int>)((item, index) => this.GetAxisPanel(item))); this.SetBinding(AxisPresenter.VisibilityListenerProperty, (BindingBase) new Binding("Visibility") { Source = (object)this.Axis }); }
protected override void Populate(double availableLength) { this._majorGridLinePool.ReleaseAll(); this._minorGridLinePool.ReleaseAll(); if (this.Presenter.IsMinorGridlinesVisible) { this._majorGridLinePool.AdjustPoolSize(); } try { this.PrepareOppositeAxisLine(); foreach (ScaleElementDefinition elementDefinition in (IEnumerable <ScaleElementDefinition>) new List <ScaleElementDefinition>((IEnumerable <ScaleElementDefinition>)Enumerable.OrderBy <ScaleElementDefinition, int>(Enumerable.Where <ScaleElementDefinition>(this.Presenter.GetScaleElements(), (Func <ScaleElementDefinition, bool>)(p => p.Kind == ScaleElementKind.Tickmark)), (Func <ScaleElementDefinition, int>)(p => p.Group != ScaleElementGroup.Major ? 0 : 1)))) { if (elementDefinition.Group == ScaleElementGroup.Major && this.Axis.ShowMajorGridlines) { EnumerableFunctions.ForEachWithIndex <ScalePosition>(Enumerable.Where <ScalePosition>(elementDefinition.Positions, (Func <ScalePosition, bool>)(p => { if (p.Position >= 0.0) { return(p.Position <= 1.0); } return(false); })), (Action <ScalePosition, int>)((position, index) => XYAxisElementsPanel.SetCoordinate((UIElement)this._majorGridLinePool.Get(this.Axis), position.Position))); } if (elementDefinition.Group == ScaleElementGroup.Minor && this.Presenter.IsMinorGridlinesVisible) { EnumerableFunctions.ForEachWithIndex <ScalePosition>(Enumerable.Where <ScalePosition>(elementDefinition.Positions, (Func <ScalePosition, bool>)(p => { if (p.Position >= 0.0) { return(p.Position <= 1.0); } return(false); })), (Action <ScalePosition, int>)((position, index) => XYAxisElementsPanel.SetCoordinate((UIElement)this._minorGridLinePool.Get(this.Axis), position.Position))); } } } finally { if (!this.Presenter.IsMinorGridlinesVisible) { this._majorGridLinePool.AdjustPoolSize(); } this._minorGridLinePool.AdjustPoolSize(); } }
protected override void UpdateRelatedSeriesPresenters() { this.ChartArea.UpdateSession.BeginUpdates(); if (this.XYChartArea != null) { EnumerableFunctions.ForEachWithIndex <XYSeries>(Enumerable.Where <XYSeries>((IEnumerable <XYSeries>) this.XYChartArea.Series, (Func <XYSeries, bool>)(item => { if (item.GetType() == this.Series.GetType()) { return(item != this.Series); } return(false); })), (Action <XYSeries, int>)((item, index) => this.ChartArea.UpdateSession.Update((IUpdatable)item))); } base.UpdateRelatedSeriesPresenters(); this.ChartArea.UpdateSession.EndUpdates(); }
public void Begin() { this._runningStoryboards = this.Children.Count; EnumerableFunctions.ForEachWithIndex <Storyboard>((IEnumerable <Storyboard>) this.Children, (Action <Storyboard, int>)((item, index) => { item.Completed += (EventHandler)((source, args) => { item.Stop(); --this._runningStoryboards; if (this._runningStoryboards != 0 || this.Completed == null) { return; } this.Completed((object)this, EventArgs.Empty); }); item.Begin(); })); }
public void Update() { EnumerableFunctions.ForEachWithIndex <IUpdatable>(Enumerable.OfType <IUpdatable>((IEnumerable)this.Children), (Action <IUpdatable, int>)((item, index) => item.Update())); }
protected void CreateView(IEnumerable <DataPoint> dataPoints) { EnumerableFunctions.ForEachWithIndex <DataPoint>(dataPoints, (Action <DataPoint, int>)((item, index) => this.CreateView(item))); }
public void Stop() { EnumerableFunctions.ForEachWithIndex <Storyboard>((IEnumerable <Storyboard>) this.Children, (Action <Storyboard, int>)((item, index) => item.Stop())); this._runningStoryboards = 0; }
protected override void Populate(double availableLength) { this._majorTickMarkPool.ReleaseAll(); this._minorTickMarkPool.ReleaseAll(); if (this.Presenter.IsMinorTickMarksVisible) { this._majorTickMarkPool.AdjustPoolSize(); } try { this.PrepareAxisLine(); this.PrepareScrollBar(); if (!this.Axis.ShowMajorTickMarks && !this.Presenter.IsMinorTickMarksVisible) { return; } foreach (ScaleElementDefinition elementDefinition in (IEnumerable <ScaleElementDefinition>) new List <ScaleElementDefinition>((IEnumerable <ScaleElementDefinition>)Enumerable.OrderBy <ScaleElementDefinition, int>(Enumerable.Where <ScaleElementDefinition>(this.Presenter.GetScaleElements(), (Func <ScaleElementDefinition, bool>)(p => p.Kind == ScaleElementKind.Tickmark)), (Func <ScaleElementDefinition, int>)(p => p.Group != ScaleElementGroup.Major ? 0 : 1)))) { if (elementDefinition.Group == ScaleElementGroup.Major && this.Axis.ShowMajorTickMarks && !this.LabelsUseCategoryTickmarks) { EnumerableFunctions.ForEachWithIndex <ScalePosition>(Enumerable.Where <ScalePosition>(elementDefinition.Positions, (Func <ScalePosition, bool>)(p => { if (p.Position >= 0.0) { return(p.Position <= 1.0); } return(false); })), (Action <ScalePosition, int>)((position, index) => { RotatableControl rotatableControl = this._majorTickMarkPool.Get(this.Axis); XYAxisElementsPanel.SetCoordinate((UIElement)rotatableControl, position.Position); XYAxisElementsPanel.SetPosition((UIElement)rotatableControl, ((TickMark)rotatableControl.Child).Position); })); } if (elementDefinition.Group == ScaleElementGroup.Minor && this.Presenter.IsMinorTickMarksVisible) { EnumerableFunctions.ForEachWithIndex <ScalePosition>(Enumerable.Where <ScalePosition>(elementDefinition.Positions, (Func <ScalePosition, bool>)(p => { if (DoubleHelper.GreaterOrEqualWithPrecision(p.Position, 0.0)) { return(DoubleHelper.LessOrEqualWithPrecision(p.Position, 1.0)); } return(false); })), (Action <ScalePosition, int>)((position, index) => { RotatableControl rotatableControl = this._minorTickMarkPool.Get(this.Axis); XYAxisElementsPanel.SetCoordinate((UIElement)rotatableControl, position.Position); XYAxisElementsPanel.SetPosition((UIElement)rotatableControl, ((TickMark)rotatableControl.Child).Position); })); } } } finally { if (!this.Presenter.IsMinorTickMarksVisible) { this._majorTickMarkPool.AdjustPoolSize(); } this._minorTickMarkPool.AdjustPoolSize(); } }
protected virtual void RemoveView() { EnumerableFunctions.ForEachWithIndex <AxisPresenter.AxisPanelType>((IEnumerable <AxisPresenter.AxisPanelType>) this.PanelsDictionary.Keys, (Action <AxisPresenter.AxisPanelType, int>)((item, index) => this.ChartArea.ChartAreaLayerProvider.RemoveLayer((object)new Tuple <Axis, AxisPresenter.AxisPanelType>(this.Axis, item)))); }