Hi All!
ReSharper 8.1.23.546
Visual Studio 2013
Показывает сабжевый хинт на выделенный StartWith
Label — string property
Label = doc.GetType().InvokeMember("FullName", BindingFlags.GetProperty, null, doc, null) as string;
if (!string.IsNullOrEmpty(Label) && Label.StartsWith(@"@:\"))
{
var ext = Path.GetExtension(Label);
if (!string.IsNullOrEmpty(ext))
{
var index = ext.IndexOf('_');
if (index >= 0)
Label = Label.Substring(0, Label.Length - (ext.Length - index));
}
}
Здравствуйте, Какая разница, Вы писали:
КР>Hi All!
КР>ReSharper 8.1.23.546
КР>Visual Studio 2013
КР>Показывает сабжевый хинт на выделенный StartWith
КР>Label — string property
КР>КР> Label = doc.GetType().InvokeMember("FullName", BindingFlags.GetProperty, null, doc, null) as string;
КР> if (!string.IsNullOrEmpty(Label) && Label.StartsWith(@"@:\"))
КР> {
КР> var ext = Path.GetExtension(Label);
КР> if (!string.IsNullOrEmpty(ext))
КР> {
КР> var index = ext.IndexOf('_');
КР> if (index >= 0)
КР> Label = Label.Substring(0, Label.Length - (ext.Length - index));
КР> }
КР> }
КР>
private string Label
{
get { return null; }
set { throw new NotImplementedException(); }
}
UPS>UPS>private string Label
UPS>{
UPS> get { return null; }
UPS> set { throw new NotImplementedException(); }
UPS>}
UPS>
ага как раз мой случай
Здравствуйте, Какая разница, Вы писали:
КР>Показывает сабжевый хинт на выделенный StartWith
КР>Label — string property
Теоритически значение может поменяться между вызовами
КР>КР> Label = doc.GetType().InvokeMember("FullName", BindingFlags.GetProperty, null, doc, null) as string;
КР> if (!string.IsNullOrEmpty(Label) && Label.StartsWith(@"@:\"))
КР> {
КР> var ext = Path.GetExtension(Label);
КР> if (!string.IsNullOrEmpty(ext))
КР> {
КР> var index = ext.IndexOf('_');
КР> if (index >= 0)
КР> Label = Label.Substring(0, Label.Length - (ext.Length - index));
КР> }
КР> }
КР>
var label = Label;
if (!string.IsNullOrEmpty(label) && label.StartsWith(@"@:\"))
{
var ext = Path.GetExtension(label);
if (!string.IsNullOrEmpty(ext))
{
var index = ext.IndexOf('_');
if (index >= 0)
Label = label.Substring(0, label.Length - (ext.Length - index));
}
}
... << RSDN@Home 1.2.0 alpha 5 rev. 56>>
Здравствуйте, Какая разница, Вы писали:
КР>Hi All!
КР>ReSharper 8.1.23.546
КР>Visual Studio 2013
КР>Показывает сабжевый хинт на выделенный StartWith
КР>Label — string property
КР>КР> Label = doc.GetType().InvokeMember("FullName", BindingFlags.GetProperty, null, doc, null) as string;
КР> if (!string.IsNullOrEmpty(Label) && Label.StartsWith(@"@:\"))
КР> {
КР> var ext = Path.GetExtension(Label);
КР> if (!string.IsNullOrEmpty(ext))
КР> {
КР> var index = ext.IndexOf('_');
КР> if (index >= 0)
КР> Label = Label.Substring(0, Label.Length - (ext.Length - index));
КР> }
КР> }
КР>