CodeDom - Mixed Property Scope

  • Thread starter Thread starter chester
  • Start date Start date
C

chester

Hello,

I have an app that uses codedom to generate classes. One of the
features I'd very much like to support is mixed scope for gets/sets in
properties ie...

public string MyProperty
{
get { return mMyProperty; }
private set { mMyProperty = value; }
}

I can't for the life of me figure out how I would accomplish that. I
even went so far as to use a CodeSnippetStatement to fill in the set
value...

cd.CodeSnippetStatement cssSet = new
cd.CodeSnippetStatement(pSet.ToString());
myproperty.SetStatements.Add(cssSet);

but this of course returned a set within a set... not to mention, that
makes me code in every language I intend to support.... which is why I
would very much like to avoid doing properties by hand entirely.

any help greatly appreciated!
 
Hello,

I have an app that uses codedom to generate classes.  One of the
features I'd very much like to support is mixed scope for gets/sets in
properties ie...

public string MyProperty
{
    get { return mMyProperty; }
    private set { mMyProperty = value; }

}

I can't for the life of me figure out how I would accomplish that.  I
even went so far as to use a CodeSnippetStatement to fill in the set
value...

            cd.CodeSnippetStatement cssSet = new
cd.CodeSnippetStatement(pSet.ToString());
            myproperty.SetStatements.Add(cssSet);

but this of course returned a set within a set... not to mention, that
makes me code in every language I intend to support.... which is why I
would very much like to avoid doing properties by hand entirely.

any help greatly appreciated!

I've got pretty much the same problem. Have you made any headway?

Bueller.... Bueller.....?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top