private void SetLaunchType()
        {
            if (!IsProfileSelected)
            {
                _launchTypes = new List <LaunchType>();
            }
            else if (SelectedDebugProfile.CommandName == ProfileCommandNames.Executable ||
                     (SelectedDebugProfile.CommandName == ProfileCommandNames.IISExpress))
            {
                _launchTypes = LaunchType.GetExecutableOnlyLaunchTypes().ToList <LaunchType>();
            }
            else
            {
                _launchTypes = LaunchType.GetBuiltInLaunchTypes().ToList <LaunchType>();
            }

            OnPropertyChanged(nameof(LaunchTypes));

            // The selected launch type has to be tweaked for DotNet since in dotnet we don't want to support commands and yet user might have some commands
            if (!IsProfileSelected)
            {
                SelectedLaunchType = null;
            }
            else
            {
                var selCommandName = SelectedDebugProfile.CommandName;
                SelectedLaunchType = LaunchType.GetAllLaunchTypes().Where(lt => lt.CommandName == selCommandName).SingleOrDefault();
            }
        }
예제 #2
0
 private void RestoreLaunchType()
 {
     if (settings.Contains(LaunchTypeKey))
     {
         launchType = (LaunchType)settings[LaunchTypeKey];
     }
 }
예제 #3
0
        public async Task <IEnumerable <string> > ListServicesAsync(string cluster, LaunchType launchType)
        {
            List <string> list = new List <string>();

            Amazon.ECS.Model.ListServicesResponse response = null;
            while ((response = await _client.ListServicesAsync(
                        new Amazon.ECS.Model.ListServicesRequest()
            {
                NextToken = response?.NextToken,
                Cluster = cluster,
                MaxResults = 10,
                LaunchType = launchType
            }))?.HttpStatusCode == System.Net.HttpStatusCode.OK)
            {
                if (!response.ServiceArns.IsNullOrEmpty())
                {
                    list.AddRange(response.ServiceArns);
                }

                if (response.NextToken.IsNullOrEmpty())
                {
                    break;
                }

                await Task.Delay(100);
            }

            response.EnsureSuccess();
            return(list);
        }
        public async Task <XmlHistory> PatchAsync(LaunchType launchType)
        {
            var history = new XmlHistory();

            history.Success = false;

            var totalProgress = new ProgressObject();

            var logForm = new LogForm(totalProgress);

            logForm.InvokeIfRequired(() => logForm.Show());

            try
            {
                List <PatchGroup> patches = PatchManager.SaveInstructions(ref history);

                await Task.Run(() => PatchManager.ApplyInstructions(launchType, patches, totalProgress)).ConfigureAwait(false);

                history.Success = true;
            }
            catch (Exception exception)
            {
                Logger.Error(exception, "Patching failed because instructions cannot be applied.");
            }

            if (!history.Success)
            {
                PatchingHelper.RestorePatchedFiles(AppContextManager.Context.Value, history.Files);
            }

            logForm.InvokeIfRequired(() => CloseForm(logForm));

            return(history);
        }
예제 #5
0
        public async Task LaunchTestRunAsync(LaunchType launchType = LaunchType.Test)
        {
            MainWindow.Enabled = false;
            new Thread(o => AskUnlockGUI()).Start();

            State.Value = LaunchManagerState.IsPatching;

            XmlHistory history = await this.PatchAsync(launchType).ConfigureAwait(false);

            State.Value = LaunchManagerState.Idle;

            PatchingHelper.RestorePatchedFiles(AppContextManager.Context.Value, history.Files);

            if (PreferencesManager.OpenLogAfterPatch)
            {
                try
                {
                    string logPath = LogManager.Logs.First(kvp => kvp.Key == "PatchManager").Value;

                    TryOpenTextFile(logPath);
                }
                catch (Exception exception)
                {
                    Logger.Error(exception, "Cannot open log file after test run");
                }
            }
        }
