private void AbrirModificar(Hotel hotel) { var hotelCopy = ObjectCloner.DeepCopy(hotel); if (hotelCopy.FechaDeCreacion == DateTime.MinValue) { MessageBox.Show("El hotel seleccionado no tiene una fecha de creacion. " + "Es posible que esto suceda porque fue creado al realizar una migracion. Se utilizara la fecha de hoy por defecto", "Advertencia"); hotelCopy.FechaDeCreacion = LoginData.SystemDate; } InsertarModificar ins = new InsertarModificar(1, hotelCopy); this.Hide(); ins.ShowDialog(); this.Show(); if (ins.Result == DialogResult.OK) { RefreshData(); } }
/// <summary> /// Create an annealing trainer. /// </summary> /// <param name="method">The method to use.</param> /// <param name="training">The training data to use.</param> /// <param name="argsStr">The arguments to use.</param> /// <returns>The newly created trainer.</returns> public IMLTrain Create(IMLMethod method, IMLDataSet training, String argsStr) { if (!(method is BasicNetwork)) { throw new TrainingError( "Invalid method type, requires BasicNetwork"); } ICalculateScore score = new TrainingSetScore(training); IDictionary <String, String> args = ArchitectureParse.ParseParams(argsStr); var holder = new ParamsHolder(args); int populationSize = holder.GetInt( MLTrainFactory.PropertyPopulationSize, false, 5000); IMLTrain train = new MLMethodGeneticAlgorithm(() => { IMLMethod result = (IMLMethod)ObjectCloner.DeepCopy(method); ((IMLResettable)result).Reset(); return(result); }, score, populationSize); return(train); }
private void AbrirModificar(Hotel hotel) { InsertarModificar ins = new InsertarModificar(1, ObjectCloner.DeepCopy(hotel)); this.Hide(); ins.ShowDialog(); this.Show(); if (ins.Result == DialogResult.OK) { RefreshData(); } }
private void AbrirModificar(Usuario usuario) { AltaModificar alta = new AltaModificar(1, ObjectCloner.DeepCopy(usuario)); this.Hide(); alta.ShowDialog(); this.Show(); if (alta.Result == DialogResult.OK) { RefreshData(); } }
private void AbrirModificar(Rol selectedItem) { InsertarModificar ins = new InsertarModificar(ObjectCloner.DeepCopy(selectedItem)); this.Hide(); ins.ShowDialog(); this.Show(); if (ins.Result == DialogResult.OK) { RefreshRolesData(); } }
/// <inheritdoc/> public Object Clone() { return(ObjectCloner.DeepCopy(this)); }
/// <inheritdoc/> public object Clone() { var result = (BasicNetwork)ObjectCloner.DeepCopy(this); return(result); }
/// <summary> /// Return a clone of this neural network. Including structure, weights and /// threshold values. /// </summary> /// <returns>A cloned copy of the neural network.</returns> public override object Clone() { return(ObjectCloner.DeepCopy(this)); }