public void EnsureInitialized(Guid contextId)
        {
            if (this.contextId != contextId)
            {
                this.initialized = false;
                this.contextId   = contextId;
            }

            if (this.Initialized)
            {
                return;
            }

            if (!isRootContext)
            {
                this.properties =
                    new SerializableReadOnlyDictionary <string, string>(
                        new KeyValuePair <string, string>(WellKnownContextProperties.InstanceId, workflowId),
                        new KeyValuePair <string, string>(WellKnownContextProperties.ConversationId, Guid.NewGuid().ToString()));
            }
            else
            {
                this.properties = new SerializableReadOnlyDictionary <string, string>(
                    new KeyValuePair <string, string>(WellKnownContextProperties.InstanceId, workflowId));
            }

            this.initialized = true;
        }
        public void EnsureInitialized(Guid contextId)
        {
            if (this.contextId != contextId)
            {
                this.initialized = false;
                this.contextId = contextId;
            }

            if (this.Initialized)
            {
                return;
            }

            if (!isRootContext)
            {
                this.properties =
                    new SerializableReadOnlyDictionary<string, string>(
                    new KeyValuePair<string, string>(WellKnownContextProperties.InstanceId, workflowId),
                    new KeyValuePair<string, string>(WellKnownContextProperties.ConversationId, Guid.NewGuid().ToString()));
            }
            else
            {
                this.properties = new SerializableReadOnlyDictionary<string, string>(
                    new KeyValuePair<string, string>(WellKnownContextProperties.InstanceId, workflowId));
            }

            this.initialized = true;
        }