Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm(args));

            Log.Output = Log.Mode.Quiet;
            Eager.Initalize();
        }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
        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");
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
        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]);
            }
        }
Ejemplo n.º 10
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();
            }
        }
Ejemplo n.º 11
0
        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");
            }
        }
Ejemplo n.º 12
0
    /// <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);
    }
Ejemplo n.º 13
0
        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();
            }
        }
Ejemplo n.º 14
0
 public _(IObserver <TSource> observer, Eager parent)
     : base(observer)
 {
     this._parent = parent;
 }
Ejemplo n.º 15
0
        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();
        }
Ejemplo n.º 16
0
 public EagerAndLazyBindingsWithOrOnSyntax <T1, T2> Named(string name)
 {
     return(new EagerAndLazyBindingsWithOrOnSyntax <T1, T2>(Eager.Named(name), Lazy.Named(name)));
 }