Zetbox.Client.Launcher.Show C# (CSharp) Method

Show() public method

public Show ( string args ) : void
args string
return void
        public void Show(string[] args)
        {
            if (args == null) { throw new ArgumentNullException("args"); }

            if (args.Contains("-installperfcounter"))
            {
                if (perfCounter != null) perfCounter.Install();
                // install and exit
            }
            else if (args.Contains("-uninstallperfcounter"))
            {
                if (perfCounter != null) perfCounter.Install();
                // uninstall and exit
            }
            else
            {
                // Extract app guid
                Guid appGuid = Guid.Empty;
                foreach (var g in args)
                {
                    if (Guid.TryParse(g, out appGuid))
                        break;
                }

                if (appGuid != Guid.Empty)
                {
                    LaunchApplication(appGuid);
                }
                else if (cfg.Client.Application != null && cfg.Client.Application != Guid.Empty)
                {
                    LaunchApplication(cfg.Client.Application.Value);
                }
                else
                {
                    var ws = mdlFactory.CreateViewModel<WorkspaceViewModel.Factory>().Invoke(ctxFactory(ContextIsolationLevel.MergeQueryData), null);
                    ControlKind launcher = Zetbox.NamedObjects.Gui.ControlKinds.Zetbox_App_GUI_LauncherKind.Find(frozenCtx);
                    mdlFactory.ShowModel(ws, launcher, true);
                }

                // other arguments
                if (args.Contains("-showdebugger"))
                {
                    var ctx = ctxFactory(ContextIsolationLevel.PreferContextCache);

                    var debugger = mdlFactory.CreateViewModel<Zetbox.Client.Presentables.Debugger.DebuggerWindowViewModel.Factory>().Invoke(ctx, null);
                    mdlFactory.ShowModel(debugger, true);
                }
            }
        }