GithubHelp home page GithubHelp logo

vb6hobbyst7 / eventtransmission Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markpthomas/eventtransmission

0.0 2.0 0.0 0 B

Contains basic classes and a demonstration of hooking property changing and property changed events to properties of objects within objects. Classes also demonstrate matching property names to the event hooked, as well as determining the property name through reflection to avoid hard-coding names for the INotifyPropertyChanged and INotifyPropertyChanging events.

Visual Basic 100.00%

eventtransmission's Introduction

EventTransmission

Contains basic classes and a demonstration of hooking property changing and property changed events to properties of objects within objects. Classes also demonstrate matching property names to the event hooked, as well as determining the property name through reflection to avoid hard-coding names for the INotifyPropertyChanged and INotifyPropertyChanging events.

The project includes a form where the classes can be tested. Properties can be changed, which are updated to the form, and an output is displayed to the console.

Methodology

The setup of the test is that:

  1. The form contains a private child object and a private parent object. The child object is passed to the parent object by reference.

  2. The form changes properties of the private child object directly, as well as properties of the doll object that the child contains as a property.

  3. Upon the starting and ending of either property change in step 2, the form is triggered by the parent classes notifying the form of its property change (of the child, or even the child's doll).

a. At each stage, the output of the property values is displayed for both the private child object of the form and the private parent object.

b. The form is selectively updated base on which property was updated.

Adding Listeners at Each Class Level vs. the Parent Class Only

To more fully experiment with pros/cons of different ways to pass the property change events, there are two sets of parent-child-doll classes. One set has events thrown at each class level to cascade a property change event up through the objects. Another set only has each class declare its non-object properties changed, and a listener is added to the object properties at the parent class.

This project demonstrates that both work. Source code shows a comparison of how the systems are implemented, with comments highlighting the pros/cons of each method.

eventtransmission's People

Contributors

markpthomas avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.