Menu

extension method must be defined in a non-generic static class

2017-09-09
2017-12-10
  • Abdolhamid Shariat

    Hi
    When I run Read4Me on windows 10 visual studio 2014 I got this error "extension method must be defined in a non-generic static class" Perhapse from this part .
    namespace Read4Me
    {
    partial class Read4MeForm

    {
        static Thread oThread;
        bool StopConversion = false;
    

    How can I resolve this error

     
  • Yassen Dobrev

    Yassen Dobrev - 2017-09-10

    Sorry, I'm not actively developing the project anymore. What are you trying to achieve?

     
    • Abdolhamid Shariat

      what the Read4Me does I mean "text to speech" and I would like to know how this software works as well

       
  • Yassen Dobrev

    Yassen Dobrev - 2017-09-10

    Are you interested in developing Read4Me further and do you have any programming skills?

     
  • Abdolhamid Shariat

    Yes but with vb.net

     
    • Abdolhamid Shariat

      But I would like to learn c# as well

       
  • lain-iwakura

    lain-iwakura - 2017-12-09

    To answer Abdolhamid Shariat’s question. Move the extension method “SplitByLength” to a static class.

    public static class ExtensionMethods
        {
    
            public static IEnumerable<string> SplitByLength(this string str, int maxLength)
            {
                for (int index = 0; index < str.Length; index += maxLength)
                {
                    yield return str.Substring(index, Math.Min(maxLength, str.Length - index));
                }
            }
        }
    

    https://stackoverflow.com/questions/9238114/extension-method-must-be-defined-in-a-non-generic-static-class

    Also, I have a bugfix for Read4Me. It has been periodically crashing. The issue seems to be with passing certain characters to TTSVoiceClipboard.Speak.

    My fix:
    toRead = toRead.Replace("<", "Less Than");

    I have the source code if you are interested.

     
  • Yassen Dobrev

    Yassen Dobrev - 2017-12-09

    Thanks Adam! If you're interested to help develop r4m I can give you update permission. Please let me know.

     
  • lain-iwakura

    lain-iwakura - 2017-12-10

    I would love to be a contributor. I have been using your program for a long time. I have tested several TTS applications, but nothing compares to Read4Me for day to day use. It Is one of the best accessibility tools I have ever used. And as luck would have it, I am comfortable developing in C#. So, I can bug test as I go.

     
  • Yassen Dobrev

    Yassen Dobrev - 2017-12-10

    Hi, I've just given you permissions! Can you contact me by email (yassendobrev at gmail dot com) to talk about the details. I'm looking forward to working with you :)

     

Log in to post a comment.