VixenModules.App.Curves.CurveEditor.PopulateFormWithCurve C# (CSharp) Méthode

PopulateFormWithCurve() private méthode

private PopulateFormWithCurve ( Curve curve ) : void
curve Curve
Résultat void
        private void PopulateFormWithCurve(Curve curve)
        {
            zedGraphControl.GraphPane.Chart.Fill = new Fill(ThemeColorTable.BackgroundColor);
            zedGraphControl.GraphPane.Chart.Border.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.XAxis.MajorGrid.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.XAxis.MinorGrid.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.XAxis.MajorTic.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.XAxis.MinorTic.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.YAxis.MajorGrid.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.YAxis.MinorGrid.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.YAxis.MajorTic.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.YAxis.MinorTic.Color = ThemeColorTable.GroupBoxBorderColor;
            zedGraphControl.GraphPane.Title.FontSpec.FontColor = ThemeColorTable.ForeColor;
            zedGraphControl.GraphPane.XAxis.Scale.FontSpec.FontColor = ThemeColorTable.ForeColor;
            zedGraphControl.GraphPane.YAxis.Scale.FontSpec.FontColor = ThemeColorTable.ForeColor;

            // if we're editing a curve from the library, treat it special
            if (curve.IsCurrentLibraryCurve) {
                zedGraphControl.GraphPane.CurveList.Clear();
                zedGraphControl.DragEditingPair = null;
                zedGraphControl.GraphPane.AddCurve(string.Empty, curve.Points, Curve.ActiveCurveGridColor);
                if (LibraryCurveName == null) {
                    labelCurve.Text = "This curve is a library curve.";
                    Text = "Curve Editor: Library Curve";
                }
                else {
                    labelCurve.Text = "This curve is the library curve: " + LibraryCurveName;
                    Text = "Curve Editor: Library Curve " + LibraryCurveName;
                }

                zedGraphControl.IsEnableHEdit = true;
                zedGraphControl.IsEnableVEdit = true;
                ReadonlyCurve = false;
                buttonSaveCurveToLibrary.Enabled = false;
                buttonLoadCurveFromLibrary.Enabled = false;
                buttonUnlinkCurve.Enabled = false;
                buttonEditLibraryCurve.Enabled = false;
                btnInvert.Enabled = true;
                btnReverse.Enabled = true;
                labelInstructions1.Visible = true;
                labelInstructions2.Visible = true;
                txtXValue.Enabled = false;
                txtYValue.Enabled = false;
                txtXValue.Text = string.Empty;
                txtYValue.Text = string.Empty;
                btnUpdateCoordinates.Enabled = false;

            }
            else {
                if (curve.IsLibraryReference) {
                    zedGraphControl.GraphPane.CurveList.Clear();
                    LineItem item = zedGraphControl.GraphPane.AddCurve(string.Empty, curve.Points, Curve.InactiveCurveGridColor);
                    item.Symbol.Fill = new Fill(Curve.InactiveCurveGridColor);
                    labelCurve.Text = "This curve is linked to the library curve: " + curve.LibraryReferenceName;
                }
                else {
                    zedGraphControl.GraphPane.CurveList.Clear();
                    LineItem item = zedGraphControl.GraphPane.AddCurve(string.Empty, curve.Points, Curve.ActiveCurveGridColor);
                    item.Symbol.Fill = new Fill(Curve.ActiveCurveGridColor);
                    labelCurve.Text = "This curve is not linked to any in the library.";
                }
                zedGraphControl.DragEditingPair = null;
                zedGraphControl.IsEnableHEdit = !curve.IsLibraryReference;
                zedGraphControl.IsEnableVEdit = !curve.IsLibraryReference;
                ReadonlyCurve = curve.IsLibraryReference;
                buttonSaveCurveToLibrary.Enabled = !curve.IsLibraryReference;
                buttonLoadCurveFromLibrary.Enabled = true;
                buttonUnlinkCurve.Enabled = curve.IsLibraryReference;
                buttonEditLibraryCurve.Enabled = curve.IsLibraryReference;
                btnInvert.Enabled = !curve.IsLibraryReference;
                btnReverse.Enabled = !curve.IsLibraryReference;
                labelInstructions1.Visible = !curve.IsLibraryReference;
                labelInstructions2.Visible = !curve.IsLibraryReference;
                txtYValue.Enabled = !curve.IsLibraryReference;
                txtXValue.Enabled = !curve.IsLibraryReference;
                txtXValue.Text = string.Empty;
                txtYValue.Text = string.Empty;
                btnUpdateCoordinates.Enabled = false;

                Text = "Curve Editor";
            }

            zedGraphControl.Invalidate();
        }