예제 #6
0
 public GUIOPtion(string[] args)
 {
     for (int i = 0; i < args.Length; ++i)
     {
         string arg = args[i];
         if (arg == "-p" || arg == "--port")
         {
             ServerPort = int.Parse(args[i + 1]);
             ++i;
         }
         else if (arg == "-l" || arg == "--launch")
         {
             string opt = args[i + 1];
             if (opt == "standalone")
             {
                 LaunchType = LaunchType.Standalone;
             }
             else if (opt == "server")
             {
                 LaunchType = LaunchType.Server;
             }
             else if (opt == "debug")
             {
                 LaunchType = LaunchType.Debug;
             }
             else
             {
                 LaunchType = LaunchType.Client;
             }
         }
     }
 }
        private static Task Launch(Action <TaskCompletionSource <bool> > action, LaunchType launchType)
        {
            var promise = new TaskCompletionSource <bool>();

            Launch(() => action(promise), launchType);
            return(promise.Task);
        }
        public async Task LaunchTestRunAsync(LaunchType launchType = LaunchType.Test)
        {
            StartUnlockDialog();

            SetState(LaunchManagerState.IsPatching);

            XmlHistory history = await this.PatchAsync(launchType).ConfigureAwait(false);

            SetState(LaunchManagerState.Idle);

            PatchingHelper.RestorePatchedFiles(AppContextManager.Context.Value, history.Files);

            if (!PreferencesManager.OpenLogAfterPatch)
            {
                return;
            }

            try
            {
                string logPath = LogManager.Logs.First(kvp => kvp.Key == "PatchManager").Value;

                TryOpenTextFile(logPath);
            }
            catch (Exception exception)
            {
                Logger.Error(exception, "Cannot open log file after test run");
            }
        }
예제 #9
0
 public LaunchDetails(IntPtr o)
 {
     DeeplinkMessage = CAPI.ovr_LaunchDetails_GetDeeplinkMessage(o);
     LaunchType      = CAPI.ovr_LaunchDetails_GetLaunchType(o);
     RoomID          = CAPI.ovr_LaunchDetails_GetRoomID(o);
     Users           = new UserList(CAPI.ovr_LaunchDetails_GetUsers(o));
 }
예제 #10
0
 public WorkflowDataInfo(int id, string name, LaunchType launchType, bool isEnabled, string desc)
 {
     Id          = id;
     Name        = name;
     LaunchType  = launchType;
     IsEnabled   = isEnabled;
     Description = desc;
 }
예제 #11
0
 public WorkflowDataInfo(int id, string name, LaunchType launchType, bool isEnabled, string desc)
 {
     this.Id          = id;
     this.Name        = name;
     this.LaunchType  = launchType;
     this.IsEnabled   = isEnabled;
     this.Description = desc;
 }
 public BankAccountLaunches(int sourceBankAccountId, DateTime date, LaunchType type, decimal LaunchValue, int destinyBankAccountId = 0)
 {
     this.SourceBankAccountId = sourceBankAccountId;
     this.Date                 = date;
     this.Type                 = type;
     this.LaunchValue          = LaunchValue;
     this.DestinyBankAccountId = destinyBankAccountId;
 }
예제 #13
0
 public WorkflowInfo(int id, string name, LaunchType launchType, bool isEnabled, string desc, bool isRunning, bool isPaused)
 {
     Id          = id;
     Name        = name;
     LaunchType  = launchType;
     IsEnabled   = isEnabled;
     Description = desc;
     IsRunning   = isRunning;
     IsPaused    = isPaused;
 }
예제 #14
0
 public WorkflowInfo(int id, string name, LaunchType launchType, bool isEnabled, string desc, bool isRunning, bool isPaused)
 {
     this.Id          = id;
     this.Name        = name;
     this.LaunchType  = launchType;
     this.IsEnabled   = isEnabled;
     this.Description = desc;
     this.IsRunning   = isRunning;
     this.IsPaused    = isPaused;
 }
