I'm trying to use threadsfor calls with UI controls from the UI controls. BackgroundWorkerHelper is not available for some reason, maybe due to the version of C # or becuase, I'm positioned on "Window CE 5.0 Device". I have this and calling such threads Then remoteRequestBackgroundTask () function I changed in such control The problem is that when it runs, debugging stops And I get "Not SupportedException" is A look enter further exception under .NET compact Framework currently this method does not support . In that
// Thredsef gets asked to edit the components for personal representatives zero SetControlPropertyThreadSafeDelegate (Control, String propertyName, object propertyValue); public static void SetControlPropertyThreadSafe (Control, String property, objected propertyValue) {if (control.InvokeRequired) {control.Invoke (New SetControlPropertyThreadSafeDelegate (SetControlPropertyThreadSafe), new object [] {control, property, propertyValue}); } Else {control.GetType (). InvokeMember (Property Name, Binding Flex. Setup, blank, Control, New Object [] {propertyValue}); }}
private thread worker thread = new Thread (new Thredstart (this.remoteRequestBackgroundTask)); WorkerThread.Start ();
// Cancel button enabled SetControlPropertyThreadSafe (btnCancel, "enable", true);
control.GetType (). InvokeMember (propertyName, BindingFlags.SetProperty, null, control, new object [] (propertyValue));
not SupportedException , you'll see:
else block, I believe that you can do something like this instead. This is something very similar to the NET compact framework code I have:.
PropertyInfo PropertyInfo = control.GetType () getProperty (property); PropertyInfo.SetValue (control, property value, blank);
Comments
Post a Comment