public override bool Apply(bool disposeController) { _doc.Font = _view.LabelFont; _doc.Brush = _view.LabelMaterial; _doc.AlignmentX = (Alignment)_alignmentChoicesX.FirstSelectedNode.Tag; _doc.AlignmentY = (Alignment)_alignmentChoicesY.FirstSelectedNode.Tag; _doc.AlignmentZ = (Alignment)_alignmentChoicesZ.FirstSelectedNode.Tag; _doc.AutomaticAlignment = _view.AutomaticAlignment; _doc.RotationX = _view.RotationX; _doc.RotationY = _view.RotationY; _doc.RotationZ = _view.RotationZ; _doc.OffsetX = _view.OffsetX; _doc.OffsetY = _view.OffsetY; _doc.OffsetZ = _view.OffsetZ; _doc.BackgroundStyle = _view.Background; if (GUIConversion.TryParseMultipleAltaxoVariant(_view.SuppressedLabelsByValue, out var varVals)) { _doc.SuppressedLabels.ByValues.Clear(); foreach (AltaxoVariant v in varVals) { _doc.SuppressedLabels.ByValues.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleInt32(_view.SuppressedLabelsByNumber, out var intVals)) { _doc.SuppressedLabels.ByNumbers.Clear(); foreach (int v in intVals) { _doc.SuppressedLabels.ByNumbers.Add(v); } } else { return(false); } _doc.PrefixText = _view.PrefixText; _doc.SuffixText = _view.PostfixText; var labelSideNode = _labelSides.FirstSelectedNode; if (null != labelSideNode) { _doc.LabelSide = (CSAxisSide?)labelSideNode.Tag; } if (null != _labelFormattingSpecificController && !_labelFormattingSpecificController.Apply(disposeController)) { return(false); } return(ApplyEnd(true, disposeController)); }
public override bool Apply(bool disposeController) { _doc.Font = _view.LabelFont; _doc.Brush = _view.LabelBrush.Clone(); _doc.HorizontalAlignment = (StringAlignment)_horizontalAlignmentChoices.FirstSelectedNode.Tag; _doc.VerticalAlignment = (StringAlignment)_verticalAlignmentChoices.FirstSelectedNode.Tag; _doc.AutomaticAlignment = _view.AutomaticAlignment; _doc.Rotation = _view.Rotation; _doc.XOffset = _view.XOffset; _doc.YOffset = _view.YOffset; _doc.BackgroundStyle = _view.Background; if (GUIConversion.TryParseMultipleAltaxoVariant(_view.SuppressedLabelsByValue, out var varVals)) { _doc.SuppressedLabels.ByValues.Clear(); foreach (AltaxoVariant v in varVals) { _doc.SuppressedLabels.ByValues.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleInt32(_view.SuppressedLabelsByNumber, out var intVals)) { _doc.SuppressedLabels.ByNumbers.Clear(); foreach (int v in intVals) { _doc.SuppressedLabels.ByNumbers.Add(v); } } else { return(false); } _doc.PrefixText = _view.PrefixText; _doc.SuffixText = _view.PostfixText; var labelSideNode = _labelSides.FirstSelectedNode; if (null != labelSideNode) { _doc.LabelSide = (CSAxisSide?)labelSideNode.Tag; } if (null != _labelFormattingSpecificController && !_labelFormattingSpecificController.Apply(disposeController)) { return(false); } return(ApplyEnd(true, disposeController)); }
public override bool Apply(bool disposeController) { if (GUIConversion.TryParseMultipleAltaxoVariant(_view.SuppressMajorTickValues, out var varVals)) { _doc.SuppressedMajorTicks.ByValues.Clear(); foreach (AltaxoVariant v in varVals) { _doc.SuppressedMajorTicks.ByValues.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleAltaxoVariant(_view.SuppressMinorTickValues, out varVals)) { _doc.SuppressedMinorTicks.ByValues.Clear(); foreach (AltaxoVariant v in varVals) { _doc.SuppressedMinorTicks.ByValues.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleInt32(_view.SuppressMajorTicksByNumber, out var intVals)) { _doc.SuppressedMajorTicks.ByNumbers.Clear(); foreach (int v in intVals) { _doc.SuppressedMajorTicks.ByNumbers.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleInt32(_view.SuppressMinorTicksByNumber, out intVals)) { _doc.SuppressedMinorTicks.ByNumbers.Clear(); foreach (int v in intVals) { _doc.SuppressedMinorTicks.ByNumbers.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleAltaxoVariant(_view.AddMajorTickValues, out varVals)) { _doc.AdditionalMajorTicks.Clear(); foreach (AltaxoVariant v in varVals) { _doc.AdditionalMajorTicks.Add(v); } } else { return(false); } if (GUIConversion.TryParseMultipleAltaxoVariant(_view.AddMinorTickValues, out varVals)) { _doc.AdditionalMinorTicks.Clear(); foreach (AltaxoVariant v in varVals) { _doc.AdditionalMinorTicks.Add(v); } } else { return(false); } // MajorTicks were validated and set before _doc.MinorTicks = _view.MinorTicks; _doc.TargetNumberOfMajorTicks = _view.TargetNumberMajorTicks; _doc.TargetNumberOfMinorTicks = _view.TargetNumberMinorTicks; _doc.ZeroLever = _view.ZeroLever; _doc.OrgGrace = _view.MinGrace; _doc.EndGrace = _view.MaxGrace; _doc.SnapOrgToTick = (BoundaryTickSnapping)_snapTicksToOrg.FirstSelectedNode.Tag; _doc.SnapEndToTick = (BoundaryTickSnapping)_snapTicksToEnd.FirstSelectedNode.Tag; return(ApplyEnd(true, disposeController)); }