Welcome to MSDN Blogs Sign in | Join | Help

Loosely Coupled Thinking

SOA, BPM, ISC & more...

News

  • Better Search:

    Tweets


      Reading

      About

      Not me but an incredibly realistic simulation.
      John Evdemon
      is an Architect
      at Microsoft.

      <legal-stuff>
      The views and opinions stated in this blog are mine and do not necessarily reflect those of Microsoft.
      Each posting on this blog is provided "AS IS" with no warranties, and confers no rights.
      </legal-stuff>


      Social

      View John Evdemon's profile on LinkedIn

      John Evdemon's Facebook profile



      Locations of visitors to this page

      Off Topic

      Drill Here, Drill Now and Pay Less at the Pump - sign the petition to Congress

      Aren't fuel prices high enough?  No new energy taxes!

    Fixing the WF FileWatcher sample

    There is a FileWatcher WF activity sample that ships with the Windows SDK.   I initially thought this might be of value to me but when I tried to open the workflow I ran into the following error: “Theme properties can only be changed in the Theme Configuration Dialog.”   Very intuitive right?   

    Actually it is an intuitive message, it just requires some knowledge  about how custom activities are built.   The original version of the FileWatcher Activity included some code in the designer initialization to make the icon for the Activity look cooler in the toolbox.   This code causes problems if you try to open anything using the activity (e,g, the workflow that comes with the example).

    If you've run into this problem you can comment out the following code in the initialization activity (found in FileSystemEventDesigner.cs):

    protected override void Initialize(Activity activity)
    {
        base.Initialize(activity);

     

        // Change the designer theme for this activity  -- This is the offending code
        // this.DesignerTheme.BackColorStart = Color.White;
        // this.DesignerTheme.BackColorEnd = ColorTranslator.FromHtml("#F9CB5A");
        // this.DesignerTheme.BackgroundStyle = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
        // this.DesignerTheme.BorderColor = ColorTranslator.FromHtml("#BF8311");
    }

    Once you comment that code out you'll be able to open the workflow and work with the designer (note that there may be other issues worth considering if you want to use this in a State Machine - the sample only uses a simple sequential workflow).

    Posted: Friday, February 22, 2008 11:00 AM by jevdemon

    Comments

    Noticias externas said:

    There is a FileWatcher custom WF activity sample that ships with the Windows SDK .&#160;&#160; I initially

    # February 22, 2008 2:10 PM
    New Comments to this post are disabled
    Page view tracker