Ejemplo n.º 1
0
 internal static IList <string> GetTextExpressionNamespaces(object root, out IList <AssemblyReference> references)
 {
     if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
     {
         references = TextExpression.GetReferencesForImplementation(root);
         return(TextExpression.GetNamespacesForImplementation(root));
     }
     else
     {
         references = TextExpression.GetReferences(root);
         return(TextExpression.GetNamespaces(root));
     }
 }
Ejemplo n.º 2
0
        static DynamicActivity GetDynamicActivity(ActivityBuilder activityDefinition)
        {
            DynamicActivity result = new DynamicActivity
            {
                Name = activityDefinition.Name
            };

            foreach (DynamicActivityProperty property in activityDefinition.Properties)
            {
                result.Properties.Add(property);
            }
            foreach (Attribute attrib in activityDefinition.Attributes)
            {
                result.Attributes.Add(attrib);
            }
            foreach (Constraint constraint in activityDefinition.Constraints)
            {
                result.Constraints.Add(constraint);
            }
            result.Implementation = () => activityDefinition.Implementation;

            VisualBasicSettings vbsettings = VisualBasic.GetSettings(activityDefinition);

            if (vbsettings != null)
            {
                VisualBasic.SetSettings(result, vbsettings);
            }

            IList <string> namespacesForImplementation = TextExpression.GetNamespacesForImplementation(activityDefinition);

            if (namespacesForImplementation.Count > 0)
            {
                TextExpression.SetNamespacesForImplementation(result, namespacesForImplementation);
            }

            IList <AssemblyReference> referencesForImplementation = TextExpression.GetReferencesForImplementation(activityDefinition);

            if (referencesForImplementation.Count > 0)
            {
                TextExpression.SetReferencesForImplementation(result, referencesForImplementation);
            }

            return(result);
        }
Ejemplo n.º 3
0
        private static DynamicActivity GetDynamicActivity(ActivityBuilder activityDefinition)
        {
            var result = new DynamicActivity
            {
                Name = activityDefinition.Name
            };

            foreach (var property in activityDefinition.Properties)
            {
                result.Properties.Add(property);
            }
            foreach (var attrib in activityDefinition.Attributes)
            {
                result.Attributes.Add(attrib);
            }
            foreach (var constraint in activityDefinition.Constraints)
            {
                result.Constraints.Add(constraint);
            }
            result.Implementation = () => activityDefinition.Implementation;

            var vbsettings = VisualBasic.GetSettings(activityDefinition);

            if (vbsettings != null)
            {
                VisualBasic.SetSettings(result, vbsettings);
            }

            var namespacesForImplementation = TextExpression.GetNamespacesForImplementation(activityDefinition);

            if (namespacesForImplementation.Count > 0)
            {
                TextExpression.SetNamespacesForImplementation(result, namespacesForImplementation);
            }

            var referencesForImplementation = TextExpression.GetReferencesForImplementation(activityDefinition);

            if (referencesForImplementation.Count > 0)
            {
                TextExpression.SetReferencesForImplementation(result, referencesForImplementation);
            }

            return(result);
        }