예제 #15
0
 // Starts launch sequence
 static public void Launch(LaunchType t)
 {
     if (sInstance != null)
     {
         // Mark the launch time and type. We don't launch
         // just yet because Cozmo needs to delay by `launchDelay`
         // to look up.
         sInstance.mLaunchTime = Time.realtimeSinceStartup;
         sInstance.mType       = t;
     }
 }
            public override bool Equals(object obj)
            {
                LaunchType oth = obj as LaunchType;

                if (oth != null)
                {
                    return(CommandName.Equals(oth.CommandName));
                }

                return(false);
            }
        /// <exception cref="T:System.ComponentModel.Win32Exception">There was an error in launching the process.</exception>
        public async Task LaunchModdedAsync(LaunchType launchType = LaunchType.Patch)
        {
            StartUnlockDialog(true);

            SetState(LaunchManagerState.IsPatching);

            await this.PatchAsync(launchType).ConfigureAwait(false);

            SetState(LaunchManagerState.Idle);

            LaunchProcess(MainWindow.ClientType);
        }
예제 #18
0
 public WorkflowInfo(int id, string name, LaunchType launchType, bool isEnabled, string desc, bool isRunning, bool isPaused, string period, string path, bool isExecutionGraphEmpty)
 {
     Id                    = id;
     Name                  = name;
     LaunchType            = launchType;
     IsEnabled             = isEnabled;
     Description           = desc;
     IsRunning             = isRunning;
     IsPaused              = isPaused;
     Period                = period;
     Path                  = path;
     IsExecutionGraphEmpty = isExecutionGraphEmpty;
 }
예제 #19
0
        /// <exception cref="T:System.ComponentModel.Win32Exception">There was an error in launching the process.</exception>
        public async Task LaunchModdedAsync(LaunchType launchType = LaunchType.Patch)
        {
            MainWindow.Enabled = false;
            new Thread(o => AskUnlockGUI(true)).Start();

            State.Value = LaunchManagerState.IsPatching;

            await this.PatchAsync(launchType).ConfigureAwait(false);

            State.Value = LaunchManagerState.Idle;

            LaunchProcess(MainWindow.ClientType);
        }
예제 #20
0
        private void LaunchUrl(LaunchType launchType)
        {
            switch (launchType)
            {
            case LaunchType.ChangeLog:
                Process.Start("https://github.com/gitextensions/gitextensions/blob/master/GitUI/Resources/ChangeLog.md");
                break;

            case LaunchType.DirectDownload:
                Process.Start(UpdateUrl);
                break;
            }
        }
예제 #21
0
        private void LaunchUrl(LaunchType launchType)
        {
            switch (launchType)
            {
            case LaunchType.ChangeLog:
                OsShellUtil.OpenUrlInDefaultBrowser(@"https://github.com/gitextensions/gitextensions/blob/master/GitUI/Resources/ChangeLog.md");
                break;

            case LaunchType.DirectDownload:
                OsShellUtil.OpenUrlInDefaultBrowser(UpdateUrl);
                break;
            }
        }
예제 #22
0
 public WorkflowInfo(int id, string name, LaunchType launchType, bool isEnabled, string desc, bool isRunning, bool isPaused, string period, string cronExpression, string path, bool isExecutionGraphEmpty, Variable[] localVariables)
 {
     Id                    = id;
     Name                  = name;
     LaunchType            = launchType;
     IsEnabled             = isEnabled;
     Description           = desc;
     IsRunning             = isRunning;
     IsPaused              = isPaused;
     Period                = period;
     CronExpression        = cronExpression;
     Path                  = path;
     IsExecutionGraphEmpty = isExecutionGraphEmpty;
     LocalVariables        = localVariables;
 }
예제 #23
0
 public WorkflowInfo(string dbId, int id, string name, LaunchType launchType, bool isEnabled, bool isApproval, bool isWaitingForApproval, string desc, bool isRunning, bool isPaused, string period, string cronExpression, bool isExecutionGraphEmpty, Variable[] localVariables)
 {
     DbId                  = dbId;
     Id                    = id;
     Name                  = name;
     LaunchType            = launchType;
     IsEnabled             = isEnabled;
     IsApproval            = isApproval;
     IsWaitingForApproval  = isWaitingForApproval;
     Description           = desc;
     IsRunning             = isRunning;
     IsPaused              = isPaused;
     Period                = period;
     CronExpression        = cronExpression;
     IsExecutionGraphEmpty = isExecutionGraphEmpty;
     LocalVariables        = localVariables;
 }
