Example #1
0
		public virtual bool CopyFrom(object obj)
		{
			if (object.ReferenceEquals(this, obj))
				return true;
			var from = obj as AxisLabelStyle;
			if (null == from)
				return false;

			using (var suspendToken = SuspendGetToken())
			{
				_cachedAxisStyleInfo = from._cachedAxisStyleInfo;

				_font = from._font;
				_alignmentX = from._alignmentX;
				_alignmentY = from._alignmentY;
				_alignmentZ = from._alignmentZ;

				_brush = from._brush;

				_automaticRotationShift = from._automaticRotationShift;
				_offsetX = from._offsetX;
				_offsetY = from._offsetY;
				_offsetZ = from._offsetZ;
				_rotationX = from._rotationX;
				_rotationY = from._rotationY;
				_rotationZ = from._rotationZ;
				ChildCopyToMember(ref _backgroundStyle, from._backgroundStyle);
				ChildCopyToMember(ref _labelFormatting, from._labelFormatting);
				_labelSide = from._labelSide;
				_prefixText = from._prefixText;
				_postfixText = from._postfixText;
				ChildCopyToMember(ref _suppressedLabels, from._suppressedLabels);
				EhSelfChanged(EventArgs.Empty);

				suspendToken.Resume();
			}

			return true;
		}
Example #2
0
		public virtual bool CopyFrom(object obj)
		{
			if (object.ReferenceEquals(this, obj))
				return true;
			var from = obj as AxisLabelStyle;
			if (null == from)
				return false;

			using (var suspendToken = SuspendGetToken())
			{
				_cachedAxisStyleInfo = from._cachedAxisStyleInfo;

				_font = from._font;
				CopyHelper.Copy(ref _stringFormat, from._stringFormat);
				_horizontalAlignment = from._horizontalAlignment;
				_verticalAlignment = from._verticalAlignment;

				ChildCopyToMember(ref _brush, from._brush);

				_automaticRotationShift = from._automaticRotationShift;
				_xOffset = from._xOffset;
				_yOffset = from._yOffset;
				_rotation = from._rotation;
				ChildCopyToMember(ref _backgroundStyle, from._backgroundStyle);
				ChildCopyToMember(ref _labelFormatting, from._labelFormatting);
				_labelSide = from._labelSide;
				_prefixText = from._prefixText;
				_postfixText = from._postfixText;
				ChildCopyToMember(ref _suppressedLabels, from._suppressedLabels);
				EhSelfChanged(EventArgs.Empty);

				suspendToken.Resume();
			}

			return true;
		}
Example #3
0
		public AxisLabelStyle(CSAxisSide? labelSide, Altaxo.Main.Properties.IReadOnlyPropertyBag context)
		{
			if (null == context)
				context = PropertyExtensions.GetPropertyContextOfProject();

			_labelSide = labelSide;

			_font = GraphDocument.GetDefaultFont(context);
			var foreColor = GraphDocument.GetDefaultForeColor(context);

			_brush = Materials.GetSolidMaterial(foreColor);

			_automaticRotationShift = true;
			_rotationX = 90;
			_suppressedLabels = new SuppressedTicks() { ParentObject = this };
			_labelFormatting = new LabelFormatting.NumericLabelFormattingAuto() { ParentObject = this };
		}