Разработка API ZWCad с использованием .NET и C#, Visual Studio.
Я начал с этого конструктора классов.
Код: Выделить всё
internal class Foo
{
public List BarFromThisFoo { get; set; }
public double MaxYBar { get; set; } = 0;
// Some other properties
public Foo(bool autoGetBar)
{
if(autoGetBar)
{
BarFromThisFoo = GetBarFromThisFoo();
}
// Get some other properties
}
}
Код: Выделить всё
internal class Foo
{
public List BarFromThisFoo { get; set; }
public double MaxYBar { get; set; } = 0;
// Some other properties
public Foo()
{
BarFromThisFoo = GetBarFromThisFoo();
// Get some other properties
}
public Foo(ObjectId[] selectedObjets)
{
BarFromThisFoo = GetBarFromThisFoo(selectedObjets);
// Get some other properties
}
}
Is there some refactoring option or tool to this situations?
For now I'm using the Find and Replace tool, but it is kind of slow when having multiple files.
I also have looked for Visual Studio extensions but haven't tried none since none of them seems to cover this situation.
Источник: https://stackoverflow.com/questions/781 ... ual-studio