public static void Main(string[] args) { Thread.Sleep(15 * 1000); //Initialize everything Log.FilePath = (Environment.ExpandEnvironmentVariables("%userprofile%") + @"\fog_user.log"); AppDomain.CurrentDomain.UnhandledException += Log.UnhandledException; Eager.Initalize(); Log.Entry(LogName, "Initializing"); if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\updating.info")) { Log.Entry(LogName, "Update.info found, exiting program"); Power.SpawnUpdateWaiter(Assembly.GetExecutingAssembly().Location); Environment.Exit(0); } _fogService = new FOGUserService(); _fogService.Start(); if (RegistryHandler.GetSystemSetting("Tray").Equals("1")) { StartTray(); } }
public static void Main(string[] args) { Eager.Initalize(); //Update Line //Check if an parameter was passed if (args.Length == 0) { return; } //Wait for all update files to be applied while (UpdaterHelper.Updating()) { } //Spawn the process that originally called this program var param = ""; if (args.Length > 1) { param = args[1]; } SpawnParentProgram(args[0], param); }
public static void Main(string[] args) { Log.Output = Log.Mode.Console; Eager.Initalize(); _instance = new Zazzles.Debugger.Debugger(); _instance.AddCommand("module", new ModuleCommand()); _instance.AddCommand("dump", new DumpCommand()); _instance.AddCommand("power", new PowerCommand()); if (args.Length > 0) { _instance.ProcessCommand(args); return; } Log.PaddedHeader("FOG Console"); Log.Entry(Name, "Type ? for a list of commands"); Log.NewLine(); try { InteractiveShell(); } catch (Exception ex) { Log.Error(Name, ex); Console.ReadLine(); } }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(args)); Log.Output = Log.Mode.Quiet; Eager.Initalize(); }
public static void Main(string[] args) { Eager.Initalize(); if (args.Length > 0) { Log.FilePath = args[0]; Log.Output = Log.Mode.File; } UpdaterHelper.ApplyUpdate <WindowsUpdate, MacUpdate, LinuxUpdate>("FOGService"); }
private static void Main(string[] args) { if (args.Length > 0 && args[0].Equals("jit", StringComparison.OrdinalIgnoreCase)) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(args)); Log.Output = Log.Mode.Quiet; Eager.Initalize(); }
public NotificationIcon() { Log.Output = Log.Mode.Quiet; Eager.Initalize(); Bus.SetMode(Bus.Mode.Client); Bus.Subscribe(Bus.Channel.Notification, OnNotification); Bus.Subscribe(Bus.Channel.Update, OnUpdate); Bus.Subscribe(Bus.Channel.Status, OnStatus); _notifyIcon = new NotifyIcon(); var notificationMenu = new ContextMenu(InitializeMenu()); _notifyIcon.DoubleClick += IconDoubleClick; _notifyIcon.Icon = new Icon(Path.Combine(Settings.Location, "logo.ico")); _notifyIcon.ContextMenu = notificationMenu; _notifyIcon.Text = "FOG Client v" + Settings.Get("Version"); }
public NotificationIcon() { Eager.Initalize(); Bus.SetMode(Bus.Mode.Client); Bus.Subscribe(Bus.Channel.Notification, OnNotification); Bus.Subscribe(Bus.Channel.Update, OnUpdate); _notifyIcon = new NotifyIcon(); var notificationMenu = new ContextMenu(InitializeMenu()); _notifyIcon.DoubleClick += IconDoubleClick; var resources = new ComponentResourceManager(typeof(NotificationIcon)); _notifyIcon.Icon = (Icon)resources.GetObject("icon"); _notifyIcon.ContextMenu = notificationMenu; _notification = new Notification(); }
public static void Main(string[] args) { Eager.Initalize(); //Update Line //Check if an parameter was passed if (args.Length <= 0) { return; } //Wait for all update files to be applied while (UpdateFilePresent()) { } //Spawn the process that originally called this program if (File.Exists(args[0])) { SpawnParentProgram(args[0]); } }
public static void Main(string[] args) { Log.Output = Log.Mode.Console; Log.Verbose = true; Eager.Initalize(); Log.PaddedHeader("FOG Console"); Log.Entry(Name, "Type help for a list of commands"); Log.NewLine(); try { Bus.Subscribe(Bus.Channel.Debug, OnMessage); InteractiveShell(); } catch (Exception ex) { Log.Error(Name, ex); Console.ReadLine(); } }
public static void Main(string[] args) { Eager.Initalize(); var service = new ServiceController("fogservice"); const string logName = "Update Helper"; Log.Entry(logName, "Shutting down service..."); //Stop the service if (service.Status == ServiceControllerStatus.Running) { service.Stop(); } service.WaitForStatus(ServiceControllerStatus.Stopped); Log.Entry(logName, "Killing remaining FOG processes..."); if (Process.GetProcessesByName("FOGService").Length > 0) { foreach (var process in Process.GetProcessesByName("FOGService")) { process.Kill(); } } Log.Entry(logName, "Applying MSI..."); ApplyUpdates(); //Start the service Log.Entry(logName, "Starting service..."); service.Start(); service.WaitForStatus(ServiceControllerStatus.Running); service.Dispose(); if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\updating.info")) { File.Delete(AppDomain.CurrentDomain.BaseDirectory + @"\updating.info"); } }
/// <summary> /// This generates the conditions of the new cow /// </summary> private void GenerateConditions() { //:TODO: add individual variation into fuzzy distributions // Wellness - Physical conditions m_Pain = new Pain(this); m_Sick = new Sick(this); m_Wounded = new Wounded(this); m_Damage = new Damage(this); m_Tired = new Tired(this); m_Hungry = new Hungry(this); m_Thirsty = new Thirsty(this); m_Dead = new Dead(this); // Contentment - Mental conditions m_Anger = new Angry(this); m_Sleepy = new Sleepy(this); m_Scared = new Scared(this); m_Bored = new Bored(this); m_Lonely = new Lonely(this); m_Happy = new Happy(this); m_Eager = new Eager(this); }
public static void Main(string[] args) { Log.Output = Log.Mode.Quiet; Log.FilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".fog_user.log"); Log.Output = Log.Mode.File; AppDomain.CurrentDomain.UnhandledException += Log.UnhandledException; Eager.Initalize(); if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "updating.info"))) { Log.Entry(LogName, "Update.info found, exiting program"); UpdateWaiterHelper.SpawnUpdateWaiter(Settings.Location); Environment.Exit(0); } _fogService = new FOGUserService(); _fogService.Start(); if (Settings.Get("Tray").Equals("1")) { StartTray(); } }
public _(IObserver <TSource> observer, Eager parent) : base(observer) { this._parent = parent; }
static void Main(string[] args) { var obj = InstanceRestrict.Create(); var simpleSingleTon = SimpleSingleTon.Create(); var simpleSingleTon1 = SimpleSingleTon.Instance; if (simpleSingleTon.Equals(simpleSingleTon1)) { Console.WriteLine("SimpleSingleTon Valid"); } else { Console.WriteLine("SimpleSingleTon Invalid"); } var single = SingleTonThreadSafeWithoutLock.Instance; var single1 = SingleTonThreadSafeWithoutLock.SingleTon; if (single.Equals(single1)) { Console.WriteLine("SimpleSingleTon Valid"); } else { Console.WriteLine("SimpleSingleTon Invalid"); } if (args.Length == 0) { Console.WriteLine("No args"); } else { Eager.StaticMethod(); } Console.WriteLine("Before static method"); Lazy.StaticMethod(); Console.WriteLine("Before construction"); Lazy lazy = new Lazy(); Console.WriteLine("Before instance method"); lazy.InstanceMethod(); Console.WriteLine("Before static method using field"); Lazy.StaticMethodUsingField(); Console.WriteLine("End"); var constDest = new ConstDecons(); Console.WriteLine(constDest.IsSquare() ? "It is square" : "It is not square"); (int len, int bre) = constDest; Console.WriteLine($"Len: {len}"); Console.WriteLine($"Bre: {bre}"); string test = "hi"; Console.WriteLine(test?[0]); Console.WriteLine(SuperLazySingleTon.ToString()); Console.WriteLine("Boxing and Unboxing"); int a = 1; object b = a; // boxing a value type to ref type int c = (int)b; // unboxing ref type to value type Console.Write("Generic"); Inherited1 in1 = new Inherited1() { C = 1, D = 2 }; Inherited2 in2 = new Inherited2() { C = 3, D = 4 }; BaseClass baseClass = AddTwo <BaseClass>(in1, in2); Console.WriteLine($"Base Class = C:{baseClass.C} D:{baseClass.D}"); var resultCompare = Max <BaseClass>(in1, in2); Console.WriteLine($"Comparison : {resultCompare.D}"); Console.ReadLine(); }
public EagerAndLazyBindingsWithOrOnSyntax <T1, T2> Named(string name) { return(new EagerAndLazyBindingsWithOrOnSyntax <T1, T2>(Eager.Named(name), Lazy.Named(name))); }