public string ToString(XLReferenceStyle referenceStyle, bool includeSheet) { string address; if (!IsValid) { address = "#REF!"; } else if (referenceStyle == XLReferenceStyle.A1) { address = GetTrimmedAddress(); } else if (referenceStyle == XLReferenceStyle.R1C1 || HasWorksheet && Worksheet.Workbook.ReferenceStyle == XLReferenceStyle.R1C1) { address = "R" + _rowNumber.ToInvariantString() + "C" + ColumnNumber.ToInvariantString(); } else { address = GetTrimmedAddress(); } if (includeSheet) { return(String.Concat( WorksheetIsDeleted ? "#REF" : Worksheet.Name.EscapeSheetName(), '!', address)); } return(address); }
public String ToStringFixed(XLReferenceStyle referenceStyle, Boolean includeSheet) { String address; if (referenceStyle == XLReferenceStyle.A1) { address = String.Format("${0}${1}", ColumnLetter, _rowNumber.ToInvariantString()); } else if (referenceStyle == XLReferenceStyle.R1C1) { address = String.Format("R{0}C{1}", _rowNumber.ToInvariantString(), ColumnNumber); } else if (HasWorksheet && Worksheet.Workbook.ReferenceStyle == XLReferenceStyle.R1C1) { address = String.Format("R{0}C{1}", _rowNumber.ToInvariantString(), ColumnNumber); } else { address = String.Format("${0}${1}", ColumnLetter, _rowNumber.ToInvariantString()); } if (includeSheet) { return(String.Format("'{0}'!{1}", Worksheet.Name, address)); } return(address); }
public string ToString(XLReferenceStyle referenceStyle, bool includeSheet) { string address = string.Empty; if (referenceStyle == XLReferenceStyle.A1) { address = ColumnLetter + _rowNumber.ToInvariantString(); } else if (referenceStyle == XLReferenceStyle.R1C1) { address = String.Format("R{0}C{1}", _rowNumber.ToInvariantString(), ColumnNumber); } else if (HasWorksheet && Worksheet.Workbook.ReferenceStyle == XLReferenceStyle.R1C1) { address = String.Format("R{0}C{1}", _rowNumber.ToInvariantString(), ColumnNumber); } else { address = ColumnLetter + _rowNumber.ToInvariantString(); } if (includeSheet) { return(String.Format("{0}!{1}", Worksheet.Name.WrapSheetNameInQuotesIfRequired(), address)); } return(address); }
public string ToString(XLReferenceStyle referenceStyle, bool includeSheet) { if (referenceStyle == XLReferenceStyle.R1C1) { return(ToStringFixed(referenceStyle, true)); } else { return(ToStringRelative(includeSheet)); } }
public String ToStringFixed(XLReferenceStyle referenceStyle, Boolean includeSheet) { if (includeSheet) { return(String.Format("'{0}'!{1}:{2}", Worksheet.Name, _firstAddress.ToStringFixed(referenceStyle), _lastAddress.ToStringFixed(referenceStyle))); } return(_firstAddress.ToStringFixed(referenceStyle) + ":" + _lastAddress.ToStringFixed(referenceStyle)); }
public String ToStringFixed(XLReferenceStyle referenceStyle, Boolean includeSheet) { if (includeSheet) { return(String.Format("{0}!{1}:{2}", Worksheet.Name.WrapSheetNameInQuotesIfRequired(), _firstAddress.ToStringFixed(referenceStyle), _lastAddress.ToStringFixed(referenceStyle))); } return(_firstAddress.ToStringFixed(referenceStyle) + ":" + _lastAddress.ToStringFixed(referenceStyle)); }
public string ToString(XLReferenceStyle referenceStyle) { if (referenceStyle == XLReferenceStyle.A1) { return(ColumnLetter + _rowNumber.ToInvariantString()); } if (referenceStyle == XLReferenceStyle.R1C1) { return(String.Format("R{0}C{1}", _rowNumber.ToInvariantString(), ColumnNumber)); } if (HasWorksheet && Worksheet.Workbook.ReferenceStyle == XLReferenceStyle.R1C1) { return(String.Format("R{0}C{1}", _rowNumber.ToInvariantString(), ColumnNumber)); } return(ColumnLetter + _rowNumber.ToInvariantString()); }
public String ToStringFixed(XLReferenceStyle referenceStyle, Boolean includeSheet) { String address; if (referenceStyle == XLReferenceStyle.Default && HasWorksheet) { referenceStyle = Worksheet.Workbook.ReferenceStyle; } if (referenceStyle == XLReferenceStyle.Default) { referenceStyle = XLReferenceStyle.A1; } Debug.Assert(referenceStyle != XLReferenceStyle.Default); if (!IsValid) { address = "#REF!"; } else { switch (referenceStyle) { case XLReferenceStyle.A1: address = String.Concat('$', ColumnLetter, '$', _rowNumber.ToInvariantString()); break; case XLReferenceStyle.R1C1: address = String.Concat('R', _rowNumber.ToInvariantString(), 'C', ColumnNumber); break; default: throw new NotImplementedException(); } } if (includeSheet) { return(String.Concat( WorksheetIsDeleted ? "#REF" : Worksheet.Name.EscapeSheetName(), '!', address)); } return(address); }
public string Address(bool rowAbsolute = true, bool columnAbsolute = true, XLReferenceStyle referenceStyle = XLReferenceStyle.xlA1, bool external = false, Range relativeTo = null) { return InternalObject.GetType().InvokeMember("Address", System.Reflection.BindingFlags.GetProperty, null, InternalObject, new object[] { rowAbsolute, columnAbsolute, referenceStyle, external, (relativeTo == null) ? System.Reflection.Missing.Value : relativeTo.InternalObject }).ToString(); }
public String ToStringFixed(XLReferenceStyle referenceStyle) { return(ToStringFixed(referenceStyle, false)); }
public string ToString(XLReferenceStyle referenceStyle) { return(ToString(referenceStyle, false)); }
public String ToStringFixed(XLReferenceStyle referenceStyle, Boolean includeSheet) { if (includeSheet) return String.Format("'{0}'!{1}:{2}", Worksheet.Name, _firstAddress.ToStringFixed(referenceStyle), _lastAddress.ToStringFixed(referenceStyle)); return _firstAddress.ToStringFixed(referenceStyle) + ":" + _lastAddress.ToStringFixed(referenceStyle); }
public String ToStringFixed(XLReferenceStyle referenceStyle) { return ToStringFixed(referenceStyle, false); }
public string Address(bool rowAbsolute = true, bool columnAbsolute = true, XLReferenceStyle referenceStyle = XLReferenceStyle.xlA1, bool external = false, Range relativeTo = null) { return(InternalObject.GetType().InvokeMember("Address", System.Reflection.BindingFlags.GetProperty, null, InternalObject, new object[] { rowAbsolute, columnAbsolute, referenceStyle, external, (relativeTo == null) ? System.Reflection.Missing.Value : relativeTo.InternalObject }).ToString()); }
public String ToStringFixed(XLReferenceStyle referenceStyle, Boolean includeSheet) { String address; if (referenceStyle == XLReferenceStyle.A1) address = String.Format("${0}${1}", ColumnLetter, _rowNumber.ToStringLookup()); else if (referenceStyle == XLReferenceStyle.R1C1) address = String.Format("R{0}C{1}", _rowNumber.ToStringLookup(), ColumnNumber); else if (HasWorksheet && Worksheet.Workbook.ReferenceStyle == XLReferenceStyle.R1C1) address = String.Format("R{0}C{1}", _rowNumber.ToStringLookup(), ColumnNumber); else address = String.Format("${0}${1}", ColumnLetter, _rowNumber.ToStringLookup()); if (includeSheet) return String.Format("'{0}'!{1}", Worksheet.Name, address); return address; }
public string ToString(XLReferenceStyle referenceStyle) { if (referenceStyle == XLReferenceStyle.A1) { return ColumnLetter + _rowNumber.ToStringLookup(); } if (referenceStyle == XLReferenceStyle.R1C1) { return String.Format("R{0}C{1}", _rowNumber.ToStringLookup(), ColumnNumber); } if (HasWorksheet && Worksheet.Workbook.ReferenceStyle == XLReferenceStyle.R1C1) { return String.Format("R{0}C{1}", _rowNumber.ToStringLookup(), ColumnNumber); } return ColumnLetter + _rowNumber.ToStringLookup(); }