Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mbudak

@mbudak
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How can I use a MemoryStream in a System.Generic.List<>
    M mbudak

    Thanks for your help. This is work for me. Final solution as like these;

    public class myObject
    {
        public List<ChildObject> subObject = new List<ChildObject> { };
    
        public string ObjectName { get; set; }
    
        public class ChildObject
        {
            public string ChildObjectName { get; set; }
            public MemoryStream ChildStream { get; set; }
    
            public ChildObject()
            {
                ChildStream = new MemoryStream();
            }
            ~ChildObject()
            {
                ChildStream.Dispose();
            }
        }
    }
    
    C# help question

  • How can I use a MemoryStream in a System.Generic.List&lt;&gt;
    M mbudak

    Impressive ;) Is it possible to auto create this MemoryStream in my subClass's constructor? When I Create following...

    MyObj.subObject.Add(new myObject.ChildObject());

    I want to use this MemoryStream directly. Thanks

    C# help question

  • How can I use a MemoryStream in a System.Generic.List&lt;&gt;
    M mbudak

    I've object and it has a lot of objects :-\ When I access Childobjects everything is ok but not MemoryStreams;

    public class myObject
    {
    public List<ChildObject> subObject = new List<ChildObject> { };

        public string ObjectName { get; set; }
    
        public class ChildObject
        {
            public string ChildObjectName { get; set; }
            public MemoryStream ChildStream { get; set; }
        }
    }
    

    When I use this object I am using following code;

    // This is OK
    MemoryStream myMS = new MemoryStream();
    myMS.Position = 0;
    // End of This is OK
    //
    myObject MyObj = new myObject();
    MyObj.ObjectName = "My First Object";
    MyObj.subObject.Add(new myObject.ChildObject());
    MyObj.subObject[0].ChildObjectName = "My First Sub Object";
    MyObj.subObject[0].ChildStream.Position = 0; // :mad:ERROR LINE

    Thanks for your reply. :rolleyes:

    C# help question

  • How can I implement this complex object
    M mbudak

    I am the new about class and objects in c#. I just want to define an object for this issue after than I will save and restore from a file this ExamFile.

    ExamFile.Title = "Test Exam File";
    ExamFile.FileName = "my First Exam.mfe";

    ExamFile.Exam[0].ExamName = "This is my First Exam";
    ExamFile.Exam[1].ExamName = "This is my Second Exam";

    ExamFile.Exam[0].Question[0].Remark = "First Exam's first Q";
    ExamFile.Exam[0].Question[0].Type = "Multiple";
    ExamFile.Exam[0].Question[1].Remark = "First Exam's Second Q"
    ExamFile.Exam[0].Question[1].Type = "Single";

    ExamFile.Exam[1].Question[0].Remark = "Second Exam's First Q";
    ExamFile.Exam[1].Question[0].Type = "Multiple";

    Thanks

    C# question csharp help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups