public void CopyFrom(ActivityHarness ah)
        {
            _activityStamp  = ah.ActivityStamp;
            IsActivityOwner = ah.IsActivityOwner;

            if (ah.FixedContext != null)
            {
                this.FixedContext = ah.FixedContext;
            }

            ApplicationEx.Instance.GetSchema(this);
            Schema = XDocument.Parse(ApplicationEx.Instance.ServerApplicationService.Response.ToString());
            XElement act = (XElement)Schema.Document.Root.FirstNode;

            PublishResponse(act);

            if (_customSchemaControls != null)
            {
                IEnumerator <ICustomSchemaPublisher> e = CustomSchemaControls.GetEnumerator();

                while (e.MoveNext())
                {
                    e.Current.CustomPublishSchema(act, this.FixedContext);
                }
            }

            this._duplicateIndex = ApplicationEx.Instance.RegisterActivityCopy(this._container);
        }
        private void PublishActivity(bool success, XDocument response)
        {
            if (success)
            {
                IsActivityOwner = true;
                Schema          = XDocument.Parse(response.ToString());
                XElement act = (XElement)Schema.Document.Root.FirstNode;

                while (act != null)
                {
                    if (act.Attribute(Common.ActivityHandle) != null)
                    {
                        _activityStamp = act.Attribute(Common.ActivityHandle).Value;
                    }

                    if (act.Attribute("fixedContext") != null)
                    {
                        FixedContext = act.Attribute("fixedContext").Value;
                    }

                    //PublishResponse(act); // TEMP CA

                    if (_customSchemaControls != null)
                    {
                        IEnumerator <ICustomSchemaPublisher> e = CustomSchemaControls.GetEnumerator();

                        while (e.MoveNext())
                        {
                            e.Current.CustomPublishSchema(act, this.FixedContext);
                        }
                    }

                    ApplicationEx.Instance.RegisterActivity(this._container);
                    act = (XElement)act.NextNode;
                }
            }
        }