c# - modify object on a form other than the one where was created -


I have an object that I make in Form 1 and then I place that object on Form 2.

Is this a good way to modify the properties of 1 object frequency (pois_por_punto)?

So far I have done this:

in Form 1:

  public list & lt; POI & gt; Pois_por_punto; Pois_por_punto = New list & lt; POI & gt; ();   

then:

  private zeros btn_editar_pois_Click (object sender, EventArgs e) {form formular = new form 2 (this, pois_por_punto); formulario.ShowDialog (); }   

In Form 2:

  Public Partial Category Form 2: Form {Private List & lt; POI & gt; _pois; Public Editar_POIs (Form 1 formation, list & lt; POI & gt; pois) {_pois = pois; }   

Then I change the _pois property in my code and then I do this:

  formprincipal.pois_por_punto = _pois;   

}

My Poi class is such a

  public square POI {public decimal POI_x {get; Set; } Public decimal POI_y {get; Set; } Public decimal POI_z {get; Set; Answer: In some circumstances, there are such patterns that you can use in the Industrial grade code. , And there are some patterns that are suitable for work and park. He said, I am going to say that this is probably right, if it works; However, here are some resources you can find useful:  
  • This answer can also be useful because it The abstraction describes the patterns that you can use for such projects.



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -