/// <summary> /// 속성들을 Xml Attribute로 생성합니다. /// </summary> /// <param name="writer">Attribute를 쓸 Writer</param> public override void GenerateXmlAttributes(XmlWriter writer) { base.GenerateXmlAttributes(writer); if (Dashed.HasValue) { writer.WriteAttributeString("dashed", Dashed.GetHashCode().ToString()); } if (Label.IsNotWhiteSpace()) { writer.WriteAttributeString("label", Label); } if (ShowLabelBorder.HasValue) { writer.WriteAttributeString("showLabelBorder", ShowLabelBorder.GetHashCode().ToString()); } if (LinePosition.HasValue) { writer.WriteAttributeString("linePosition", LinePosition.ToString()); } if (LabelPosition.HasValue) { writer.WriteAttributeString("labelPosition", LabelPosition.GetHashCode().ToString()); } if (LabelHAlign.HasValue) { writer.WriteAttributeString("labelHAlign", LabelHAlign.GetHashCode().ToString()); } if (LabelVAlign.HasValue) { writer.WriteAttributeString("labelVAlign", LabelVAlign.GetHashCode().ToString()); } }
public void Position_ShouldReturnLineColumnSeparatedByColon_WhenToStringIsInvoked(int line, int column) { var position = new LinePosition(line, column); var expectedOutput = line + ":" + column; var result = position.ToString(); result.ShouldBe(expectedOutput); }
public void EndConstructor() { // Act LinePosition position = LinePosition.End; // Assert Assert.AreEqual(LinePosition.End.Index, position.Index); Assert.AreEqual("End", position.GetIndexString()); Assert.AreEqual("LinePosition(End)", position.ToString()); }
public void DefaultConstructor() { // Act var position = new LinePosition(); // Assert Assert.AreEqual(0, position.Index); Assert.AreEqual("Begin", position.GetIndexString()); Assert.AreEqual("LinePosition(Begin)", position.ToString()); }
public void ThousandConstructor() { // Act var position = new LinePosition(1000); // Assert Assert.AreEqual(1000, position.Index); Assert.AreEqual("1,000", position.GetIndexString()); Assert.AreEqual("LinePosition(1,000)", position.ToString()); }
private JsonException SyntaxError(string message, Exception inner) { if (LineNumber > 0) { message = string.Format( "{0} See line {1}, position {2}.", message, LineNumber.ToString("N0"), LinePosition.ToString("N0")); } return(new JsonException(message, inner)); }
private InvalidOperationException InvalidPositionException(string message) { // We don't need an custom exceptions as there should be no need for a dev to catch this condition. They are not using the api right so how can the write code to recover. // We can make the current writer position available for better diagnostics then logged. return(new InvalidOperationException(message) { Data = { { "Position", position.ToString() } } }); }
public override string ToString() { return(string.Format("curves[{0}].{1}", LinePosition.ToString(), IsStart ? "Start" : "End")); }