ArtemisComm.Utility.LoadProperties C# (CSharp) Method

LoadProperties() public static method

public static LoadProperties ( object baseObject, Stream stream, int index, Collection errors ) : int
baseObject object
stream Stream
index int
errors Collection
return int
        public static int LoadProperties(object baseObject, Stream stream, int index, Collection<Exception> errors)
        {

            int retVal = 0;
            if (baseObject == null || stream == null || errors == null)
            {

            }
            else
            {
                if (index < stream.Length)
                {

                    using (MemoryStream RawData = stream.GetMemoryStream(index))
                    {

                        RawData.Position = 0;
                        foreach (PropertyInfo prop in baseObject.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
                        {
                            //@@@@@@@
                            bool exclude = false;
                            foreach (object a in prop.GetCustomAttributes(false))
                            {
                                if (a.GetType() == typeof(ArtemisExcludedAttribute))
                                {
                                    exclude = true;
                                    break;
                                }
                               

                            }
                            if (!exclude)
                            {
                                retVal += LoadProperty(baseObject, RawData, prop, errors);
                            }
                            long i = RawData.Position;
                        }
                        if (stream.CanSeek)
                        {
                            stream.Position = retVal + index;
                        }
                    }

                }
            }
            return retVal;
        }
    }