Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 [C#] Implement Interface is missing properties

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
apautrot Posted - Sep 17 2015 : 08:01:36 AM
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.
3   L A T E S T    R E P L I E S    (Newest First)
ChrisG Posted - Oct 12 2016 : 5:48:00 PM
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.
xMRi Posted - Oct 11 2016 : 03:58:20 AM
Same here in C++/CLI!
accord Posted - Sep 18 2015 : 06:27:23 AM
*oh* Not good. I was able to reproduce the problem here:

case=92161

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000