예제 #1
0
        public JavaPackage(string name, JavaPackage parent = null) : base(parent, name, JavaPackageElementTypes.Package)
        {
            Packages = new JavaPackageCollection();

            Classes   = new ClassFileCollection();
            Resources = new JavaPackageResourceCollection();
        }
예제 #2
0
        static IEnumerable <JavaPackage> EnumeratePackages(JavaPackage package)
        {
            foreach (var f in package.Packages)
            {
                yield return(f);
            }

            yield return(package);
        }
예제 #3
0
        protected JavaPackageElement(JavaPackage parent, string name, JavaPackageElementTypes type)
        {
            Parent = parent;
            Name   = name;

            Type = type;

            Extension = Type.GetExtension();
        }
예제 #4
0
        static IEnumerable <JavaPackageResource> EnumerateResources(JavaPackage package)
        {
            foreach (var r in package.Resources)
            {
                yield return(r);
            }

            foreach (var f in package.Packages)
            {
                foreach (var r in EnumerateResources(f))
                {
                    yield return(r);
                }
            }
        }
예제 #5
0
        static IEnumerable <ClassFile> EnumerateClasses(JavaPackage package)
        {
            foreach (var c in package.Classes)
            {
                yield return(c);
            }

            foreach (var f in package.Packages)
            {
                foreach (var c in EnumerateClasses(f))
                {
                    yield return(c);
                }
            }
        }
예제 #6
0
        public JavaPackageResource(string name, JavaPackage parent, Stream resStream, string extension) : base(parent, name, JavaPackageElementTypes.Other)
        {
            Extension = extension;

            Content = resStream.ReadAllBytes();
        }