Пример #1
0
            private WorkflowIdentity Parse()
            {
                if (!ExtractName())
                {
                    return(null);
                }
                if (!ExtractVersion())
                {
                    return(null);
                }
                if (!ExtractPackage())
                {
                    return(null);
                }

                Fx.Assert(!_name.Contains(";"), "Regex should not have matched semi-colon");
                Fx.Assert(!HasLeadingOrTrailingWhitespace(_name), "Whitespace should have been stripped");
                Fx.Assert(_package == null || !HasLeadingOrTrailingWhitespace(_package), "Whitespace should have been stripped");

                WorkflowIdentity result = new WorkflowIdentity();

                result._name    = _name;
                result._version = _version;
                result._package = _package;
                return(result);
            }
Пример #2
0
 internal WorkflowApplicationInstance(
     WorkflowApplication.PersistenceManagerBase persistenceManager,
     IDictionary <XName, InstanceValue> values,
     WorkflowIdentity definitionIdentity)
 {
     this.PersistenceManager = persistenceManager;
     this.Values             = values;
     this.DefinitionIdentity = definitionIdentity;
     _state = (int)State.Initialized;
 }
Пример #3
0
 private static string GetMessage(WorkflowIdentity expectedVersion, WorkflowIdentity actualVersion)
 {
     if (actualVersion == null && expectedVersion != null)
     {
         return(SR.WorkflowIdentityNullStateId(expectedVersion));
     }
     else if (actualVersion != null && expectedVersion == null)
     {
         return(SR.WorkflowIdentityNullHostId(actualVersion));
     }
     else if (!object.Equals(expectedVersion, actualVersion))
     {
         return(SR.WorkflowIdentityStateIdHostIdMismatch(actualVersion, expectedVersion));
     }
     else
     {
         return(null);
     }
 }
Пример #4
0
 public VersionMismatchException(string message, WorkflowIdentity expectedVersion, WorkflowIdentity actualVersion, Exception innerException)
     : base(message, innerException)
 {
     this.ExpectedVersion = expectedVersion;
     this.ActualVersion   = actualVersion;
 }
Пример #5
0
 public VersionMismatchException(WorkflowIdentity expectedVersion, WorkflowIdentity actualVersion)
     : base(GetMessage(expectedVersion, actualVersion))
 {
     this.ExpectedVersion = expectedVersion;
     this.ActualVersion   = actualVersion;
 }