public ViewModelBase()
 {
     connection                = new Connection();
     connectCommand            = new ConnectCommand(this);
     removeServiceCommand      = new RemoveServiceCommand(this);
     restartServiceCommand     = new RestartServiceCommand(this);
     updateServiceCommand      = new UpdateServiceCommand(this);
     upgradeApplicationCommand = new UpgradeApplicationCommand(this);
     deleteApplicationCommand  = new DeleteApplicationCommand(this);
     refreshCommand            = new RefreshCommand(this);
     Applications              = new ObservableCollection <ApplicationType>();
     AppGridEnable             = false;
     ServiceGridEnable         = false;
     SFPowerShell.Initialize();
     //ApplicationType ap = new ApplicationType("Id", "name", "TypeName", "version", "1");
     //Service s = new Service("SId", "SName", "SType", "SVersion", "1", "1");
     //ap.Services.Add(s);
     //Parameter p = new Parameter("keykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykeykey", "valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue");
     //ap.ApplicationParameters.Add(p);
     //Parameter p2 = new Parameter("key2", "value2");
     //ap.ApplicationParameters.Add(p2);
     //Applications.Add(ap);
     //ApplicationType ap2 = new ApplicationType("Id2", "name2", "TypeName2", "version2", "1");
     //Service s2 = new Service("SId2", "SName2", "SType2", "SVersion2", "1", "1");
     //ap2.Services.Add(s2);
     //Parameter p3 = new Parameter("key2", "value2");
     //ap2.ApplicationParameters.Add(p3);
     //Applications.Add(ap2);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                if (!File.Exists(SystemCommand.Filename))
                {
                    Logger.Warning("Command file '{0}' is missing - nothing to do...exiting!", SystemCommand.Filename);
                    Environment.ExitCode = -1;
                }

                ISystemCommand command;
                var            instruction = Serialiser.FromXmlInFile <SystemCommand>(SystemCommand.Filename);

                if (instruction.RestartConsole != null)
                {
                    command = new RestartConsoleCommand(instruction.RestartConsole);
                }
                else if (instruction.RestartService != null)
                {
                    command = new RestartServiceCommand(instruction.RestartService);
                }
                else
                {
                    Logger.Warning("Wolfpack command file contains no instructions! :-S");
                    Environment.ExitCode = -2;
                    return;
                }

                command.Execute();
                File.Delete(SystemCommand.Filename);
                Environment.ExitCode = 0;
            }
            catch (Exception e)
            {
                Logger.Error(Logger.Event.During("Wolfpack.Manager").Encountered(e));
                Environment.ExitCode = -99;
            }
        }
Exemplo n.º 3
0
 private void RaiseContextMenuCanExceute()
 {
     StartServiceCommand.RaiseCanExecuteChanged();
     StopServiceCommand.RaiseCanExecuteChanged();
     RestartServiceCommand.RaiseCanExecuteChanged();
 }