locked
Enum variable RRS feed

  • Question

  • Hello,

    I'm programming a Workflow Service and try to create variables / arguments with the type of an enum I declared in an assembly I referenced. When I open the "Browse and select a .Net type" dialog, it only drills down to the class which holds the enum, but not further.

    I have a sealed class named Constants under my namespace, and under that a public enum named TaskType. But I cannot see TaskType enum when selecting the type, but I can create an InArgument<Constants.TaskType> in a code activity.

    Why is that?

    Thanks in advance.

     

    Thursday, July 8, 2010 2:22 PM

Answers

  • Hi Lazywriter,

    WF Designer's Type Browser will not show 'Nested Class' because Xaml does not support it. You can try following code:

      public class A
      {
        public class B
        {
        }
      }
    
      class Program
      {
        static void Main(string[] args)
        {
          XamlServices.Save(new A.B());
        }
      }

    A System.Xaml.XamlObjectReaderException will be thrown. Message: Unable to read objects of the type 'A+B'.  Nested types are not supported.

    WF Designer is relying on Xaml Serialize/Deserialize, that's why type browser dose not support nested type.


    This posting is provided "AS IS" and confers no rights or warranties.
    • Marked as answer by Lazywriter Thursday, July 8, 2010 3:15 PM
    Thursday, July 8, 2010 2:43 PM