예제 #24
0
        /// <summary>
        /// For documentation, see the sample code in
        /// http://code.msdn.microsoft.com/wpapps/Fast-app-resume-backstack-f16baaa6.
        ///
        /// When resuming the app, this method is first called with NavigationMode.Reset,
        /// followed by a call with NavigationMode.New. Reset implies that the app is being
        /// resumed. The call to New should apply FAR if the previous call was a Reset,
        /// therefore, Reset sets variable wasRelaunched to indicate to the next New call
        /// that FAR should take place.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            var uri = e.Uri.ToString();

            if (launchType == LaunchType.None && e.NavigationMode == NavigationMode.New)
            {
                // initial launch
                if (IsDeepLink(uri))
                {
                    launchType = LaunchType.DeepLink;
                }
                else if (IsMainPage(uri))
                {
                    launchType = LaunchType.Home;
                }
            }
            if (e.NavigationMode == NavigationMode.Reset)
            {
                wasRelaunched = true;
            }
            else if (e.NavigationMode == NavigationMode.New && wasRelaunched)
            {
                // the previous navigation was a Reset
                wasRelaunched = false;
                if (IsDeepLink(uri))
                {
                    launchType = LaunchType.DeepLink;
                }
                else if (IsMainPage(uri))
                {
                    if (launchType == LaunchType.DeepLink)
                    {
                        launchType = LaunchType.Home;
                    }
                    else if (!shouldClearPageStack)
                    {
                        // fast application resume: cancels navigation to the page, resume the one from the backstack
                        e.Cancel             = true;
                        RootFrame.Navigated -= ClearBackStackAfterReset;
                    }
                }
                shouldClearPageStack = false;
            }
        }
예제 #25
0
        public void Launch(LaunchType launchType, string[] args = null)
        {
            this.launchType = launchType;
            this.args       = args;

            var verHandler = new JVMVersionHandler();
            var reader     = new ConfigReader();

            launcherConfig = reader.Config;
            selectedJVM    = verHandler.GetPrefferedJVM(launcherConfig.Launcher);

            if (selectedJVM == null)
            {
                Console.WriteLine("no prefered jvm found");
                return;
            }

            LaunchApp();
        }
예제 #26
0
        private void UpdateLaunchTypes()
        {
            // Populate the set of unique launch types from the list of providers since there can be duplicates with different priorities. However,
            // the command name will be the same so we can grab the first one for the purposes of populating the list
            if (_providerLaunchTypes == null)
            {
                _providerLaunchTypes = new List <LaunchType>();
                foreach (Lazy <ILaunchSettingsUIProvider, IOrderPrecedenceMetadataView> provider in _uiProviders)
                {
                    if (_providerLaunchTypes.FirstOrDefault((lt) => lt.CommandName.Equals(provider.Value.CommandName)) == null)
                    {
                        _providerLaunchTypes.Add(new LaunchType()
                        {
                            CommandName = provider.Value.CommandName, Name = provider.Value.FriendlyName
                        });
                    }
                }
            }

            IWritableLaunchProfile selectedProfile    = SelectedDebugProfile;
            LaunchType             selectedLaunchType = null;

            _launchTypes = new List <LaunchType>();
            if (selectedProfile != null)
            {
                _launchTypes.AddRange(_providerLaunchTypes);

                selectedLaunchType = _launchTypes.FirstOrDefault((launchType) => string.Equals(launchType.CommandName, selectedProfile.CommandName));
                if (selectedLaunchType == null)
                {
                    selectedLaunchType = new LaunchType()
                    {
                        CommandName = selectedProfile.CommandName, Name = selectedProfile.CommandName
                    };
                    _launchTypes.Insert(0, selectedLaunchType);
                }
            }

            // Need to notify the list has changed prior to changing the selected one
            OnPropertyChanged(nameof(LaunchTypes));

            SelectedLaunchType = selectedLaunchType;
        }
