CodeDom and partial method
-
Hi, Is there a way to produce a partial method with CodeDom? Ex. partial void MyMethod() { ... } It looks like the MemberAttributes doesn't have "Partial" in it :( CodeMemberMethod codeMemberMethod = new CodeMemberMethod(); codeMemberMethod.Attributes = MemberAttributes.Public...but no MemberAttributes.Partial? My problem is that I'm generating some code to implement partial method. I have this class (created "by hand"):
public partial class MyClass
{
partial void MyMethod();
partial void MyMethodB();
}Then with CodeDom, I want to generate the implementation of those partial method. Something like:
public partial class MyClass
{
partial void MyMethod()
{
// Do Something
}partial void MyMethodB() { // Do Something }
}
That's why I need the "Partial" in System.CodeDom.MemberAttributes. May be I'm all wrong...it's something else the MemberAttributes that I should use to do this? Thank
-
Hi, Is there a way to produce a partial method with CodeDom? Ex. partial void MyMethod() { ... } It looks like the MemberAttributes doesn't have "Partial" in it :( CodeMemberMethod codeMemberMethod = new CodeMemberMethod(); codeMemberMethod.Attributes = MemberAttributes.Public...but no MemberAttributes.Partial? My problem is that I'm generating some code to implement partial method. I have this class (created "by hand"):
public partial class MyClass
{
partial void MyMethod();
partial void MyMethodB();
}Then with CodeDom, I want to generate the implementation of those partial method. Something like:
public partial class MyClass
{
partial void MyMethod()
{
// Do Something
}partial void MyMethodB() { // Do Something }
}
That's why I need the "Partial" in System.CodeDom.MemberAttributes. May be I'm all wrong...it's something else the MemberAttributes that I should use to do this? Thank
Create an abstract class and then use CodeDom to return an instance. You don't even need an abstract class as you can use an interface as well.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego. -
Hi, Is there a way to produce a partial method with CodeDom? Ex. partial void MyMethod() { ... } It looks like the MemberAttributes doesn't have "Partial" in it :( CodeMemberMethod codeMemberMethod = new CodeMemberMethod(); codeMemberMethod.Attributes = MemberAttributes.Public...but no MemberAttributes.Partial? My problem is that I'm generating some code to implement partial method. I have this class (created "by hand"):
public partial class MyClass
{
partial void MyMethod();
partial void MyMethodB();
}Then with CodeDom, I want to generate the implementation of those partial method. Something like:
public partial class MyClass
{
partial void MyMethod()
{
// Do Something
}partial void MyMethodB() { // Do Something }
}
That's why I need the "Partial" in System.CodeDom.MemberAttributes. May be I'm all wrong...it's something else the MemberAttributes that I should use to do this? Thank
Sorry, but the CodeDOM classes don't support partial methods.
Deja View - the feeling that you've seen this post before.
-
Hi, Is there a way to produce a partial method with CodeDom? Ex. partial void MyMethod() { ... } It looks like the MemberAttributes doesn't have "Partial" in it :( CodeMemberMethod codeMemberMethod = new CodeMemberMethod(); codeMemberMethod.Attributes = MemberAttributes.Public...but no MemberAttributes.Partial? My problem is that I'm generating some code to implement partial method. I have this class (created "by hand"):
public partial class MyClass
{
partial void MyMethod();
partial void MyMethodB();
}Then with CodeDom, I want to generate the implementation of those partial method. Something like:
public partial class MyClass
{
partial void MyMethod()
{
// Do Something
}partial void MyMethodB() { // Do Something }
}
That's why I need the "Partial" in System.CodeDom.MemberAttributes. May be I'm all wrong...it's something else the MemberAttributes that I should use to do this? Thank
check if this article http://www.codeproject.com/KB/dotnet/PartialMethod.aspx[^]