Exemple #1
0
        public AsfObject[] ReadObjects(uint count, long position)
        {
            ArrayList l = new ArrayList();

            for (int i = 0; i < (int)count; i++)
            {
                Seek(position);
                AsfGuid id = ReadGuid();

                AsfObject obj;

                if (id.Equals(AsfGuid.AsfFilePropertiesObject))
                {
                    obj = new AsfFilePropertiesObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfStreamPropertiesObject))
                {
                    obj = new AsfStreamPropertiesObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfContentDescriptionObject))
                {
                    obj = new AsfContentDescriptionObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfExtendedContentDescriptionObject))
                {
                    obj = new AsfExtendedContentDescriptionObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfPaddingObject))
                {
                    obj = new AsfPaddingObject(this, position);
                }
                else
                {
                    obj = new AsfUnknownObject(this, position);
                }

                l.Add(obj);
                position += obj.OriginalSize;
            }

            return((AsfObject[])l.ToArray(typeof(AsfObject)));
        }
Exemple #2
0
		public AsfObject[] ReadObjects(uint count, long position)
		{
			ArrayList l = new ArrayList();
			for (int i = 0; i < (int)count; i++)
			{
				Seek(position);
				AsfGuid id = ReadGuid();

				AsfObject obj;

				if (id.Equals(AsfGuid.AsfFilePropertiesObject))
					obj = new AsfFilePropertiesObject(this, position);
				else if (id.Equals(AsfGuid.AsfStreamPropertiesObject))
					obj = new AsfStreamPropertiesObject(this, position);
				else if (id.Equals(AsfGuid.AsfContentDescriptionObject))
					obj = new AsfContentDescriptionObject(this, position);
				else if (id.Equals(AsfGuid.AsfExtendedContentDescriptionObject))
					obj = new AsfExtendedContentDescriptionObject(this, position);
				else if (id.Equals(AsfGuid.AsfPaddingObject))
					obj = new AsfPaddingObject(this, position);
				else
					obj = new AsfUnknownObject(this, position);

				l.Add(obj);
				position += obj.OriginalSize;
			}

			return (AsfObject[])l.ToArray(typeof(AsfObject));
		}