public InstallStepsEditorVM(XmlScript p_xscScript) { Script = p_xscScript; SortOrders = Enum.GetValues(typeof(SortOrder)); Errors = new ErrorContainer(); }
/// <summary> /// A simple constructor that initializes the object with the given values. /// </summary> /// <param name="p_vmlScriptEditorVM">The <see cref="InstallScriptEditorVM"/> that encapsulates the data /// and operations for diaplying the <see cref="IScript"/> editor.</param> /// <param name="p_vmlInfoEditorVM">The <see cref="ModInfoEditorVM"/> that encapsulates the data /// and operations for diaplying the <see cref="IModInfo"/> editor.</param> /// <param name="p_prjModProject">The <see cref="Project"/> to edit.</param> /// <param name="p_srgScriptTypeRegistry">The <see cref="IScriptTypeRegistry"/> of available <see cref="IScriptType"/>s.</param> /// <param name="p_mpkModBuilder">he <see cref="ModPackager"/> to use to build mod files /// from <see cref="Project"/>s.</param> public ModPackagingFormVM(InstallScriptEditorVM p_vmlScriptEditorVM, ModInfoEditorVM p_vmlInfoEditorVM, Project p_prjModProject, IScriptTypeRegistry p_srgScriptTypeRegistry, ModPackager p_mpkModBuilder) { Errors = new ErrorContainer(); Warnings = new ErrorContainer(); ScriptEditorVM = p_vmlScriptEditorVM; InfoEditorVM = p_vmlInfoEditorVM; IScriptTypeRegistry = p_srgScriptTypeRegistry; ModBuilder = p_mpkModBuilder; ModProject = p_prjModProject ?? new Project(p_srgScriptTypeRegistry); SaveCommand = new Command<string>("Save Project", "Save the project.", SaveProject, ModProject.IsDirty); OpenCommand = new Command("Open Project", "Open a project.", OpenProject); NewCommand = new Command("New Project", "Create a new project.", NewProject); BuildCommand = new Command<string>("Build Mod", "Builds the mod file.", BuildMod); }
public HeaderEditorVM(HeaderInfo p_hdrHeader, IList<VirtualFileSystemItem> p_lstModFiles, HeaderProperties p_hrpEditableProperties) { HeaderInfo = p_hdrHeader; ModFiles = p_lstModFiles; TitleVisible = (p_hrpEditableProperties & HeaderProperties.Title) > 0; TextColourVisible = (p_hrpEditableProperties & HeaderProperties.TextColour) > 0; TextPositionVisible = (p_hrpEditableProperties & HeaderProperties.TextPosition) > 0; ImageVisible = (p_hrpEditableProperties & HeaderProperties.Image) > 0; HeightVisible = (p_hrpEditableProperties & HeaderProperties.Height) > 0; TextPositions = Enum.GetValues(typeof(TextPosition)); Errors = new ErrorContainer(); }
public InstallStepEditorVM(ConditionEditorVM p_vmlConditionEditor, InstallStep p_stpStep, InstallStepProperties p_ispEditableProperties) { NameVisible = (p_ispEditableProperties & InstallStepProperties.Name) > 0; GroupSortOrderVisible = (p_ispEditableProperties & InstallStepProperties.GroupSortOrder) > 0; VisibilityVisible = (p_ispEditableProperties & InstallStepProperties.Visibility) > 0; ConditionEditorVM = p_vmlConditionEditor; InstallStep = p_stpStep; SortOrders = Enum.GetValues(typeof(SortOrder)); Errors = new ErrorContainer(); ConditionEditorVM.ConditionSaved += new EventHandler(ConditionSaved); }
public void ErrorContainerInitialize(ErrorContainer errorContainer) { throw new System.NotImplementedException(); }
public ComponentDefinitionTransform(ErrorContainer errors, TemplateStore templateStore, ComponentInstanceTransform componentInstanceTransform) { _templateStore = templateStore; _componentInstanceTransform = componentInstanceTransform; _errors = errors; }
public static ModelStateDictionary Merge(this ModelStateDictionary modelState, ErrorContainer container) { foreach (var group in container.Errors) { foreach (var error in group) { modelState.AddModelError(group.Key, error.Message); } } return(modelState); }
public OptionGroupEditorVM(OptionGroup p_opgGroup, OptionGroupProperties p_ogpEditableProperties) { OptionGroup = p_opgGroup; NameVisible = (p_ogpEditableProperties & OptionGroupProperties.Name) > 0; TypeVisible = (p_ogpEditableProperties & OptionGroupProperties.Type) > 0; OptionSortOrderVisible = (p_ogpEditableProperties & OptionGroupProperties.OptionSortOrder) > 0; OptionGroupTypes = Enum.GetValues(typeof(OptionGroupType)); SortOrders = Enum.GetValues(typeof(SortOrder)); Errors = new ErrorContainer(); }
public ComponentInstanceTransform(ErrorContainer errors) { _errors = errors; }
/// <summary> /// A simple constructor that initializes the object with the given dependencies. /// </summary> /// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param> public SupportedToolsSettingsGroup(IEnvironmentInfo p_eifEnvironmentInfo, IGameMode p_gmGameMode) : base(p_eifEnvironmentInfo) { GameModeDescriptor = p_gmGameMode; Errors = new ErrorContainer(); }
public CurrencyLayerResponse(ErrorContainer error, bool isSuccessful, Dictionary <string, decimal> quotes) { Error = error; IsSuccessful = isSuccessful; Quotes = quotes; }
private void LoadDataSet_Click(object sender, EventArgs e) { this.openDataSetFile.Filter = "data|*.data|dat|*.dat"; if (Program.tmpConfigFile != null) { openDataSetFile.ShowDialog(); string path = openDataSetFile.FileName; string fileName = openDataSetFile.SafeFileName; if (ErrorContainer.no2(path) == true) { return; } if (ErrorContainer.no1(fileName) == true) { return; } Program.unDataSet = new UnnormalizedDataSet(path, Program.tmpConfigFile); if (Program.unDataSet.dataList.Count == 0) { MessageBox.Show("Sprawdź poprawność pliku konfiguracyjnego", "Błąd n05"); this.DeletedRowText.Text = Program.unDataSet.unvalidLines.ToString(); this.DeletedRowText.BackColor = Color.Red; this.StatusBox1.Text = "Status: Błąd pliku Config"; this.StatusBox1.BackColor = Color.Red; return; } this.DataSetShowBox.DataSource = Program.unDataSet.unnormalizedDataSetView(); this.StatusBox2.Text = "Status: Ok"; this.StatusBox2.BackColor = Color.Green; this.DeletedRowText.Text = Program.unDataSet.unvalidLines.ToString(); this.DeletedRowText.BackColor = Color.Red; this.LoadDataSet.Enabled = false; this.LoadConfigFile.Enabled = false; this.StartNormalize.Enabled = true; this.DeflatuNormalizeRange.Enabled = true; } else { DialogResult dialogResult = MessageBox.Show("Czy chcesz utworzyć plik automatycznie ?", "Brak pliku konfiguracyjnego", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { openDataSetFile.ShowDialog(); string path = openDataSetFile.FileName; string fileName = openDataSetFile.SafeFileName; string textContainer; if (ErrorContainer.no2(path) == true) { return; } Program.tmpConfigFile = AnalizeDataSet.generateConfigFIle(path, fileName); string[] tmpCharRows = new string[Program.tmpConfigFile.liczbaKolumn]; textContainer = JsonConvert.SerializeObject(Program.tmpConfigFile, Formatting.Indented); Program.unDataSet = new UnnormalizedDataSet(path, Program.tmpConfigFile); this.DataSetShowBox.DataSource = Program.unDataSet.unnormalizedDataSetView(); this.ConfigShowBox.Text = textContainer; for (int i = 0; i < Program.tmpConfigFile.liczbaKolumn; i++) { tmpCharRows[i] = "Kolumna " + i.ToString(); this.RowsToNormalizeBox.Items.Add(tmpCharRows[i]); if (Program.tmpConfigFile.kolumnyDoNormalizacji[i] == true) { this.RowsToNormalizeBox.SetItemCheckState(i, CheckState.Checked); } } this.StatusBox2.Text = "Status: Ok"; this.StatusBox2.BackColor = Color.Green; this.StatusBox1.Text = "Status: Automatyczny"; this.StatusBox1.BackColor = Color.Yellow; this.DeletedRowText.Text = Program.unDataSet.unvalidLines.ToString(); this.DeletedRowText.BackColor = Color.Red; this.LoadDataSet.Enabled = false; this.LoadConfigFile.Enabled = false; this.StartNormalize.Enabled = true; this.DeflatuNormalizeRange.Enabled = true; this.ButtonChangeConfig.Enabled = true; this.RowsToNormalizeBox.Visible = true; this.LabelRowsToNormalize.Visible = true; } else if (dialogResult == DialogResult.No) { return; } } }
public GroupControlTransform(ErrorContainer errors, EditorStateStore editorStateStore, Entropy entropy) { _editorStateStore = editorStateStore; _errors = errors; _entropy = entropy; }
public InstallableFileEditorVM(InstallableFile p_iflInstallableFile, IList <VirtualFileSystemItem> p_lstFileSystemItems) { InstallableFile = p_iflInstallableFile; FileSystemItems = p_lstFileSystemItems; Errors = new ErrorContainer(); }
/// <summary> /// A simple constructor that initializes the view model with the <see cref="IModInfo"/> /// that it will represent. /// </summary> /// <param name="p_mifInfo">The <see cref="IModInfo"/> being edited.</param> public ModInfoVM(IModInfo p_mifInfo) { Errors = new ErrorContainer(); ModInfo = p_mifInfo; Reset(); }
public OptionInfoEditorVM(Option p_optOption, IList<VirtualFileSystemItem> p_lstModFiles) { Option = p_optOption; ModFiles = p_lstModFiles; Errors = new ErrorContainer(); }
/// <summary> /// A simple constructor that initializes the view model with the <see cref="IModInfo"/> /// that it will represent. /// </summary> /// <param name="p_mifInfo">The <see cref="IModInfo"/> being edited.</param> public ModInfoVM(IModInfo p_mifInfo) { Errors = new ErrorContainer(); ModInfo = p_mifInfo; Reset(); }
/// <summary> /// A simple constructor that initializes the object with the given dependencies. /// </summary> /// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param> /// <param name="p_gmdGameModeInfo">The descriptor of the current game mode.</param> /// <param name="p_booUseAdditionalChecks">Whether to use additional checks to validate the folders.</param> public RequiredDirectoriesControlVM(IEnvironmentInfo p_eifEnvironmentInfo, IGameModeDescriptor p_gmdGameModeInfo, bool p_booUseAdditionalChecks) { EnvironmentInfo = p_eifEnvironmentInfo; GameModeDescriptor = p_gmdGameModeInfo; m_booRequiredTool = GameModeDescriptor.OrderedRequiredToolFileNames != null; Errors = new ErrorContainer(); m_booUseAdditionalChecks = p_booUseAdditionalChecks; }
public void LoginFailure(string email, string password, bool existingEmail, HttpClient client, HttpResponseMessage loginRsp, ErrorContainer errors) { $"Given I have an instance of httpclient" .x(() => client = _server.Http()); if (existingEmail) { $"And my email should exists in system" .x(() => _server.Services.EnsureUserRecordExists(new UserRecord { Id = Guid.NewGuid().ToString(), Email = email, PasswordHash = Guid.NewGuid().ToString() })); } $"When I submit my login details" .x(async() => loginRsp = await client.PostFormDataAsync("/accounts/login/", new LoginRequest { Email = email, Password = password })); $"Then I should receive a bad request status code" .x(() => loginRsp.StatusCode.ShouldBe(HttpStatusCode.BadRequest)); $"And the response should contain error collection" .x(async() => errors = await loginRsp.ReadAsAsync <ErrorContainer>()); $"And error should contain correct error message" .x(() => errors.HasError("Email", "Failed to login. Please ensure you entered correct email and password.")); }