コード例 #1
0
ファイル: Common.cs プロジェクト: reflection-emit/Cauldron
        public static Window CreateWindow(ref WindowType windowType)
        {
            if (windowType == null && Factory.HasContract(typeof(Window)))
            {
                windowType = new WindowType {
                    IsFactoryType = true
                }
            }
            ;

            if (windowType == null)
            {
                windowType = new WindowType {
                    Type = Assemblies.ExportedTypes.FirstOrDefault(x => x.IsSubclassOf(typeof(Window)))
                }
            }
            ;

            if (windowType == null)
            {
                windowType = new WindowType {
                    Type = typeof(Window)
                }
            }
            ;

            return(windowType.CreateWindow());
        }
    }
}
コード例 #2
0
        public static Window CreateWindow(ref WindowType windowType)
        {
            if (windowType == null && Factory.HasContract(typeof(Window)))
            {
                windowType = new WindowType {
                    IsFactoryType = true
                }
            }
            ;

            if (windowType == null)
            {
                windowType = new WindowType {
                    Type = typeof(Window)
                }
            }
            ;

            return(windowType.CreateWindow());
        }
    }
}