c# - How to invoke with action? -
I always set the modifier on my form on Private , I do not have internal or public likes does not .
So far I used to call it like this:
public string adtext {if (inquiries) (invited (representative of the method) representative {textbox.text = value; }); } Else textbox.text = value; } But on adding this property to each member on my form the object is not exactly oriented.
I want to create a function which is the parameter (action). I tried my best, but I failed - for members of the form public or internal needs to be: (
Public waste performance finderform (Action & Lieutenant; Formname Action) {var form = form.activform formman; object s = action.clone (); If (form! = Null) {form.PerformAction (action);}} Pub Black void workaction (action and lefthinum; form mane); Two problems in my code:
This property is needed I want to change to become Yes! = Private: (
If the focus is not on the job then does not work.
How to add PR to the operating, which is to reach out to the scope of the "Object Oriented Object" form Shykta? It is really implemented in Your only option is anonymous representative (or a code of Representatives), the reference to the matter in which it was declared. The only feature to be around the visibility issues is the reflection, and it is the big smelly code odor , make your assets and use it as appropriate.
For your second option, I'm assuming that you want to execute it on your "main form". You have two options here: assume that there is only one example and it is class To be kept as a stable asset, specify this example in the constructor.
Public Partial Class MainForm: Form {Private Stable MainForm singletonInstance; Public static mainframe singleton instance ({return homeownantense;}} public MainForm (): base () {InitializeComponent (); SingletonInstance = it;}} Public Zero performance action (action operation) {var Form = mainform. // object s = action.clone (); what was it? If (form! = Null) {form.PerformAction (action);}} other only work If all your forms are properly "owned" and only the owner The form is your main form. In that example, you can:
Public Zero Execution Function (Action & lt; formMain & gt; Actions) {var form = form.ActiveForm.TopLevelControl FormMain ; // object s = action clone (); what was it? If (form! = Null) {form.PerformAction (action);}}
Comments
Post a Comment