Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 [C#] Implement Interface is missing properties
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

apautrot
New Member

6 Posts

Posted - Sep 17 2015 :  08:01:36 AM  Show Profile  Reply with Quote
Hi
In C#, properties of interfaces are not implemented when using the option Implement Interface.

Given the following example :

interface MyInterface
{
	string MyProperty { get; }
	void MyMethod ();
}

class MyClass : MyInterface
{
}


Hover above the interface name MyInterface on the same line than MyClass. Pull down the refactoring menu. Click Implement Interface.

Note that only the method implementation is added. The property is not.

Which result in:

class MyClass : MyInterface
{
	public void MyMethod ()
	{
		throw new Exception ( "The method or operation is not implemented." );
	}
}


While we could expect:

class MyClass : MyInterface
{
	public string MyProperty
	{
		get;
		set;
	}

	public void MyMethod ()
	{
		throw new Exception ( "The method or operation is not implemented." );
	}
}


Regards.

Edited by - apautrot on Sep 17 2015 08:02:16 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 18 2015 :  06:27:23 AM  Show Profile  Reply with Quote
*oh* Not good. I was able to reproduce the problem here:

case=92161

Edited by - accord on Sep 18 2015 06:36:14 AM
Go to Top of Page

xMRi
Tomato Guru

Germany
315 Posts

Posted - Oct 11 2016 :  03:58:20 AM  Show Profile  Reply with Quote
Same here in C++/CLI!

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Oct 12 2016 :  5:48:00 PM  Show Profile  Reply with Quote
Thanks for reporting the issue.

I was able to reproduce the issue, which is similar to case=92161. We will ensure that a fix works for both C# and C++/CLI.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000