public virtual void CopyFrom(Type1 other) { Prop1 = other.Prop1; if (other.comp1 != null) { Comp1.CopyFrom(other.Comp1); } else { if (this.comp1 != null) { this.comp1.CopyFrom(new Type2()); } } if (other.col1 != null) { Col1.Clear(); Col1.AddRange(other.Col1); } else { if (this.col1 != null) { this.col1.Clear(); } } }
public override int GetHashCode() { var result = Id.GetHashCode(); result = 31 * result + (Comp1 != null ? Comp1.GetHashCode() : 0); result = 31 * result + (Comp2 != null ? Comp2.GetHashCode() : 0); return(result); }
public override bool Equals(object obj) { var other = obj as ComponentTestEntity; if (other == null) { return(false); } if (Comp1 != null ? !Comp1.Equals(other.Comp1) : other.Comp1 != null) { return(false); } if (Comp2 != null ? !Comp2.Equals(other.Comp2) : other.Comp2 != null) { return(false); } return(Id.Equals(other.Id)); }
public static void Main() { // Create a new HTML Button var button = new HTMLButtonElement(); // Set the Button text button.InnerHTML = "Click Me"; var l = new CompLoader(); var c = new Comp1(); l.Load(Document.Body, c); var l2 = new CompLoader(); var c2 = new Comp1(); l2.Load(Document.Body, c2); // Add a Click event handler button.OnClick = (ev) => { c.MyProp = "Hello"; // Write a message to the Console //Console.WriteLine("Welcome to Bridge.NET"); }; // Add the button to the document body Document.Body.AppendChild(button); // After building (Ctrl + Shift + B) this project, // browse to the /bin/Debug or /bin/Release folder. // A new bridge/ folder has been created and // contains your projects JavaScript files. // Open the bridge/index.html file in a browser by // Right-Click > Open With..., then choose a // web browser from the list // This application will then run in a browser. }
public Serv1(Comp1 c1, Comp2 c2) { }