SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Disabling the EnableEndConstructs for C#

Last post 04-11-2007 8:06 PM by Hkproj. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-11-2007 7:35 PM

    • Hkproj
    • Top 200 Contributor
    • Joined on 09-27-2006
    • Italy
    • Posts 13

    Disabling the EnableEndConstructs for C#

    As the title explains, i want to disable the EnableEndConstructs option for C#, because when i want to paste (with my addin) something like:

    #region myRegion, SharpDevelop adds the #endregion statement and don't let me to control generated code.

    Please help me. sorry for my bad English ;-)

  • 04-11-2007 7:54 PM In reply to

    Re: Disabling the EnableEndConstructs for C#

    This feature cannot be disabled.

    But why do you simulate text editor actions instead of simply inserting the text? If you use textArea.Document.Insert(), the formatting strategy doesn't get called and no automatic indentation/end constructs etc. can get in your way.

    Daniel Grunwald
  • 04-11-2007 7:58 PM In reply to

    • Hkproj
    • Top 200 Contributor
    • Joined on 09-27-2006
    • Italy
    • Posts 13

    Re: Disabling the EnableEndConstructs for C#

    i've used the PInvoke Addin's class(PInvokeCodeGenerator or something like that) that uses the InsertString method. but gave the same result.

    Is there another way?. Thank you.

    Hkproj. 

  • 04-11-2007 8:00 PM In reply to

    Re: Disabling the EnableEndConstructs for C#

    Use textEditor.Document.Insert(), not textArea.InsertString.

    And more important, don't use new Return().Execute() - that's simulation the user pressing enter, which triggers the automatic indentation etc. features. Simply insert a string containing a newline instead.

    Daniel Grunwald
  • 04-11-2007 8:06 PM In reply to

    • Hkproj
    • Top 200 Contributor
    • Joined on 09-27-2006
    • Italy
    • Posts 13

    Re: Disabling the EnableEndConstructs for C#

    thank you!.

    Hkproj. 

Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.