internal void ValidateGuidanceReference(ValidationContext context, IProductElement element)
        {
            try
            {
                if (this.GuidanceManager == null)
                {
                    return;
                }

                var reference = element.TryGetReference(ReferenceKindConstants.GuidanceTopic);
                if (!string.IsNullOrEmpty(reference))
                {
                    var uri = GuidanceReference.GetResolvedReferences(element, this.GuidanceManager).FirstOrDefault();
                    if (uri == null)
                    {
                        context.LogError(
                            string.Format(CultureInfo.InvariantCulture,
                                          Properties.Resources.Validate_GuidanceReferenceNotFound,
                                          element.InstanceName, reference, ReflectionExtensions.DisplayName(typeof(GuidanceReference))),
                            Properties.Resources.Validate_GuidanceReferenceNotFoundCode,
                            element as ModelElement);
                    }
                }
            }
            catch (Exception ex)
            {
                tracer.Error(
                    ex,
                    Properties.Resources.ValidationMethodFailed_Error,
                    Reflector <GuidanceReferenceValidation> .GetMethod(n => n.ValidateGuidanceReference(context, element)).Name);

                throw;
            }
        }
        /// <summary>
        /// Executes this instance.
        /// </summary>
        public override void Execute()
        {
            this.ValidateObject();

            tracer.Info(
                Resources.ActivateGuidanceWorkCommand_TraceInitial, this.CurrentElement.InstanceName);

            // Get the guidance reference from current element
            var instanceName = this.CurrentElement.TryGetReference(ReferenceKindConstants.GuidanceTopic);

            if (!String.IsNullOrEmpty(instanceName))
            {
                tracer.Verbose(
                    Resources.ActivateGuidanceWorkCommand_TraceReferenceFound, this.CurrentElement.InstanceName, instanceName);

                // Get associated feature (if exists in solution)
                var featureInstance = GuidanceReference.GetResolvedReferences(this.CurrentElement, this.GuidanceManager).FirstOrDefault();
                if (featureInstance != null)
                {
                    tracer.Info(
                        Resources.ActivateGuidanceWorkCommand_TraceActivation, this.CurrentElement.InstanceName, instanceName);

                    this.GuidanceManager.ActivateGuidanceInstance(this.ServiceProvider, featureInstance);
                }
                else
                {
                    tracer.Warn(
                        Resources.ActivateGuidanceWorkCommand_TraceGuidanceNotFound, instanceName);
                }
            }
            else
            {
                tracer.Warn(
                    Resources.ActivateGuidanceWorkCommand_TraceNoReference, this.CurrentElement.InstanceName);
            }
        }