예제 #27
0
 public LaunchDetails(IntPtr o)
 {
     DeeplinkMessage = CAPI.ovr_LaunchDetails_GetDeeplinkMessage(o);
     LaunchSource    = CAPI.ovr_LaunchDetails_GetLaunchSource(o);
     LaunchType      = CAPI.ovr_LaunchDetails_GetLaunchType(o);
     RoomID          = CAPI.ovr_LaunchDetails_GetRoomID(o);
     {
         var pointer = CAPI.ovr_LaunchDetails_GetUsers(o);
         Users = new UserList(pointer);
         if (pointer == IntPtr.Zero)
         {
             UsersOptional = null;
         }
         else
         {
             UsersOptional = Users;
         }
     }
 }
예제 #28
0
파일: MacEngine.cs 프로젝트: mingyaaaa/xwt
        public override void DidFinishLaunching(NSNotification notification)
        {
            launched = true;

            NSObject val;

            if (notification.UserInfo.TryGetValue(NSApplication.LaunchIsDefaultLaunchKey, out val))
            {
                var num = val as NSNumber;
                if (num != null)
                {
                    LaunchReason = num.BoolValue ? LaunchType.Normal : LaunchType.LaunchedFromFileManager;
                }
            }

            foreach (var w in pendingWindows)
            {
                w.InternalShow();
            }
        }
예제 #29
0
 public WorkflowInfo(string dbId, int id, Guid instanceId, string name, LaunchType launchType, bool isEnabled, bool isApproval, bool enableParallelJobs, bool isWaitingForApproval, string desc, bool isRunning, bool isPaused, string period, string cronExpression, bool isExecutionGraphEmpty, Variable[] localVariables, string startedOn)
 {
     DbId                  = dbId;
     Id                    = id;
     InstanceId            = instanceId;
     Name                  = name;
     LaunchType            = launchType;
     IsEnabled             = isEnabled;
     IsApproval            = isApproval;
     EnableParallelJobs    = enableParallelJobs;
     IsWaitingForApproval  = isWaitingForApproval;
     Description           = desc;
     IsRunning             = isRunning;
     IsPaused              = isPaused;
     Period                = period;
     CronExpression        = cronExpression;
     IsExecutionGraphEmpty = isExecutionGraphEmpty;
     LocalVariables        = localVariables;
     StartedOn             = startedOn;
 }
예제 #30
0
        private threadingTask.Task CreateService()
        {
            throw new NotImplementedException("Services should be created and configured manually for now.");

            var request = new CreateServiceRequest
            {
                Cluster        = DefaultSettings.General.ClusterName,
                LaunchType     = LaunchType.FindValue(DefaultSettings.General.ServiceLaunchType),
                DesiredCount   = DefaultSettings.General.ServiceNumberOfTasks,
                ServiceName    = DefaultSettings.General.ServiceName,
                TaskDefinition = TaskDefenition.TaskDefinitionArn,
                LoadBalancers  = new List <LoadBalancer>
                {
                    new LoadBalancer {
                        LoadBalancerName = DefaultSettings.General.ServiceName,
                    }
                }
            };

            return(ECSClient.CreateServiceAsync(request));
        }
예제 #31
0
 public void Use(LaunchType launchType = LaunchType.Default, DoneCancellationTokenSource cts = null) {
     RecentInfo = new RecentInfo(launchType);
     PrepareEvent(new ContentUsed(this, cts));
 }
예제 #32
0
 public RecentInfo(LaunchType launchType = LaunchType.Default) {
     LaunchType = launchType;
     CreatedAt = Tools.Generic.GetCurrentUtcDateTime;
     LastUsed = CreatedAt;
 }
