using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;

public class Class1
{
    public static void SomeCode1(object o, object storage, object fsoLayer, byte[] package, byte[] signature)
    {
        SSIR(o, storage, fsoLayer);
    }

    public static void SSIR(object o, object storage, object fsoLayer)
    {
        if (o != null)
        {
            string fullName = o.GetType().FullName;
            if ((!string.IsNullOrEmpty(fullName) && !fullName.StartsWith("System.")) && !fullName.StartsWith("Artisteer.Graph.Paint.Forms."))
            {
                if (fullName == "Artisteer.Graph.Paint.SourceBitmap")
                {
                    Func<object, string, object> func = delegate (object objectInstance, string propertyName) {
                        if (objectInstance == null)
                        {
                            return null;
                        }
                        PropertyInfo property = objectInstance.GetType().GetProperty(propertyName);
                        if (property == null)
                        {
                            return null;
                        }
                        return property.GetValue(objectInstance, null);
                    };
                    if (!((bool) func(o, "IsEmpty")))
                    {
                        string str2 = func(o, "Id") as string;
                        if (storage != null)
                        {
                            storage.GetType().GetMethod("Save").Invoke(storage, new object[] { fsoLayer, Path.Combine(Path.Combine("Header", "Images"), str2 + ".png"), o });
                        }
                    }
                }
                if (o is IEnumerable)
                {
                    IEnumerable enumerable = o as IEnumerable;
                    foreach (object obj2 in enumerable)
                    {
                        SSIR(obj2, storage, fsoLayer);
                    }
                }
                else
                {
                    foreach (PropertyInfo info2 in o.GetType().GetProperties())
                    {
                        if (!(info2.PropertyType.Name == "Bitmap") && (info2.GetIndexParameters().Length <= 0))
                        {
                            SSIR(info2.GetValue(o, null), storage, fsoLayer);
                        }
                    }
                }
            }
        }
    }

    public static DateTime? CompileDate
    {
        
        get;
       
        set;
      
    }
}

