static void Main(string[] args) { #region Pattern de Criação Console.WriteLine("########### PATTERNS DE CRIAÇÃO #############"); Console.WriteLine(""); SingletonApp.Executar(); FactoryMethodApp.Executar(); BuilderApp.Executar(); PrototypeApp.Executar(); #endregion #region Pattern Estrutural Console.WriteLine("########### PATTERNS ESTRUTURAL #############"); Console.WriteLine(""); AdapterApp.Executar(); #endregion #region Pattern Comportamental Console.WriteLine("########### PATTERNS COMPORTAMENTAL #########"); Console.WriteLine(""); #endregion Console.ReadKey(); }
public App() { _singletonApp = new SingletonApp("OPSCallCenterCRM"); GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.Register <IDialogService>(() => new DialogService()); GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.Register <IGenericSettingsRepository <AppPreferences> >(() => new SettingsRepository()); GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.Register <IUserInfoSettingsRepository>(() => new UserInfoSettingsRepository()); }
private static void Main() { //检测.net版本。 if (!VersionCheck.Check4FromRegistry()) { MessageBox.Show(".net版本过低。本程序需要运行在.net4.0或.net4.0以后的版本!", "提示"); return; } App.Instance.ApplicationDirectory = Environment.CurrentDirectory + "\\"; //同时只能运行一个实例。 if (SingletonApp.IsMutexExsited) { SingletonApp.ShowRunningInstance(); return; } //指定运行日志要保存的目录 RunningLog.Start(App.Instance.ApplicationDirectory + "\\history\\"); //判断当前登录用户是否为管理员 if (WindowsAuthority.IsAdministrator) { //设置应用程序退出和异常的事件 Application.ApplicationExit += App.Instance.RaiseApplicationExist; Application.ThreadExit += App.Instance.RaiseMainThreadExist; Application.ThreadException += (o, e) => MessageBox.Show(e.Exception.ToString()); try { //运行应用程序内核 App.Instance.BuildModule(); App.Instance.Initialize(); App.Instance.RaiseStarting(); //启动Ui界面 IInvoke invoker = ObjectGenerator.Create("FlightViewerUI.dll", "BinHong.FlightViewerUI.UiInvoker") as IInvoke; invoker.Invoke(); } catch (Exception e) { string msg = e.Message; #if DEBUG msg = e.Message + e.StackTrace; #endif RunningLog.Record(LogType.System, LogLevel.Error, msg); Thread.Sleep(200); MessageBox.Show(msg); } finally { SingletonApp.ReleaseMutex(); } } else { WindowsAuthority.RunAsAdministrator(Application.ExecutablePath); } }
static void Main(string [] args) { Console.WriteLine("-------- CREATIONALS PATTERNS --------"); Console.WriteLine(); Console.WriteLine("-------- ABSTRACT FACTORY --------"); AbstractFactoryMundoAnimalApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- BUILDER --------"); VeiculoBuilderApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- FACTORY --------"); FactoryDocumentApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- SINGLETON --------"); SingletonApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- PROTOTYPE --------"); PrototypeCoresApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- STRUCTURALS PATTERNS --------"); Console.WriteLine(); Console.WriteLine("-------- ADAPTER --------"); AdapterApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- BRIDGE --------"); BridgeApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- COMPOSITE --------"); CompositeApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- DECORATOR --------"); DecoratorApp.Execute(); Console.WriteLine(); Console.WriteLine("-------- FACADE --------"); FacadeHipotecaApp.Execute(); }
public App() { _singletonApp = new SingletonApp("OPSCallCenterCRMServer"); SimpleIoc.Default.Register <IDialogService>(() => new DialogService()); SimpleIoc.Default.Register <IDatabaseClient <CrmEntry> >(() => new DatabaseClient <CrmEntry>()); SimpleIoc.Default.Register <IUserInfoSettingsRepository>(() => new UserInfoSettingsRepository()); SimpleIoc.Default.Register <IClient>(() => new Client()); SimpleIoc.Default.Register <IGenericSettingsRepository <AppPreferences> >(() => new GenericSettingsRepository <AppPreferences>()); }
static void Main(string[] args) { // Creational AbstractFactoryApp.Execute(); FactoryMethodApp.Execute(); SingletonApp.Execute(); // Structural AdapterApp.Execute(); FacadeApp.Execute(); }
public App() { singletonApp = new SingletonApp("OPSEmailSender"); InitDependencies(); }
public App() { _singletonApp = new SingletonApp("OPSAgentDialer"); InitDependencies(); }
public App() { singletonApp = new SingletonApp("OPSAutoDialer"); InitDependencies(); }
static void Main() { SingletonApp.Run(new MyForm()); }
public void Init() { _target = new SingletonApp(new ConfigServiceStub()); }
public App() { _singletonApp = new SingletonApp("OPSIVRStudio"); InitDependencies(); }