예제 #33
0
파일: AD7Process.cs 프로젝트: Orvid/Cosmos
        internal AD7Process(NameValueCollection aDebugInfo, EngineCallback aCallback, AD7Engine aEngine, IDebugPort2 aPort)
        {
            mCallback = aCallback;
            mDebugInfo = aDebugInfo;

            mLaunch = (LaunchType)Enum.Parse(typeof(LaunchType), aDebugInfo[BuildPropertyNames.LaunchString]);

            if (mDebugDownPipe == null)
            {
                mDebugDownPipe = new Cosmos.Debug.Common.PipeClient(Pipes.DownName);

                mDebugUpPipe = new Cosmos.Debug.Common.PipeServer(Pipes.UpName);
                mDebugUpPipe.DataPacketReceived += mDebugUpPipe_DataPacketReceived;
                mDebugUpPipe.Start();
            }
            else
            {
                mDebugUpPipe.CleanHandlers();
                mDebugUpPipe.DataPacketReceived += mDebugUpPipe_DataPacketReceived;
            }

            // Must be after mDebugDownPipe is initialized
            OutputClear();
            OutputText("Debugger process initialized.");

            mISO = mDebugInfo["ISOFile"];
            OutputText("Using ISO file " + mISO + ".");
            mProjectFile = mDebugInfo["ProjectFile"];
            //
            bool xUseGDB = string.Equals(mDebugInfo[BuildPropertyNames.EnableGDBString], "true", StringComparison.InvariantCultureIgnoreCase);
            OutputText("GDB " + (xUseGDB ? "Enabled" : "Disabled") + ".");
            //
            var xGDBClient = false;
            Boolean.TryParse(mDebugInfo[BuildPropertyNames.StartCosmosGDBString], out xGDBClient);

            switch (mLaunch)
            {
                case LaunchType.VMware:
                    mHost = new Host.VMware(mDebugInfo, xUseGDB);
                    break;
                case LaunchType.Slave:
                    mHost = new Host.Slave(mDebugInfo, xUseGDB);
                    break;
                case LaunchType.Bochs:
                    // The project has been created on another machine or Bochs has been uninstalled since the project has
                    // been created.
                    if (!BochsSupport.BochsEnabled) { throw new Exception(ResourceStrings.BochsIsNotInstalled); }
                    string bochsConfigurationFileName = mDebugInfo[BuildProperties.BochsEmulatorConfigurationFileString];
                    if (string.IsNullOrEmpty(bochsConfigurationFileName))
                    {
                        bochsConfigurationFileName = BuildProperties.BochsDefaultConfigurationFileName;
                    }
                    if (!Path.IsPathRooted(bochsConfigurationFileName))
                    {
                        // Assume the configuration file name is relative to project output path.
                        bochsConfigurationFileName = Path.Combine(new FileInfo(mDebugInfo["ProjectFile"]).Directory.FullName,
                          mDebugInfo["OutputPath"], bochsConfigurationFileName);
                    }
                    FileInfo bochsConfigurationFile = new FileInfo(bochsConfigurationFileName);
                    // TODO : What if the configuration file doesn't exist ? This will throw a FileNotFoundException in
                    // the Bochs class constructor. Is this appropriate behavior ?
                    mHost = new Host.Bochs(mDebugInfo, xUseGDB, bochsConfigurationFile);

                    //((Host.Bochs)mHost).FixBochsConfiguration(new KeyValuePair<string, string>[] { new KeyValuePair<string, string>("IsoFileName", mISO) });
                    break;
                case LaunchType.IntelEdison:
                    mHost = new Host.IntelEdison(mDebugInfo, false);
                    break;
                default:
                    throw new Exception("Invalid Launch value: '" + mLaunch + "'.");
            }
            mHost.OnShutDown += HostShutdown;

            string xDbPath = Path.ChangeExtension(mISO, "cdb");
            if (!File.Exists(xDbPath))
            {
                throw new Exception("Debug data file " + xDbPath + " not found. Could be a omitted build process of Cosmos project so that not created.");
            }

            mDebugInfoDb = new DebugInfo(xDbPath);
            mDebugInfoDb.LoadLookups();

            CreateDebugConnector();
            aEngine.BPMgr.SetDebugConnector(mDbgConnector);

            mEngine = aEngine;
            mThread = new AD7Thread(aEngine, this);
            mCallback.OnThreadStart(mThread);
            mPort = aPort;

            if (xUseGDB && xGDBClient)
            {
                LaunchGdbClient();
            }
        }