Search results for query: *

  1. M

    Await File Download From Rest API

    I'm downloading files from a Jira Task, and while debugging my code exists before the file is downloaded as a result the thread is exiting and the file is not downloading. i added the do loop and this gives enough time for the file to download, but I don't like it. how can i stop the code form...
  2. M

    Resolved Deserialization With Interfaces Issue

    There you go, here is my solution., and it works and I can have an extensible return type. public class ConcreteConverter : JsonConverter { public override bool CanConvert(Type objectType) { throw new NotImplementedException(); } /// <summary>...
  3. M

    Resolved Deserialization With Interfaces Issue

    thanks for the help....
  4. M

    Resolved Deserialization With Interfaces Issue

    If I have one of the convertors it works fine but when there are multiple it only uses the first convertor. Is there a way to allow it to use multiple convertors? var settings = new JsonSerializerSettings { Converters = {...
  5. M

    Resolved Deserialization With Interfaces Issue

    figured it out, i had the decorator in my last built package so it was ignoring the convertors var settings = new JsonSerializerSettings { Converters = { new AbstractConverter<EnvironmentsModel,IModelsBase>()...
  6. M

    Resolved Deserialization With Interfaces Issue

    I have found a solution but i cant quite get it to work if i decorate the class as follows [JsonConverter(typeof(AbstractConverter<EnvironmentsModel,IModelsBase>))] public IModelsBase? ReturnModel { get; set; } = null; it works great but that's only for one possible concrete type, so...
  7. M

    Resolved Deserialization With Interfaces Issue

    Doing some reading i think i have to implement a concrete Convertor, I've done some testing and it seems if i can determine the type then i can change "return serializer.Deserialize<T>(reader);" in the Deserialize to convert tot he correct type. this is where I'm stuck. thanks mdaxe...
  8. M

    Resolved Deserialization With Interfaces Issue

    Were building a bunch of REST API End Points, we decided that we wanted a generic transportation object to be returned from all Rest calls that contains the data and other attributes. The problem is that all of the models implement a common interface "IModlesBase" to support this. Now I don't...
  9. M

    Memory Stream Reading Chunks

    changing my Encoding to UTF8 and changing the number of bytes I was reading from 3 to 4 I keep thinking its zero base. i also found UTF8 worked better than ASCII _memoryStream.Read(readChunkSize, 0, 4); thanks madaxe public void WriteMessage(string message) {...
  10. M

    Memory Stream Reading Chunks

    Hello World byte array 72 101 108 108 111 32 87 111 114 108 100 46 when I try to read the message it looks like its reading the complete memory stream from the start, I can see the opcode (0) 1 byte, chunk size (12 0 0 0) 4 bytes and then the start of the message, but i can see its cut off but...
  11. M

    Memory Stream Reading Chunks

    Thanks for the help I'm an engineer not a computer major, so I'm learning a lot. so I'm now able to write the int32 and read it so you can see from the output I'm getting the correct Opcode and Chunk size but the message is being cut of any ideas thanks madaxe 10/09/2022 09:57:04 : Opcode...
  12. M

    Memory Stream Reading Chunks

    manages the empty bytes? i tried this and it seems to work but it closes my memory stream, is this because the binary writer is going to garbage collection due to the using statement? thanks madaxe public void WriteNextChunckSize(int chunkSize) { using (BinaryWriter writer...
  13. M

    Memory Stream Reading Chunks

    I can send a single byte containing the OpCode and display that on the server in the console great. So I tried to add 4 bytes to contain the size of the next chunk I could not find an easy way of doing this I can determine how many bites my chunk is going to have for example if its an image...
  14. M

    Memory Stream Reading Chunks

    Is this even possible, I want to construct a memory stream where the first byte defines how the stream should be consumed, the next 4 bytes defines how many bytes the next chunk has and so on thanks madaxe
  15. M

    xml element name prefix issue

    add namespace to the xml classes as shown below [XmlRoot(ElementName = "node",Namespace = "http://www.dsweb.com/std")] public class Node
  16. M

    xml element name prefix issue

    i need to pass this xml but the problem is the std: prefix namespace on the xmlelements, if I strip the std: in notepad++ it deserializes fine is there a way to get around this thanks madaxe <?xml version="1.0" ?> <std:node name="S1_standard" xmlns:std="3D Design & Engineering Software -...
  17. M

    How to Create TreeView in XAML with CheckBoxes.

    final working view model using System; using System.Collections.Generic; using System.Linq; using System.Windows.Input; using treeview.Commands; using treeview.Models; namespace treeview.ViewModels { public class ThingViewModel : ViewModelBase, IThingViewModel { ThingModel...
  18. M

    How to Create TreeView in XAML with CheckBoxes.

    I had to change some property's from late bound to property's with backers as the objects were being recreated. Hence your comment earlier. I now have the dialogue shown below I'm just working on the logic for check box states. using System; using System.Collections.Generic; using...
  19. M

    How to Create TreeView in XAML with CheckBoxes.

    Currently im using "{Binding RelativeSource={RelativeSource Self}}" to send the CheckBox to the Command Class is there a better way to get the DataContext of the CheckBox directly? Thanks Madaxe <CheckBox IsChecked="{Binding IsChecked}" Command="{Binding...
Back
Top Bottom