public FinishPanel( IWizard wizard ) : base(wizard) { this.Size = new System.Drawing.Size ( 416, 315 ); this.Wizard.NextClick += new EventHandler ( Wizard_NextClick ); this.Controls.AddRange ( new Control[] { this.title, this.message, this.startDroidExplorer } ); }
public AuthorisationModel(IAuthorisationView authorisationView, IWizard wizard) { this.wizard = wizard; // register events and handlers this.authorisationView = authorisationView; //register new subscription event handler with event authorisationView.RegisterNewSubscription(NewSubscriptionHandler); //register new certificate handler with new event authorisationView.RegisterNewCertificate(NewCertificateHandler); //register new changed SID selection handler authorisationView.RegisterChangedSIDSelection(ChangedSIDSelectionHandler); //register for changes to selection of the certificates on the ui. authorisationView.RegisterChangedCertificateSelection(ChangedCertificateSelectionHandler); //register for create button click authorisationView.RegisterCreate(CreateButtonHandler); //register password changed handler authorisationView.RegisterCertificatePasswordChanged(CertficatePasswordChanged); ITabNavigation genericPanel = CastITabNavigation(authorisationView); genericPanel.RegisterNext(NextHandler,TabNumber); // set up display on the view if there are SID's to show if (wizard.GetSIDList() != null && wizard.GetCertList() != null) { authorisationView.DisplaySubsriptions(wizard.GetSIDList()); authorisationView.DisplayCertificates(wizard.GetCertList()); authorisationView.DisableCreate(); authorisationView.EnableNext(); } }
public void Process(IEnumerable<string> args, IWizard wizard) { var unknown = wizard.GetUnknown(); var pending = wizard.GetPendingRenames(); var conflicts = wizard.GetConflicts(); foreach (var file in pending) { var print = string.Format("{0,-35} - {1} {2}x{3:00} {4}", file.Path.TruncateBeginning(35), file.EpisodeMatches.MostProbable.Guess.Show.Name, file.EpisodeMatches.MostProbable.Guess.SeasonNumber, file.EpisodeMatches.MostProbable.Guess.EpisodeNumber, file.EpisodeMatches.MostProbable.Guess.Title); this.Log.WriteLine(print.TruncateEnd(79)); } this.Log.WriteLine(""); foreach (var file in unknown) { this.Log.WriteWarning(string.Format("{0,-35} - {1} matches", file.Path.TruncateBeginning(35), file.EpisodeMatches.Count)); } this.Log.WriteLine(""); foreach (var file in conflicts) { this.Log.WriteWarning(string.Format("{0,-35} - conflict", file.Path.TruncateBeginning(35))); } }
public void Configure(IWizard wizard) { wizard.NextLabel = "Start Over"; wizard.NextEnabled = true; _wizard = wizard; txtMessage.Text = _wizard.ImportProcessor.GetLog(); }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = _selectedRefs.Any(); _wizard.NextLabel = "&Export"; _wizard.Message = "Select the items you would like to include in the package."; _conn = _wizard.Connection; }
public Task<bool?> ShowWizardAsync(IWizard wizard) { Argument.IsNotNull(() => wizard); Log.Debug("Showing wizard '{0}'", wizard.GetType().GetSafeFullName()); return _uiVisualizerService.ShowDialogAsync<WizardViewModel>(wizard); }
public ConfigurationModel(IConfigurationView view, IWizard wizard) { this.view = view; ITabNavigation navView = castNavigationView(view); navView.RegisterNext(NextHandler,TabNumber); navView.RegisterPrevious(PreviousHandler,TabNumber); this.wizard = wizard; }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = true; _wizard.Message = "Please review the install script and modify as necessary"; _items = new BindingList<ImportStepResolve>(_wizard.InstallScript.Lines.Select(i => new ImportStepResolve() { Item = i }).ToList()); resolveGrid.DataSource = _items; }
public void Configure(IWizard wizard) { _wizard = wizard; wizard.NextEnabled = false; var diffs = new FullBindingList<InstallItemDiff>(); diffs.AddRange(InstallItemDiff.GetDiffs(BaseInstall, _wizard.InstallScript)); gridDiffs.DataSource = diffs; gridDiffs.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells); }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = true; _wizard.NextLabel = "Import"; _wizard.Message = "Configure how the data should be imported."; _cache = new Cache(new Connection(_wizard.Connection)); ConfigureUi((int)nudBatchSize.Value); }
public void Configure(IWizard wizard) { _wizard = wizard; wizard.NextLabel = "Start Over"; wizard.NextEnabled = true; var diffs = new FullBindingList<InstallItemDiff>(); diffs.AddRange(InstallItemDiff.GetDiffs(BaseInstall, _wizard.InstallScript)); gridDiffs.DataSource = diffs; }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = true; _wizard.Message = "Please review the install script and modify as necessary"; _items = new FullBindingList<ImportStepResolve>( _wizard.InstallScript.Lines.Select(i => new ImportStepResolve() { Item = i })); resolveGrid.DataSource = _items; resolveGrid.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells); }
public void Process(IEnumerable<string> args, IWizard wizard) { var unknown = wizard.GetUnknown(); var pending = wizard.GetPendingRenames(); var conflicts = wizard.GetConflicts(); this.Log.WriteLine(string.Format("{0} identified episodes", pending.Count())); this.Log.WriteWarning(string.Format("{0} unknown episodes", unknown.Count())); this.Log.WriteWarning(string.Format("{0} conflicting episodes", conflicts.Count())); }
public void Process(IEnumerable<string> args, IWizard wizard) { this.Log.Write("Available commands: "); var assembly = System.Reflection.Assembly.GetExecutingAssembly(); var commandTypes = assembly.GetTypes().Where(t => t.Namespace == typeof(ICommand).Namespace && t.Name != typeof(ICommand).Name); var list = commandTypes.Aggregate(string.Empty, (str, type) => str + type.Name.ToLower() + " "); this.Log.WriteLine(list); }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = false; _wizard.InstallProcessor.ActionComplete += InstallProcessor_ActionComplete; _wizard.InstallProcessor.ErrorRaised += InstallProcessor_ErrorRaised; _wizard.InstallProcessor.ProgressChanged += InstallProcessor_ProgressChanged; _connections = _wizard.ConnectionInfo.ToList(); StartInstall(true); }
public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { var provider = WizardHelpers.GetProvider(automationObject); try { if (AreToolsInstalled(provider)) { // If we fail to find the wizard, we will redirect the user to // install the required packages. var asm = Assembly.Load("Microsoft.VisualStudio.CloudService.Wizard,Version=1.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"); var type = asm.GetType("Microsoft.VisualStudio.CloudService.Wizard.CloudServiceWizard"); _wizard = type.InvokeMember(null, BindingFlags.CreateInstance, null, null, new object[0], CultureInfo.CurrentCulture) as IWizard; } } catch (ArgumentException) { } catch (BadImageFormatException) { } catch (IOException) { } catch (MemberAccessException) { } if (_wizard == null) { try { Directory.Delete(replacementsDictionary["$destinationdirectory$"]); Directory.Delete(replacementsDictionary["$solutiondirectory$"]); } catch { // If it fails (doesn't exist/contains files/read-only), let the directory stay. } var dlg = new TaskDialog(provider) { Title = Strings.ProductTitle, MainInstruction = Strings.AzureToolsRequired, Content = Strings.AzureToolsInstallInstructions, AllowCancellation = true }; dlg.Buttons.Add(TaskDialogButton.Cancel); var download = new TaskDialogButton(Strings.DownloadAndInstall); dlg.Buttons.Insert(0, download); if (dlg.ShowModal() == download) { InstallTools(provider); throw new WizardCancelledException(); } // User cancelled, so go back to the New Project dialog throw new WizardBackoutException(); } // Run the original wizard to get the right replacements _wizard.RunStarted(automationObject, replacementsDictionary, runKind, customParams); }
private int ForeachTree(int index, Stack <IWizard> wizardToCheck) { while (this.wizards.ContainsKey(index)) { IWizard wizardLeft = this.wizards[index][0]; IWizard wizardRight = this.wizards[index][1]; wizardToCheck.Push(wizardRight); Console.WriteLine($"{wizardLeft.Name} {wizardLeft.Id} casts Reflection"); index = wizardLeft.Id; } return(index); }
private int ForeachTreeFireball(int index, Stack <IWizard> wizardToCheck) { while (this.wizards.ContainsKey(index)) { IWizard wizardLeft = this.wizards[index][0]; IWizard wizardRight = this.wizards[index][1]; wizardToCheck.Push(wizardRight); Console.WriteLine($"{wizardLeft.Name} {wizardLeft.Id} casts Fireball for {wizardLeft.MagicPower} damage"); index = wizardLeft.Id; } return(index); }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = true; _wizard.Message = "Please review the install script and modify as necessary"; _items = new FullBindingList <ImportStepResolve>( _wizard.InstallScript.Lines.Select(i => new ImportStepResolve() { Item = i })); resolveGrid.DataSource = _items; resolveGrid.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells); }
public void Process(IEnumerable<string> args, IWizard wizard) { var pattern = args.SingleOrDefault(); if (pattern != null) { int count = wizard.Remove(pattern); this.Log.WriteLine(string.Format("{0} files removed", count)); } else { this.Log.WriteError("Pattern is 'remove pattern'"); } }
public void Process(IEnumerable<string> args, IWizard wizard) { var files = args.SingleOrDefault(); if (files != null) { int count = wizard.Add(files); this.Log.WriteLine(string.Format("{0} files added", count)); } else { this.Log.WriteError("Syntax is 'Add pattern'"); } }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.Message = "Specify package metadata (optional) and select and export type."; _wizard.NextEnabled = false; txtName.Text = _wizard.InstallScript.Title; txtAuthor.Text = _wizard.InstallScript.Creator ?? _wizard.ConnectionInfo.First().UserName; txtWebsite.Text = (_wizard.InstallScript.Website == null ? "" : _wizard.InstallScript.Website.ToString()); txtDescription.Text = _wizard.InstallScript.Description; txtName.Focus(); }
public InstallStartPanel( IWizard wizard ) : base(wizard) { // if sdk only, but not installed, switch to install mode if ( Program.Mode == InstallMode.SdkOnly ) { string sdkPath = Wizard.GetSdkPath ( ); if ( string.IsNullOrEmpty ( sdkPath ) ) { this.LogWarning ( "Cannot install SDK only, Droid Explorer is not currently installed." ); this.LogInfo ( "Switching mode to Install" ); Program.Mode = InstallMode.Install; } } }
public void Process(IEnumerable<string> args, IWizard wizard) { var unknown = wizard.GetUnknown(); var pending = wizard.GetPendingRenames(); var conflicts = wizard.GetConflicts(); var tempFile = Path.GetTempFileName(); using (var writer = new StreamWriter(tempFile)) { writer.WriteLine(); writer.WriteLine("------- Successfully identified -------"); writer.WriteLine(); foreach (var file in pending) { var print = string.Format("{0,-80} - {1} {2}x{3:00} {4}", file.Path.TruncateBeginning(80), file.EpisodeMatches.MostProbable.Guess.Show.Name, file.EpisodeMatches.MostProbable.Guess.SeasonNumber, file.EpisodeMatches.MostProbable.Guess.EpisodeNumber, file.EpisodeMatches.MostProbable.Guess.Title); writer.WriteLine(print); } writer.WriteLine(); writer.WriteLine("------- Could not be identified -------"); writer.WriteLine(); foreach (var file in unknown) { writer.WriteLine(string.Format("{0,-80} - {1} matches", file.Path.TruncateBeginning(80), file.EpisodeMatches.Count)); } writer.WriteLine(); writer.WriteLine("------- Conflicting renames -------"); writer.WriteLine(); foreach (var file in conflicts) { writer.WriteLine(string.Format("{0,-80} - conflict", file.Path.TruncateBeginning(80))); } } this.Log.WriteLine("Current fileset dumped to "); this.Log.WriteLine(tempFile); }
public void RegisterNotificationDispatcherTimer_Wizard(IPlayer player, IWizard wizard, NotificationTimerEnum notificationTimer) { Image wizardImage = wizard.EnemyImage; if (wizardImage != null) { if (notificationTimer == NotificationTimerEnum.TimerON) { wizard.Move(wizard.MovementDirection); EnemyStrikeHero(wizard, player); SetWeaponNextStrike(wizard); } } }
public static IWizardPage FindPage(this IWizard wizard, Func <IWizardPage, bool> predicate) { Argument.IsNotNull(() => wizard); Argument.IsNotNull(() => predicate); var allPages = wizard.Pages.ToList(); if (allPages.Count == 0) { return(null); } return(allPages.FirstOrDefault(predicate)); }
public InstallStartPanel(IWizard wizard) : base(wizard) { // if sdk only, but not installed, switch to install mode if (Program.Mode == InstallMode.SdkOnly) { string sdkPath = Wizard.GetSdkPath( ); if (string.IsNullOrEmpty(sdkPath)) { this.LogWarning("Cannot install SDK only, Droid Explorer is not currently installed."); this.LogInfo("Switching mode to Install"); Program.Mode = InstallMode.Install; } } }
public void RunStarted(object automationObject, Dictionary <string, string> props, WizardRunKind runKind, object[] customParams) { this.dte = automationObject as EnvDTE._DTE; props.Add("$safeclassname$", props["$safeprojectname$"].Replace(".", string.Empty)); props["$currentVsCulture$"] = System.Threading.Thread.CurrentThread.CurrentUICulture.Name; //Call win form created in the project to accept user input wizardForm = new WizardForm(props); var result = wizardForm.ShowDialog(); if (result == DialogResult.Cancel) { throw new WizardCancelledException(); } // Hack on WinRT / WinRT XAML to run the certificate wizards as well as our own wizard if (GetKey(props, "$sharpdx_platform_winrt$") || GetKey(props, "$sharpdx_platform_winrt_xaml$")) { try { var assembly = Assembly.Load("Microsoft.VisualStudio.WinRT.TemplateWizards, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); var type = assembly.GetType("Microsoft.VisualStudio.WinRT.TemplateWizards.CreateProjectCertificate.Wizard"); winRTCertificateWizard = (IWizard)Activator.CreateInstance(type); } catch (Exception ex) { } } if (winRTCertificateWizard != null) { winRTCertificateWizard.RunStarted(automationObject, props, runKind, customParams); } // Set spritebatch feature if spritetexture or spritefont is true if (GetKey(props, "$sharpdx_feature_spritetexture$") || GetKey(props, "$sharpdx_feature_spritefont$")) { props["$sharpdx_feature_spritebatch$"] = "true"; } if (GetKey(props, "$sharpdx_feature_model3d$") || GetKey(props, "$sharpdx_feature_primitive3d$")) { props["$sharpdx_feature_3d$"] = "true"; } if (GetKey(props, "$sharpdx_platform_winrt_xaml$")) { props["$sharpdx_platform_winrt$"] = "true"; } }
public ProductionModel(IProductionView view, IWizard wizard) { this.view = view; // This reads the folder with VMSizes in, formatting the names into a list // and delivering the to the UI to be drawn in the combo box FileEnumerator FileEnum = makeFileEnumerator(); view.SetVmSizes(FileEnum.Enumerate(ConfigurationManager.AppSettings["VMSizesFolder"])); ITabNavigation navView = castNavigationView(view); navView.RegisterNext(NextHandler, TabNumber); navView.RegisterPrevious(PreviousHandler, TabNumber); this.wizard = wizard; }
/// <summary> /// Shows the ext. /// </summary> /// <param name="wizard">The wizard.</param> public static void ShowExt(this IWizard wizard) { try { if (wizard.InvokeRequired) { wizard.Invoke(new GenericDelegate(wizard.Show)); } else { wizard.Show( ); } } catch (ThreadAbortException) { } }
public static WizardDefinition CreateWizardDefinition(string registeredWizardName, WizardStatus wizardStatus) { WizardElement registeredWizard = ConfigurationManager.Wizards[registeredWizardName]; IWizard wizardInstance = (IWizard)registeredWizard.CreateInstance(); WizardDefinition wizardDefinition = wizardInstance.Definition; wizardDefinition.Status = wizardStatus; if (wizardInstance is IDisposable) { (wizardInstance as IDisposable).Dispose(); } return(wizardDefinition); }
/// <summary> /// Initializes a new instance of the <see cref="WizardCallback"/> class. /// </summary> /// <param name="context">The command context.</param> /// <param name="wizard">The associated wizard.</param> /// <param name="timeout">The callback timeout length.</param> /// <param name="runMode">The mode with which to run the callback.</param> /// <param name="criterion">The reaction criteria.</param> public WizardCallback ( SocketCommandContext context, IWizard wizard, [CanBeNull] ICriterion <SocketReaction> criterion = null, TimeSpan?timeout = null, RunMode runMode = RunMode.Async) { this.Context = context; this.Wizard = wizard; this.Criterion = criterion ?? new EmptyCriterion <SocketReaction>(); this.Timeout = timeout; this.RunMode = runMode; }
public WizardViewModel(IWizard wizard, IMessageService messageService, ILanguageService languageService) { Argument.IsNotNull(() => wizard); Argument.IsNotNull(() => messageService); Argument.IsNotNull(() => languageService); DeferValidationUntilFirstSaveCall = true; Wizard = wizard; WizardPages = new List <IWizardPage>(wizard.Pages); _messageService = messageService; _languageService = languageService; ShowHelp = new TaskCommand(OnShowHelpExecuteAsync, OnShowHelpCanExecute); }
/// <summary> Is invoked when a selection has been made. </summary> /// <param name="sender">Event sender</param> /// <param name="selectionEventArgs">Event arguments</param> private void OnSelectionChanged(object sender, SelectionEventArgs selectionEventArgs) { WizardContribution wizardContribution = selectionEventArgs.Selection as WizardContribution; bool canLeave = wizardContribution != null; CanLeave = canLeave; SelectedWizard = null; if (wizardContribution == null) { return; } SelectedWizard = wizardContribution.Wizard; }
public CloudServiceWizard() { try { // If we fail to find the wizard, we will redirect the user to // the WebPI download. var asm = Assembly.Load("Microsoft.VisualStudio.CloudService.Wizard,Version=1.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"); _recommendUpgrade = ShouldRecommendUpgrade(asm); var type = asm.GetType("Microsoft.VisualStudio.CloudService.Wizard.CloudServiceWizard"); _wizard = type.InvokeMember(null, BindingFlags.CreateInstance, null, null, new object[0]) as IWizard; } catch (ArgumentException) { } catch (BadImageFormatException) { } catch (IOException) { } catch (MemberAccessException) { } }
protected override void OnAssociatedObjectUnloaded() { base.OnAssociatedObjectUnloaded(); var wizard = Wizard; if (wizard == null) { return; } wizard.MovedBack -= OnMovedBack; wizard.MovedForward -= OnMovedForward; Wizard = null; }
private IWizard MakeWizardWithID(WizardNode rootNode) { IWizard wizard = new BasicWizard(); Type wizardType = typeof(Wizard); FieldInfo idField = wizardType.GetField("id", BindingFlags.NonPublic | BindingFlags.Instance); idField.SetValue(wizard, ++count); Type wizardNodeType = typeof(WizardNode); IWizard rootWizard = (IWizard)wizardNodeType.GetField("mainWizard", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(rootNode); FieldInfo magicPowerField = wizardType.GetField("magicPower", BindingFlags.NonPublic | BindingFlags.Instance); magicPowerField.SetValue(wizard, (int)magicPowerField.GetValue(rootWizard) / 2); return(wizard); }
/// <summary> /// Creates an instance of the descriptor's Type, saves a reference to the instance, and reads the Wizard Pages metadata (Not for external use) /// </summary> /// <param name="wizardPageHost">The Wizard that is hosting the page</param> /// <returns></returns> internal static void Create(IWizard wizard, WizardPageDescriptor descriptor) { // find the default constructor ConstructorInfo ci = descriptor.Type.GetConstructor(Type.EmptyTypes); // create an instance of the type object instance = ci.Invoke(null); // cast to a wizard page for ease of usage IWizardPage wizardPage = (IWizardPage)instance; // set the wizard that will be owning the wizard page wizardPage.Wizard = wizard; // set the instance created on the descriptor so that it may be referenced later descriptor.SetInstance(wizardPage); }
public WizardViewModel(IWizard wizard, IMessageService messageService, ILanguageService languageService) { Argument.IsNotNull(() => wizard); Argument.IsNotNull(() => messageService); Argument.IsNotNull(() => languageService); DeferValidationUntilFirstSaveCall = true; Wizard = wizard; _messageService = messageService; _languageService = languageService; Finish = new TaskCommand(OnFinishExecuteAsync, OnFinishCanExecute); Cancel = new TaskCommand(OnCancelExecuteAsync, OnCancelCanExecuteAsync); GoToNext = new TaskCommand(OnGoToNextExecuteAsync, OnGoToNextCanExecute); GoToPrevious = new TaskCommand(OnGoToPreviousExecuteAsync, OnGoToPreviousCanExecute); }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.NextEnabled = false; _import = _wizard.ImportProcessor; _import.ActionComplete += _progress_ActionComplete; _import.ProgressChanged += _progress_ProgressChanged; btnCancel.Visible = _import is ICancelableProgressReporter; btnCancel.Enabled = true; btnCancel.Text = "Cancel"; var thread = new Thread(o => this.MethodInvoke(_import)); _startTime = DateTime.Now; thread.Start(); _clock.Enabled = true; countWorker.RunWorkerAsync(); }
public Task <bool?> ShowWizardAsync(IWizard wizard) { Argument.IsNotNull(() => wizard); Log.Debug("Showing wizard '{0}'", wizard.GetType().GetSafeFullName(false)); if (wizard is SideNavigationWizardBase) { return(_uiVisualizerService.ShowDialogAsync <SideNavigationWizardViewModel>(wizard)); } if (wizard is FullScreenWizardBase) { return(_uiVisualizerService.ShowDialogAsync <FullScreenWizardViewModel>(wizard)); } return(_uiVisualizerService.ShowDialogAsync <WizardViewModel>(wizard)); }
public void RegisterEnemies() { _bat = (IBat)_allEnemiesFactory.CreateEnemy(EnemyNameEnum.Bat); _bat.EnemyImage = BatEnemyImage; _bat.ShooterImage = BatEnemyImage; _wizard = (IWizard)_allEnemiesFactory.CreateEnemy(EnemyNameEnum.Wizard); _wizard.EnemyImage = WizardEnemyImage; _wizard.ShooterImage = WizardEnemyImage; _wizard.Target = _player; _wizard.Target.TargetImage = _player.ShooterImage; _wizard.AllFireballLeftShootingImages = AllFireballLeftImages; _wizard.AllFireballRightShootingImages = AllFireballRightImages; AllEnemies = new List <IEnemy> { _bat, _wizard }; }
public void FirebollAction(int wizardID) { Type wizardNodeType = typeof(WizardNode); FieldInfo mainNodeField = wizardNodeType.GetField("mainWizard", BindingFlags.NonPublic | BindingFlags.Instance); Type wizardType = typeof(Wizard); FieldInfo magicPowerWizardField = wizardType.GetField("magicPower", BindingFlags.NonPublic | BindingFlags.Instance); foreach (var nodeID in this) { if (nodeID >= wizardID) { IWizard mainWizard = (IWizard)mainNodeField.GetValue(this.nodeList[nodeID]); int magicPower = (int)magicPowerWizardField.GetValue(mainWizard); Console.WriteLine($"Oz {nodeID} casts Fireball for {magicPower} damage"); } } }
/// <summary> /// Initialize this with the information in the IWizard /// </summary> /// <param name="wizard">IWizard</param> private void Initialize(IWizard wizard) { Wizard = wizard; if (Wizard.WizardScreens == null) { throw new ArgumentNullException(nameof(wizard.WizardScreens)); } // Make sure the view is created via the dispatcher Application.Current.Dispatcher.Invoke(() => { WizardScreensView = CollectionViewSource.GetDefaultView(wizard.WizardScreens); WizardScreensView.Filter = o => { IWizardScreen wizardScreen = o as IWizardScreen; return(wizardScreen?.IsVisible == true); }; }); }
protected virtual WizardNavigationButton CreateFinishButton(IWizard wizard) { var button = new WizardNavigationButton { Content = _languageService.GetString("Wizard_Finish"), IsVisibleEvaluator = () => wizard.IsLastPage(), StyleEvaluator = (x) => { var styleName = wizard.IsLastPage() ? "WizardNavigationPrimaryButtonStyle" : "WizardNavigationButtonStyle"; var application = System.Windows.Application.Current; return(application?.TryFindResource(styleName) as Style); }, Command = new TaskCommand(async() => { await wizard.ResumeAsync(); }, () => { if (!wizard.HandleNavigationStates) { return(true); } if (!Wizard.CanResume) { return(false); } // Don't validate var validationSummary = wizard.GetValidationContextForCurrentPage(false); if (!validationSummary.HasErrors) { return(true); } return(false); }) }; return(button); }
public IEnemy CreateEnemy(EnemyNameEnum enemyName) { switch (enemyName) { case EnemyNameEnum.Bat: _bat = (_bat == null) ? DependencyInjection.ContainerConfig.GetInstance <IBat>() : _bat; return(_bat); case EnemyNameEnum.Ghost: //To be Created return(null); case EnemyNameEnum.Goul: //To be Created return(null); case EnemyNameEnum.Wizard: _wizard = (_wizard == null) ? DependencyInjection.ContainerConfig.GetInstance <IWizard>() : _wizard; return(_wizard); } return(null); }
private void prodMatrix_Closed(object sender, EventArgs e) { if (((Form)sender).DialogResult == DialogResult.OK) { MatrixDetail prodMatrix = sender as MatrixDetail; if (prodMatrix != null) { this.ResultList = prodMatrix.ResultList; if (this.Parent.Parent.Parent != null) { IWizard wizard = this.Parent.Parent.Parent as IWizard; if (wizard != null) { wizard.AddItemByList(this.ResultList); } } } } }
public void Process(IEnumerable<string> args, IWizard wizard) { var newPattern = args.SingleOrDefault(); if (newPattern != null) { wizard.SetPattern(new Core.Pattern(newPattern)); } else { var existingPattern = wizard.GetPattern(); this.Log.WriteLine(string.Format("The current pattern is: {0}", existingPattern)); } var example = wizard.GetPendingRenames().FirstOrDefault(); if (example != null) { var name = wizard.GetPattern().GetName(example.EpisodeMatches.MostProbable.Guess); this.Log.WriteLine(string.Format("Ex: {0}", name)); } }
private static bool IsPage(this IWizard wizard, IWizardPage wizardPage, Func <List <IWizardPage>, IWizardPage> selector) { Argument.IsNotNull(() => wizard); if (wizardPage is null) { wizardPage = wizard.CurrentPage; } var allPages = wizard.Pages.ToList(); if (allPages.Count == 0) { return(false); } var isLastPage = ReferenceEquals(selector(allPages), wizardPage); return(isLastPage); }
public static IWarrior FromXml(this IWarbandRoster warbandRoster, XmlWarrior xmlWarrior) { IWarrior warrior = warbandRoster.WarBand.GetWarrior(xmlWarrior.TypeOfWarrior); warrior = warbandRoster.AddWarrior(warrior); foreach (string item in xmlWarrior.EquipmentList) { warrior.AddEquipment(item); } if (warrior is IHenchMen) { IHenchMen henchMan = warrior as IHenchMen; for (int i = 1; i < xmlWarrior.AmountInGroup; i++) { henchMan.IncreaseGroupByOne(); } } else if (warrior is IHero) { IHero hero = warrior as IHero; foreach (string skill in xmlWarrior.SkillList) { hero.AddSkill(skill); } } if (warrior is IWizard) { IWizard wizard = warrior as IWizard; foreach (string item in xmlWarrior.SpellList) { wizard.AddSpell(item); } } return(warrior); }
protected virtual WizardNavigationButton CreateBackButton(IWizard wizard) { var button = new WizardNavigationButton { Content = _languageService.GetString("Wizard_Back"), IsVisibleEvaluator = () => !wizard.IsFirstPage(), Command = new TaskCommand(async() => { await wizard.MoveBackAsync(); }, () => { if (!wizard.HandleNavigationStates) { return(true); } return(wizard.CanMoveBack); }) }; return(button); }
/// <summary> /// Initializes a new instance of the <see cref="DownloadPanel"/> class. /// </summary> /// <param name="wizard">The wizard.</param> public DownloadPanel( IWizard wizard ) : base(wizard) { this.Controls.AddRange ( new Control[] { this.label1, this.downloadProgress, this.downloadStatus, this.overallStatus, this.overallProgress } ); Wizard.CancelRequest += new EventHandler ( wizard_CancelRequest ); this.LogDebug ( "Initializing Download Panel" ); installPath = Wizard.GetInstallPath ( ); this.LogDebug ( "Install path: {0}", installPath ); SdkPath = Wizard.GetSdkPath ( ); this.LogDebug ( "SDK Path: {0}", SdkPath ); CredentialsDialog = new CredentialsDialog ( ); var proxy = HttpWebRequest.GetSystemWebProxy(); var bypassed = proxy.IsBypassed(new Uri("http://google.com")); if ( !bypassed ) { var phost = proxy.GetProxy ( new Uri ( "http://google.com" ) ); this.LogDebug ( "Setting proxy info based on internet explorer" ); CredentialsDialog.ForceUI = true; CredentialsDialog.Caption = "Proxy Authentication"; CredentialsDialog.TargetName = phost.Host; } }
public void Configure(IWizard wizard) { _wizard = wizard; _wizard.Message = "Configure installation"; _wizard.NextEnabled = true; }
public void Configure(IWizard wizard) { wizard.NextEnabled = true; wizard.NextLabel = "Process Remaining"; _wizard = wizard; }
/// <summary> /// Initialize the Wizard by setting the default parameters. /// </summary> /// <param name="wizard">The Wizard control to be initialized.</param> private void InitializeWizard(Control wizard) { if (wizard == null) { this.Controls.RemoveAt(this.Controls.Count -1); panelDefault.Visible = true; this.wizard = null; this.Text = "Create Theme"; buttonBack.Top = panelDefault.Bottom + 8; buttonNext.Top = panelDefault.Bottom + 8; buttonCancel.Top = panelDefault.Bottom + 8; } else { this.Controls.Add(wizard); wizard.Visible = true; wizard.Location = new System.Drawing.Point(3, 4); wizard.TabIndex = 0; buttonBack.Top = wizard.Bottom + 8; buttonNext.Top = wizard.Bottom + 8; buttonCancel.Top = wizard.Bottom + 8; this.wizard = (IWizard)wizard; ((IPropertyEditor)wizard).Target = target; this.Text = "Create Theme: Step " + pageIndex + " of " + Convert.ToString(this.wizard.GetPageCount() + 1); panelDefault.Visible = false; } this.Refresh(); }