Invert statement...

....would be a very handy feature.

For example:


case "foo": return TestEnum.Foo;


select line, press CtrlShiftI ;)


case TestEnum.Foo: return "foo";


or another one:


m_textbox.Text = MyObject.Text;


becomes


MyObject.Text = m_textbox.Text;


What do you think?

Best Regards,
Uwe

3 comments
Comment actions Permalink

I could not find the general rule. That is, I understand how it works in these two particular cases but cannot predict which other cases are supported (and how).

--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com "Develop with pleasure!"


....would be a very handy feature.

For example:


case "foo": return TestEnum.Foo;

select line, press CtrlShiftI ;)


case TestEnum.Foo: return "foo";

or another one:


m_textbox.Text = MyObject.Text;

becomes


MyObject.Text = m_textbox.Text;

What do you think?

Best Regards,
Uwe


0
Comment actions Permalink

The one obvious, as it seems, is
a.foo(b) < -- > b.foo(a)

--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:cgkcma$oud$1@is.intellij.net...

I could not find the general rule. That is, I understand how it works in

these two particular cases but cannot predict which other cases are
supported (and how).
>

--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com "Develop with pleasure!"

>
>
>

....would be a very handy feature.

>

For example:

>


case "foo": return TestEnum.Foo;

select line, press CtrlShiftI ;)

>


case TestEnum.Foo: return "foo";

or another one:

>


m_textbox.Text = MyObject.Text;

becomes

>


MyObject.Text = m_textbox.Text;

What do you think?

>

Best Regards,
Uwe

>


0
Comment actions Permalink

Hey guys,

Personally, I would appreciate functionality like this:
obj.a = b; => b = obj.a;

I have lots of places in my code, where you do binding between controls and
DataSet values. Usually it's very "painful" operation to invert assignments.

//Example:
private void BindData(TestTableRow row)
{
txtUserName.Text = row.UserName;
txtAdress.Text = row.Address;
ddlState.SelectedValue = row.State;
//...
//Might be very long list...
}

private void BindControls(TestTableRow row)
{
row.UserName = txtUserName.Text;
row.Address = txtAddress.Text;
row.State = ddlState.SelectedValue;
//...
}

This is very simple example and I can use "built-in" data binding feature
instead of BindData() method, but sometimes (in some places) it just doesn't
work. And obviously, you cannot eliminate BindControls() from your code (for
ASP.NET apps at least). I bet, you can find similar "patterns" in any code
related to data processing (when you add/update records and so on)...
So, I guess, "Inverse" function would be very handy in such cases.

Thanks,
Chepel


"Andrey Simanovsky (JetBrains)" <ands@jetbrains.com> wrote in message
news:cgkf2f$1gp$1@is.intellij.net...

The one obvious, as it seems, is
a.foo(b) < -- > b.foo(a)

>

--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>
>

"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:cgkcma$oud$1@is.intellij.net...

I could not find the general rule. That is, I understand how it works in

these two particular cases but cannot predict which other cases are
supported (and how).
>

--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com "Develop with pleasure!"

>
>
>

....would be a very handy feature.

>

For example:

>


case "foo": return TestEnum.Foo;

select line, press CtrlShiftI ;)

>


case TestEnum.Foo: return "foo";

or another one:

>


m_textbox.Text = MyObject.Text;

becomes

>


MyObject.Text = m_textbox.Text;

What do you think?

>

Best Regards,
Uwe

>

>
>


0

Please sign in to leave a comment.