Search:

Type: Posts; User: wolf99

Page 1 of 8 1 2 3 4

Search: Search took 0.06 seconds.

  1. Re: Mapping non-generic interfaces to generic collections

    Thanks for the added clarity Sitten. I don't have enough rep to see deleted answers on SO, so I had no idea why he'd deleted it... I opened the question here in addition to the SO one because I...
  2. Re: Mapping non-generic interfaces to generic collections

    Thanks TechGnome!

    My understanding of what is actually the best way to do this is... patchy (Friday brain). Something like the following should cover it?


    public class StringList :...
  3. [RESOLVED] Mapping non-generic interfaces to generic collections

    In this SO question, https://stackoverflow.com/a/46363899/1292918, Hans Passant mentions:


    "Mapping your own non-generic interface to a generic collection type"

    What is meant by this exactly?...
  4. Re: Converting from an XML model object to more useful class

    Thanks for the info techgnome; that sounds logical enough in the general case...

    However, in this specific case a command may only ever have 0 or 1 ReadProtocol, that is the <ReadProtocol> element...
  5. Re: Converting from an XML model object to more useful class

    Thanks for all the info folks.

    I realised why I hadn't used the XMLAttribute avenue to begin with - I had been trying to keep the classes generated by XSD.exe untouched, so as to make it easy to...
  6. Re: Converting from an XML model object to more useful class

    @techgnome: Damn it, I should have thought of this! :blush: Thanks!

    I think to completely solve my problem (it's not just the names, but the types that differ also) I can solve this in two steps:...
  7. [RESOLVED] Converting from an XML model object to more useful class

    Hi folks,

    TLDR: I have class MessyA, resulting from a deserializer, that models real data and want to have class SmartA that implements IA that is easier for the user to work with, what is the...
  8. 4.0 Re: How to allow a user to change between derived types?

    I think I've figured out how to do this for this design:


    // Save the type information to the RadioButton at control creation
    rb.Tag = c.GetType();


    Then:
  9. 4.0 How to allow a user to change between derived types?

    I've asked this question on SO and didn't really get anywhere so I think I'm probably coming at this from the wrong angle and need more than just Q&A help as I can't see a way around it.

    The...
  10. Re: Best way to bind complexly related data to DataGridView

    Drat. Ill just go back and rejig my data model to be simpler and forget about the min/max command codes as a complex object. Much simpler and puts the problem off down the road which means the boss...
  11. Replies
    1
    Views
    640

    Re: Capture Start Button Event in Windows

    Darren,

    Do a quick search on these forums using the search bar at the top. This has been answered quite a number of times in various different ways. Maybe search the VB6 forum as well as there a...
  12. VS 2015 Re: Obtaining a combo box selection in order to execute a sub.

    the following does no checking of the entered text, only works for whole numbers and uses the default names for the controls (i.e: Form1, ComboBox1, textBox1 and Label1)


    Delegate Function...
  13. Re: Best way to bind complexly related data to DataGridView

    Gah, that doesnt protect the many to one relationship of the min/max commands to the mappings >:(
  14. Re: Best way to bind complexly related data to DataGridView

    so I've ended up with:


    Private Class ParametersAndCommands
    Public Property Description As String
    Public Property Unit As CommandData.ParameterUnit
    Public Property MinimumCommand...
  15. Re: Best way to bind complexly related data to DataGridView

    So I have this down to forming a new List by running a Join query on the other two Lists. However Im not quite there just yet as it's a looooong time since I've used LINQ or even SQL and I've...
  16. Re: Best way to bind complexly related data to DataGridView

    Maybe if I create a dataset with tables of each list and add some constraints between them to create a new ... something (DataTable? DataView? I dont really know datasets :( ) and then bind that to...
  17. [RESOLVED] Best way to bind complexly related data to DataGridView

    Hi folks

    Im trying to figure out the best way of going about binding some data to a DataGridView. I can bind simple collections etc no problem but now i have to collections with relationships...
  18. Replies
    9
    Views
    2,628

    Re: Type of argument for .Invoke()

    Hi Folks,

    Thanks for the discussion! I am using VS 2010.

    So basically my use of invoke is down to the events fired off by a FileSystemWatcher being on a separate thread. When these events...
  19. Replies
    9
    Views
    2,628

    Re: Type of argument for .Invoke()

    So I went back to the example on the Control.Invoke() MSDN page and used the exact syntax there (give or take some names!):


    Delegate Sub StupidHelperDelegate()

    Sub StupidHelpersub()
    ...
  20. Replies
    9
    Views
    2,628

    Re: Type of argument for .Invoke()

    Furthermore, and separately: if the argument should be a delegate

    How come neither of the following work?


    somecontrol.Invoke(Foo())

    SomeControl.Invoke(AddressOf Foo())
  21. Replies
    9
    Views
    2,628

    [RESOLVED] Type of argument for .Invoke()

    Hi folks

    The MDSN page for the Control.Invoke method specifies:


    Control.Invoke Method (Delegate)

    Now I was given in my admittedly limited knowledge to understand that a delegate is just a...
  22. Re: which event to use to save TextBox text?

    Great, thanks kebo!
  23. [RESOLVED] which event to use to save TextBox text?

    Hi Folks

    I have a form with a TextBox control.

    The text entered in the text box is saved to an object in the TextBox.Validated event handler.

    When the user hits the save ToolStripButton the...
  24. Re: How to bind DGV to complex type properties

    Got it.

    When I set up my objects that I was testing with I created a single TestValue object of type ParameterValue.
    then I set all of the ParameterValue type members in each Parameter equal to...
  25. Re: How to bind DGV to complex type properties

    OK, so I reverted to the PropertyDescriptor approach after reading this Which showed that the previous example had a bit missing.

    the columns now have data in them again!

    But changing the data...
  26. [RESOLVED] How to bind DGV to complex type properties

    Hi Folks

    I have a DataGridView with some DataGridViewTextBoxColumn columns in it.

    The DGV itself is bound to a BindingList(Of Parameter)

    The Parameter class has public property members...
  27. Re: Cant bind correctly to DataGridView

    Thanks Techgnome. while your answer didn't directly solve the issue it (and a nights sleep) set my mind on the right path.

    I'd been mixing up the bindings! Basically, at the moment the...
  28. [RESOLVED] Cant bind correctly to DataGridView

    Hiya peeps!

    I have a DataGridView added to my windows form application form. Some of the columns are DataGridViewComboBoxColumn columns.

    I would like to populate the column combo-boxes from...
  29. Replies
    7
    Views
    1,143

    Re: How can I refactor this code?

    More light dawns! :D


    Public Function CalcRms(input As IEnumerable(Of Double), removeDcComponent As Boolean) As Double
    Dim Count As UInteger = input.Count()
    Dim MeanSquare As Double = 0...
  30. Replies
    7
    Views
    1,143

    Re: How can I refactor this code?

    Brilliant Evil_giraffe, thank you for your detailed and well thought post!

    I now have the following code:


    Public Function CalcRms(Of TSource)(input As List(Of TSource), selector As Func(Of...
  31. Replies
    7
    Views
    1,143

    Re: How can I refactor this code?

    Hi Evil_Giraffe, #Destiny

    True dat, I asked the internet how to `.Sum` and adapted what I found, but now you say it I see your point! I can pass a delegate (similar to function pointer right?) or...
  32. Replies
    7
    Views
    1,143

    [RESOLVED] How can I refactor this code?

    I have some code that works fine but I currently have the same code three times, I'd like to refactor to a single function that is called from three places instead.

    The current code has access to...
  33. VS 2010 Re: Alternative to mutex that doesn't get abandoned

    Thanks Sitten Spyne that works :)
  34. Thread: chart with vb

    by wolf99
    Replies
    1
    Views
    593

    Re: chart with vb

    for the number formatting

    Your number has and "E" in it, this should normally be followed by another number that shows the power, eg 12.
    34567E-1 which would mean the number is 12.34567 *10^-1...
  35. VS 2015 Re: Why is there no popup of variable value in debug?

    As a quick alternative you could try adding Stage to the Watch window maybe
  36. VS 2010 [RESOLVED] Alternative to mutex that doesn't get abandoned

    Hi folks,

    I was trying to use a mutex to solve an issue I am having but it doesn't work as by necessity the function that acquires the mutex is not always the one that releases it.

    The issue is...
  37. VS 2010 Re: [RESOLVED] Help with factory design pattern

    D'oh, of course! The enum is already public too :rolleyes: :blush:
  38. VS 2010 Re: Help with factory design pattern

    Many thanks for your thorough replies, much appreciated!

    I now understand that this situation is likely not a good candidate for the pattern. The reasoning that started me on this path was that I...
  39. VS 2010 [RESOLVED] Help with factory design pattern

    Hi Folks

    This turned into a pretty long post so the TLDR version is: I'm a noob at using OOP patterns. Should I, and how can I, adapt my code (below) to use the factory pattern?

    The longer...
  40. Replies
    1
    Views
    3,230

    VS 2010 Serial port reading is very slow

    Hi Folks

    I have a simple synchronous function that write n bytes to the serial port and reads the same number of bytes back. In the case of the code below n = 4.

    Now I have an oscilloscope...
Results 1 to 40 of 314
Page 1 of 8 1 2 3 4



Click Here to Expand Forum to Full Width