Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

VS Examples

Mark Erbaugh
Mark Erbaugh Member ✭✭
edited February 2020 in SmartSDR API

Answers

  • Pete - W6OP
    Pete - W6OP Member ✭✭
    edited February 2020
  • Mark Erbaugh
    Mark Erbaugh Member ✭✭
    edited August 2019
    Pete,

    Thanks for the reply. I found some stuff on MS' website that used a delegate. Is that different from the Action you used? Does the Action have to be allocated each time, or could you allocate it once and re-use it?
  • Pete - W6OP
    Pete - W6OP Member ✭✭
    edited August 2019
  • Pete - W6OP
    Pete - W6OP Member ✭✭
    edited August 2019
    I'm not sure you need to remove the property change handler. C# does a pretty good job of cleaning up after itself. Probably the property changed after the handler was removed. You may need to disconnect or dispose of the radio object or whatever is changing the property. If I have time I'll look at the code Flex provided.
  • Mark_WS7M
    Mark_WS7M Member ✭✭✭
    edited August 2019
    I just posted in another thread about this.  It depends completely on your use.  If the event handler remains alive during the entire life of your app then not removing it is fine.  

    But if you open a window, then close it and the open sets an event handler but does not remove it.  I have seen some VERY STRANGE behavior with this scenario.
  • Mark_WS7M
    Mark_WS7M Member ✭✭✭
    edited August 2019
  • Pete - W6OP
    Pete - W6OP Member ✭✭
    edited August 2019
    Yes, I should have given a more comprehensive explanation.
  • Mark Erbaugh
    Mark Erbaugh Member ✭✭
    edited August 2019
    What's the difference between Action and delegate. If you do a Peek definition on Action, it displays code from System.Core that just says public delegate void Action()

    Secondly, your code calls new every time you call this.BeginInvoke. Would it be more resource efficient to create a variable of type Action<string,string,bool> and do the new once in the object's constructor and then just reference that object?

  • Pete - W6OP
    Pete - W6OP Member ✭✭
    edited August 2019
    You know, I’ve been using that code for so long I have never thought much about it. That would be a good question to post on stackoverflow. As far as efficiency, if it’s not in a loop it really doesn’t matter much.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.