public void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         Machine      = String.Empty;
         Path         = String.Empty;
         Reason       = String.Empty;
         DemoPath     = String.Empty;
         Files        = new DownloadFileInfo[0];
         CurrentIndex = 0;
         Progress     = 0;
         IsFinished   = false;
     }
     else
     {
         machine      = String.Empty;
         path         = String.Empty;
         reason       = String.Empty;
         demoPath     = String.Empty;
         files        = new DownloadFileInfo[0];
         currentIndex = 0;
         progress     = 0;
         isFinished   = false;
     }
 }
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ushort len = BitConverter.ToUInt16(Buffer, cursor);

            cursor += TypeSizes.SHORT;

            files = new DownloadFileInfo[len];

            len     = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            machine = Util.Encoding.GetString(Buffer, cursor, len);
            cursor += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            path    = Util.Encoding.GetString(Buffer, cursor, len);
            cursor += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            reason  = Util.Encoding.GetString(Buffer, cursor, len);
            cursor += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            demoPath = Util.Encoding.GetString(Buffer, cursor, len);
            cursor  += len;

            for (int i = 0; i < files.Length; i++)
            {
                DownloadFileInfo obj = new DownloadFileInfo(Buffer, cursor);
                cursor += obj.ByteLength;

                files[i] = obj;
            }

            return(cursor - StartIndex);
        }
Example #3
0
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ushort len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            files = new DownloadFileInfo[len];

            len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            machine = Encoding.Default.GetString(Buffer, cursor, len);
            cursor += len;

            len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            path = Encoding.Default.GetString(Buffer, cursor, len);
            cursor += len;

            len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            reason = Encoding.Default.GetString(Buffer, cursor, len);
            cursor += len;

            len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            demoPath = Encoding.Default.GetString(Buffer, cursor, len);
            cursor += len;

            for (int i = 0; i < files.Length; i++)
            {
                DownloadFileInfo obj = new DownloadFileInfo(Buffer, cursor);
                cursor += obj.ByteLength;

                files[i] = obj;               
            }

            return cursor - StartIndex; 
        }
        public unsafe void ReadFrom(ref byte *Buffer)
        {
            ushort len = *((ushort *)Buffer);

            Buffer += TypeSizes.SHORT;

            files = new DownloadFileInfo[len];

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            machine = new string((sbyte *)Buffer, 0, len, Util.Encoding);
            Buffer += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            path    = new string((sbyte *)Buffer, 0, len, Util.Encoding);
            Buffer += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            reason  = new string((sbyte *)Buffer, 0, len, Util.Encoding);
            Buffer += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            demoPath = new string((sbyte *)Buffer, 0, len, Util.Encoding);
            Buffer  += len;

            for (int i = 0; i < files.Length; i++)
            {
                files[i] = new DownloadFileInfo(ref Buffer);
            }
        }
Example #5
0
 public void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         Machine = String.Empty;
         Path = String.Empty;
         Reason = String.Empty;
         DemoPath = String.Empty;
         Files = new DownloadFileInfo[0];
         CurrentIndex = 0;
         Progress = 0;
         IsFinished = false;
     }
     else
     {
         machine = String.Empty;
         path = String.Empty;
         reason = String.Empty;
         demoPath = String.Empty;
         files = new DownloadFileInfo[0];
         currentIndex = 0;
         progress = 0;
         isFinished = false;
     }
 }
Example #6
0
        public unsafe void ReadFrom(ref byte* Buffer)
        {
            ushort len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            files = new DownloadFileInfo[len];

            len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            machine = new string((sbyte*)Buffer, 0, len);
            Buffer += len;

            len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            path = new string((sbyte*)Buffer, 0, len);
            Buffer += len;

            len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            reason = new string((sbyte*)Buffer, 0, len);
            Buffer += len;

            len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            demoPath = new string((sbyte*)Buffer, 0, len);
            Buffer += len;

            for (int i = 0; i < files.Length; i++)          
                files[i] = new DownloadFileInfo(ref Buffer);                        
        }