Esempio n. 1
0
 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)));
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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
     });
 }
Esempio n. 4
0
 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();
     }
 }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
 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();
     }));
 }
Esempio n. 7
0
 public void Update()
 {
     EnumerableFunctions.ForEachWithIndex <IUpdatable>(Enumerable.OfType <IUpdatable>((IEnumerable)this.Children), (Action <IUpdatable, int>)((item, index) => item.Update()));
 }
Esempio n. 8
0
 protected void CreateView(IEnumerable <DataPoint> dataPoints)
 {
     EnumerableFunctions.ForEachWithIndex <DataPoint>(dataPoints, (Action <DataPoint, int>)((item, index) => this.CreateView(item)));
 }
Esempio n. 9
0
 public void Stop()
 {
     EnumerableFunctions.ForEachWithIndex <Storyboard>((IEnumerable <Storyboard>) this.Children, (Action <Storyboard, int>)((item, index) => item.Stop()));
     this._runningStoryboards = 0;
 }
Esempio n. 10
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();
     }
 }
Esempio n. 11
0
 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))));
 }