示例#1
0
        public Form1()
        {
            InitializeComponent();
            FormClosed += new FormClosedEventHandler((sender, e) => Application.Exit());
#if DEBUG
            ShiminyFactory.AddAssemblySearchPath(@"..\..\..\..\Thing1\bin\x64\Debug");
            ShiminyFactory.AddAssemblySearchPath(@"..\..\..\..\Thing2\bin\x64\Debug");
#else
            ShiminyFactory.AddAssemblySearchPath(@"..\..\..\..\Thing1\bin\x64\Release");
            ShiminyFactory.AddAssemblySearchPath(@"..\..\..\..\Thing2\bin\x64\Release");
#endif
            _assy  = ShiminyFactory.MakeAssemblyShim("Thing1");
            _assy2 = ShiminyFactory.MakeAssemblyShim("Thing2");
        }
            public void WillStyleLargeSourceTextIn1SecondOrLess()
            {
                string    appPath = Path.GetDirectoryName(new Uri(AssemblyShim.GetExecutingAssembly().CodeBase).LocalPath);
                string    source  = File.ReadAllText(Path.Combine(appPath, @"LegacyAcceptanceTests\large.sql"));
                Stopwatch sw      = new Stopwatch();

                sw.Start();

                new CodeColorizer().Colorize(source, Languages.Sql);

                sw.Stop();
                TimeSpan elapsed = sw.Elapsed;

                Assert.True(elapsed.Seconds <= 1);
            }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

#if DEBUG
            ShiminyFactory.AddAssemblySearchPath(@"..\..\..\..\Forms\bin\x64\Debug");
#else
            ShiminyFactory.AddAssemblySearchPath(@"..\..\..\..\Forms\bin\x64\Release");
#endif
            _shim = ShiminyFactory.MakeAssemblyShim("Forms");
            _shim.BeforeUnload += new BeforeUnloadDelegate((assm) => {
                _form.Close();
            });
            _shim.AfterLoad += new AfterLoadDelegate((assm) => {
                _form = assm.New("Forms.Form1");
                assm.New("Forms.Class1");
                _form.ShowDialog();
            });
            _shim.Load();
            Application.Run();
        }