About updating UI thread

Hi. Does the main.cs run on the UI thread. I mean when I add a method in Main.cs and update the UI from that method can I omit this.Dispatcher.BeginToInvoke(delegate()... or should I include it? Like the following method is in Main.cs
// Set the recording state: stop recording.
private void StopVideoRecording()
try
// Stop recording.
if (_cs.VideoCaptureDevice != null
&& _cs.State == CaptureState.Started)
_cs.Stop();
// Disconnect fileSink.
fileSink.CaptureSource = null;
fileSink.IsolatedStorageFileName = null;
// Set the button states and the message.
UpdateUI(ButtonState.Stopped, "Preparing viewfinder...");
StopTimer();
StartVideoPreview();
// If stop fails, display an error.
catch (Exception e)
this.Dispatcher.BeginInvoke(delegate()
txtDebug.Text = "ERROR: " + e.Message.ToString();
Thanks in advance

Hello,
if Main.cs is a code behind of a Window or Usercontrol, it's executed into UI Thread and you don't need to add a dispatcher.
In general, all the code is executed in UI Thread excepted if you launch some part of your code into another thread manually.
Regards
Cedric

Similar Messages

  • Cat... What about a sticky thread upda

    Been away for a bit and even after my extended absence I can still see some of the same Q's coming up.
    Specifically microphone Q's, can you not tag a little line or two onto a thread somewhere explaining that the mic needs to be made the acti've recording device to work? That and renaming the mic may be required to make it work in Vista in some instances?
    This question is reasonable, comes up fairly regularly and has a simple answer, surely that makes it a prime candidate for an FAQ/Sticky thread of some kind.
    Also how about updating the "Response to forum questions and latest updates" thread, e.g. is the 4Gb RAM/BSOD issue fixed or not now? I'm sure I saw you say as much a while back yet the sticky hasn't been corrected to say as much, plus this would probably be an ideal thread to tag that mic solution on to.Message Edited by Giftmacher on 07-25-2007:57 AM

    Oh and where are my manners!
    Please, and thanks
    Gift.

  • True about updates through a view

    hi frds
    i just need the right answer for the choices mentioned below with explanation
    plz help me
    What is true about updates through a view?
    A. You cannot update a view with group functions.
    B. When you update a view group functions are automatically computed.
    C. When you update a view only the constraints on the underlying table will be in effect.
    D. When you update a view the constraints on the views always override the constraints on the underlying tables.

    And a very tricky only it is.
    Peter, you are correct that view constraints are not enforced in the sense of PKs and FKS, but there are two other view constraints that are enforced.
    SQL> CREATE TABLE t AS
      2  SELECT rownum id, object_name
      3  FROM all_objects
      4  WHERE rownum < 11;
    Table created.
    SQL> CREATE VIEW t_read AS
      2  SELECT * FROM t
      3  WITH READ ONLY;
    View created.
    SQL> CREATE VIEW t_check AS
      2  SELECT * FROM t
      3  WHERE mod(id,2) = 0
      4  WITH CHECK OPTION;
    View created.
    SQL> CREATE VIEW t_nocheck AS
      2  SELECT * FROM t
      3  WHERE MOD(id, 2) = 0;
    View created.
    SQL> INSERT INTO t_read VALUES (100, 'READ ONLY');
    INSERT INTO t_read VALUES (100, 'READ ONLY')
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    SQL> INSERT INTO t_check VALUES (100, 'EVEN ID');
    1 row created.
    SQL> INSERT INTO t_check VALUES (101, 'ODD ID');
    INSERT INTO t_check VALUES (101, 'ODD ID')
    ERROR at line 1:
    ORA-01402: view WITH CHECK OPTION where-clause violation
    SQL> INSERT INTO t_nocheck VALUES(100, 'EVEN ID');
    1 row created.
    SQL> INSERT INTO t_nocheck VALUES(101, 'ODD ID');
    1 row created.
    SQL> UPDATE t_check SET id = 201
      2  WHERE id = 2;
    UPDATE t_check SET id = 201
    ERROR at line 1:
    ORA-01402: view WITH CHECK OPTION where-clause violation
    SQL> UPDATE t_nocheck SET id = 201
      2  WHERE id = 2;
    1 row updated.The WITH READ ONLY constraint bars all changes to the view. The WITH CHECK OPTION stops any changes that would make the record invisible to the view. It is essentially a CHECK constraint on the view.
    John

  • I just updated my iPad 3 to ios 7.02 and can no longer sync with iTunes on my computer running OS 10.5.8. I'm wary about updating to Lion, which may cause any number of apps on my computer to no longer work. Although I may consider purchasing a new laptop

    I just updated my iPad to IOS 7.02 and unfortunately can no longer sync with my MacBook running OS 10.5.8. I'm wary about updating to Lion as this may cause any number of apps on my Macbook not to work at all or malfunction. Also my MacBook is 5 years old, and I was thinking about purchasing a new computer. I would like to decide when rather than be forced though. Does anyone have any suggestions for a work around? At the moment I do not subscribe to the cloud, and it looks like that is the only way I can back up my iPad now.

    Upgrade to Snow Leopard - it's compatible with the latest version of iTunes, and still supports PowerPC applications.
    $19.99 - http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
    Snow Leopard is required if you wanted to upgrade to Lion, anyway, which you may want to in the future if the latest version of iTunes no longer supports Snow Leopard.

  • Problem about updating to Mac OS X 10.5.3

    Hi there,
    I just bought my Macbook two months ago. I encounted a problem about updating it to the latest version of MAC OS X. The system reminded me to restart, I proceed. Everythig looked just fine until a poping up window shown "Mac OS X 10.5.3 pacakage can not be validated". Dose anyone know what did that mean? How can I update my little mac?

    Hi Hummer,
    First, welcome to Apple discussions.
    To answer your question, your computer checks all downloaded updates before installing them. It does this to make sure it's got the entire file and that the update will install correctly. The fact that validation fails on your machine probably means the file did not download correctly.
    To install 10.5.3, simply go to this website, download the "10.5.3 combo update" and then run it on your Mac: http://www.apple.com/support/downloads/

  • About updating  long text  in the document item  with bdc of fb02

    HI,
    I have a question about updating  long text  in the document item of sap:
    Can I directly updating the long text information with the fuction save_text?
    The long text is in :
    tcode: fb02 -->input document no ... --> Document overview --> select one document
    long text --> updating the value.
    Becaust I want to update some items in a G/L Account with bdc or other technique, but I found I can't   choose the items in the G/L Account with bdc automatically .That means I can't get the selected items and update them.So I try to update them with the function save_text  directly (I know the doc no,bukrs,fiscal year ,item no which will decide the long text item).
    Who can help me ?Or is there any way to solve the problem? Thanks very much.

    Yes, you can update directly using SAVE_TEXT.
    Check this for the same.
    [update long text in FB02|https://forums.sdn.sap.com/click.jspa?searchID=22194840&messageID=5418662]

  • Here's my Vent of the Day - How about one topic/thread per subject?

    I see lots of topics/threads started that are exactly the same as ones already out there, and many of those could be answered if the OP would just search what's already been said, or read generally available information before posting. And then there are so many posts for which even the OP knows don't have an answer. It's just hard to wade through all these repetitive posts to find the ones that need answers or could be informative to all.
    _For instance, how about a single thread for some of these_?
    How do we get our free cases
    When will Apple make a hardware change to iP4
    Do you think I should buy now or wait
    I'm happy with my phone, why aren't you
    Let's all complain about Apple, Steve, whatever
    Now what was it that was said in the Press Release? (like maybe go read it)
    Face Proximity should be fixed
    Antenna Problem should be fixed
    So that's my vent for the day (everyone else is doing it). Come to think of it, I'm gonna change the topic of this post to "Here's my Vent of the Day"
    Message was edited by: DianeX
    Message was edited by: DianeX

    R C-R wrote:
    Keep in mind that a lot of new or occasional Discussions users are not familiar with how the Discussions search engine works & that it is, to be kind about it, more than a little quirky. For instance, even many regular users don't know that the default search box scope is different depending on the category you use it from. And compared to "smart" search engine technology like say Google or bing uses, you often need to use the arcane, 1990's era syntax mentioned in Search Tips to get good results.
    Plus, users not already familiar with an issue or its terminology often have no idea how to create a good search query that doesn't produce an overwhelming number of unrelated hits.
    Besides, venting & ranting are close cousins & the ToU make it clear these forms of self-indulgence are not really acceptable topics for Discussions to begin with. I'm sure a huge number of Discussions users are frustrated by all the topics taken over by such things, but {ahem} venting that frustration is just adding more fuel to the fire, so to speak.
    My point may have been more clear if I hadn't somehow posted this on the Discussions area instead of the iPhone4 one, where there are continual repeats of the same topics (most of which have no answer anyway)

  • How do I stop the dialog box from popping up asking me Qs about updates when I start Firefox?

    I recall electing to have Firefox ask me at startup about updates and I would like to change that and just open a browser window whenever I start Firefox.

    *Sanitisminau: https://addons.mozilla.org/firefox/addon/5364/

  • When I update some of my addons, everytime I open firefox information about update is in new tabs, even "welcome to firefox" is always there in new tab! It's very annoying!

    Question
    When I update some of my addons, everytime I open firefox information about update is in new tabs, even "welcome to firefox" is always there in new tab! It's very annoying!

    Ok I found a solution that worked for me, I simply dragged the user.js and the user.js.BAK to the desktop, before that I had done the same with the prefs.js and prefs.js.BAK, but that didn't help, so it's apparently the user file that was an error with.
    It was the link from cor-el that helped me on the way http://kb.mozillazine.org/Preferences_not_saved
    It's at the bottom titled User.js file locks certain preferences.
    This article can also help https://support.mozilla.com/en-US/kb/Preferences%20are%20not%20saved
    It have still not made a new user.js file, but everything runs fine, hope this can help others to.

  • HT4623 how about updating an older ipod which does not offer "software update" as a choice when one taps on General under Settings?

    how about updating an older ipod which does not offer "software update" as a choice when one taps on General under Settings?

    http://support.apple.com/kb/HT4972
    Unless you have a 2nd generation iPod Touch, in which case 4.2.1 is the highest possible.

  • JWS shows a dialog asking about update new shortcut in no-Japanese

    I installed an application at JRE 1.4.1_03, with Japanese JWS. After
    JRE1.4.2 came up, I uninstalled JRE1.4.1_03
    and re-installed JRE1.4.2 without the uninstalled application.
    JWS shows a dialog asking about updating new shortcut. But the "Yes" and
    "No" buttons in the dialog box are not in Japanese, they are just empty
    squares.
    How can I fix these boxes into Japanese "Yes" and "No" buttons?

    Thank you very much for answering my question.
    I installed JRE1.4.2 Japanese Page, so it will be International version. The installer and other dialog words are in Japanese. Just "Yes" and "No" buttons in Dialog are not in Japanese.
    Thank you,
    Miki
    Sounds like you installed the JRE1.4.2 English only
    instead of the
    International version.
    Manfred.

  • Advice about updating os

    I'm hoping that some generous soul will give me a bit of advice about updating the os.
    I have a macbook intel core 2 duo 2.16 running osx 10.4.9 I have stayed with this os for the last year or so becuase it was the only one that would run protools. But now safari is having trouble loading some pages and regularly quits unexpectly and things are generally slower.
    Would it be a good idea to buy a new version of mac os (like leopard), reformat the machine and start again? if so, is it a straighforward process (like it usually is on a pc)?
    thanks.

    One thing to keep in mind, applications and even Operating Systems do not wear out. If they worked at one time they should continue to work under the same circumstances indefinitely. Something may have gotten corrupt and need fixing. Sometimes an update will cover this by virtue of throwing out the corrupted file because that files gets replaced in the update but that does not necessarily happen, depending. It is far better to fix a problem before installing an update, and then it is very smart to have a way to revert to your "pre-update" status should you discover that the update has something that will not work with your setup. It happens often enough.
    Updates only add features and maybe fix bugs but they can also add bugs and break things that have worked.

  • Question(s) about updating to iOS 5.1.

    Hi everyone! I have a few questions about updating my iPod to the iOS 5.1.
    First question:
    How long will it take? I have used about 8GB worth of memory on it but I have good internet speed.
    Second question:
    My main computer that I originally had everything set up with doesn't want to work good at all with iTunes, so I switched everything over to my grandma's
    computer. So the question is, what will happen to all my music, apps, etc. if I update using my grandma's computer?
    Third question:
    Do I need to transfer my photo's over? I have over 1,000 photo's on my iPod and I was wondering if I updated would I need to transfer them to the computer
    or if they'll manually stay on the iPod.
    Fourth Question:
    If I update, will I be able to do future updates on the iPod itself without everything being erased like it is with past updates?
    Fifth and final question:
    Is the kinks in iOS 5.1 worked out yet? I remember when iOS 5 came out they had a miserable time with it and everyone wasn't too pleased, so I'm wondering if
    it'll do me any good to update?
    I know I sound like a noob, but the last update I did was iOS 4.2 and I don't like doing updates because they take forever with putting everything back on the iPod. They also worry me a bit because I don't want to lose my music and apps (yes I back the iPod up every few downloads but it still worries me lol). Thanks

    GfxQueen4357 wrote:
    Hi everyone! I have a few questions about updating my iPod to the iOS 5.1.
    First question:
    How long will it take? I have used about 8GB worth of memory on it but I have good internet speed.
    Downloading the update file can take an hour or more. After it is downloaded the actual update should take between one and two hours, likely closer to one hour.
    Second question:
    My main computer that I originally had everything set up with doesn't want to work good at all with iTunes, so I switched everything over to my grandma's
    computer. So the question is, what will happen to all my music, apps, etc. if I update using my grandma's computer?
    If all the media is on Grandma's computer and in the iTunes library and the computer authrized for the iTunes accounts used then the media will be restored to the iPod during a latter stage of the update if you:
    - Connect the iPod to the computer and and make a backup by right clicking one the iPod under Devices in iTunes and select Back Up. Then restore from that backup. The restore will also do the update.
    Note that the backup that iTunes makes does not included synced media like aps and music.
    Third question:
    Do I need to transfer my photo's over? I have over 1,000 photo's on my iPod and I was wondering if I updated would I need to transfer them to the computer or if they'll manually stay on the iPod.
    If the photos were taken by or saved to the iPod they are in the backup that iTunes makes.  If they were synced to the iPod you have to move them from the old computer to grandma's computer. There are third-party programs that will copy synced photos from the iPod to a computer but you have to pay for them.
    Fourth Question:
    If I update, will I be able to do future updates on the iPod itself without everything being erased like it is with past updates?
    With iOS 5, you can do subsequent updates on the iPod itself via wifi. Nothing is lost (unless something goes amiss)
    Fifth and final question:
    Is the kinks in iOS 5.1 worked out yet? I remember when iOS 5 came out they had a miserable time with it and everyone wasn't too pleased, so I'm wondering if
    it'll do me any good to update?
    I have no problems with iOS 5.1. It is improved over iOS 5 and 5.o.1 with the except that sometines the iPod will crash when you try to edit a photo you took.
    I know I sound like a noob, but the last update I did was iOS 4.2 and I don't like doing updates because they take forever with putting everything back on the iPod. They also worry me a bit because I don't want to lose my music and apps (yes I back the iPod up every few downloads but it still worries me lol). Thanks
    The following also tells you what will happen when you update another than the syncing computer. If you follow with what I said above, it will be the same as updating on yur syncing computer.
    iOS 5: Updating your device to iOS 5

  • Help!Can someone tell me the detail about Event Dispatch thread!

    I want to know the whole process about swing event,for example,the detail about
    event dispatch thread,the relation about event dispatch thread with event queue,and how the JVM painting the screen etc.
    Thanks!

    Read the tutorial titled "Creating a GUI Using JFC/Swing" found on this page":
    http://java.sun.com/docs/books/tutorial/
    Take a look at the table of contents, there is a section on threads which discusses the event thread and there are sections on painting. Actually take the time to read the whole tutorial.

  • Where we can know about the stuck threads without taking thread dump.

    Hi Everyone,
    Where we can View/know about the stuck threads without taking thread dump.
    Thank You

    Hi!
    WebLogic Server diagnoses a thread as stuck if it is continually working (not idle) for a set period of time. You can tune stuck threads in the Weblogic Server.
    You can tune a server’s thread detection behavior by changing the length of time before a thread is diagnosed as stuck, and by changing the frequency with which the server checks for stuck threads.
    It can be configured using below mentioned 2 parameters. These can be configured from Admin console -> Servers ->Configuration > Tuning tab.
    1)Stuck Thread Max Time
    2)Stuck Thread Timer Interval
    Although you can change the criteria WebLogic Server uses to determine whether a thread is stuck, you cannot change the default behavior of setting the “warning” and “critical” health states when all threads in a particular execute queue become stuck.
    There is a parameter "Stuck Thread Count" which can be configured from Console
    (Servers -> Configuration ->Overload -> Stuck Thread count) which helps to transition the Server to FAILED state once the stuck threads reaches the value.
    You can also use "OverloadProtectionMBean" for tuning. In Weblogic Server 9.x and later, it is recommended that you use the "ServerFailureTriggerMBean" in the "OverloadProtectionMBean".The ServerFailureTriggerMBean transitions the server to a FAILED state after the specified number of stuck threads are detected.The OverloadProtectionMBean has options to suspend or shutdown a failed server.
    WebLogic Server checks for stuck threads periodically. If all application threads are stuck, a server instance marks itself failed, if configured to do so, exits. You can configure Node Manager or a third-party high-availability solution to restart the server instance for automatic failure recovery.
    You can configure these actions to occur when not all threads are stuck, but the number of stuck threads have exceeded a configured threshold:
    - Shut down the Work Manager if it has stuck threads. A Work Manager that is shut down will refuse new work and reject existing work in the queue by sending a rejection message. In a cluster, clustered clients will fail over to another cluster member.
    - Shut down the application if there are stuck threads in the application. The application is shutdown by bringing it into ADMIN mode. All Work Managers belonging to the application are shut down, and behave as described above.
    - Mark the server instance as failed and shut it down it down if there are stuck threads in the server. In a cluster, clustered clients that are connected or attempting to connect will fail over to another cluster member.
    You can configure the "ServerFailureTriggerMBean" in the "OverloadProtectionMBean".
    Below is documentation link for "ServerFailureTriggerMBean" methods.
    http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13945/weblogic/management/configuration/ServerFailureTriggerMBean.html
    You can use getStuckThreadCount() method to check the number of stuck threads and transition the server to Failed State once itreaches the limit.
    getStuckThreadCount:
    int getStuckThreadCount() - The number of stuck threads after which the server is transitioned into FAILED state. There are options inOverloadProtectionMBean to suspend and shutdown a FAILED server. By default, the server continues to run in FAILED state. If the StuckThreadCount value is set to zero then the server never transitions into FAILED server irrespective of the number of stuck threads.
    Returns:
    The StuckThreadCount value
    Default Value:
    0
    Maximum Value:
    java.lang.Integer.MAX_VALUE
    Minimum Value:
    0
    Below is documentation link for "OverloadProtectionMBean" methods.
    http://download.oracle.com/docs/cd/E11035_01/wls100/javadocs_mhome/weblogic/management/configuration/OverloadProtectionMBean.html
    In the Admin console, you can set the "FailureAction" under Servers->Configuration->Overload to force shutdown the managed server once the server is in Failed state.
    The OverloadProtectionMBean has a method getFailureAction to achieve the same.
    getFailureAction:
    String getFailureAction() - Enable automatic forceshutdown of the server on failed state. The server self-health monitoring detects fatal failures and mark the server as failed. The server can be restarted using NodeManager or a HA agent.
    Valid Values:
    OverloadProtectionMBean.NO_ACTION, OverloadProtectionMBean.FORCE_SHUTDOWN, OverloadProtectionMBean.ADMIN_STATE
    If you start the managed servers using node manager, you can enable "Auto Kill if Failed" and "Auto Restart" in the Admin console, under Servers-> configuration->Health Monitoring. Node Manager will take care of restarting the managed server if you enable "Auto Restart".
    You can also configure the "Stuck Thread Count" and "Failure Action" to "Force Immediate shutdown of the Server" from Admin console under servers-> configuration-> Overload. This will help you to shutdown the server when the stuck thread count is reached. But there is no way to release the threads once they are stuck from the configuration.
    Suppose if you set the value of the Stuck Thread Count to 20, The server will be transitioned to failed state once the count reaches 20 and if you enable the Failure Action, the server self-health monitoring detects fatal failures and mark the server as failed.
    Depending on how you are starting the servers (custom scripts or Node Manager or startup scripts,...), you can restart the servers.
    For more details on this please refer to below link:
    http://www.oracle.com/technetwork/articles/entarch/workload-management-088692.html
    Hope this helps.
    Thanks,
    Cris

Maybe you are looking for

  • Error Message in Field Exit

    Hi All, We have a FM which throws an error message. When that is executed in report, it works fine and the error message is displayed. We have implemented this FM in FIELD EXIT for PRCTR. But it is not throwing any message. We checked the data, it is

  • 10.6.2 Upgrade and Kernel Panic

    In the 24 hours since I upgraded to 10.6.2 I have had #3 Kernel Panic reports asking me to shutdown and re-start the computer. I have verified the disk and permissions and it says it is O.K, but the problem persists. I have not installed anything els

  • Reuse Number Range SD after archiving document

    Hi, we have archiving documents SD of the past years. Is possible reuse the range of documents considering that the range is almost finished? Thanks. Charly

  • Where are my mini books !

    This morning (Wed 27th Sept 06) I sent an order for 2x 6 mini books (12) and I don't think they got to their destination, 5 hours later I was still asked not to quit Aperture as the last of my 6 books were not yet sent...I decided this was an error a

  • Errror 2002

    I think 7.71 quicktime has corrupted my Vista PC so it cannot play MOV files in any way I have taken off quicktime and reinstalled it but I can only installed the latest version. My Sony Platinum cannot run without quicktime as a add on so I cannot c