Exemplo n.º 1
0
 public void SpecificationProcessedEventHandler(object sender, SpecificationEventArgs eventArgs)
 {
     try
     {
         CopyLogoToTarget();
         TimeSpan span = new TimeSpan(DateTime.Now.Ticks).Subtract(new TimeSpan(start.Ticks));
         AddFooterToDocument(eventArgs.Element, eventArgs.Resource, span.Ticks);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }
        public void SpecificationProcessedEventHandler(object sender, SpecificationEventArgs eventArgs)
        {
            try
            {
                Target.Write(eventArgs.Resource, XML_DECLARATION + eventArgs.Element.ToXml());
                if (Target is FileTarget)
                {
                    // TODO - Replace this with something meaningful

                    Console.WriteLine("Processed specifications : " + ((FileTarget)Target).GetTargetPath(eventArgs.Resource));
                }
            }
            catch (Exception e)
            {
                throw new Exception("Failed to write results to '" + eventArgs.Resource.Path + "'.", e);
            }
        }
        public void SpecificationProcessedEventHandler(object sender, SpecificationEventArgs eventArgs)
        {
            try
            {
                Element span = new Element("span").AddStyleClass("breadcrumbs");
                AppendBreadcrumbsTo(span, eventArgs.Resource);

                if (span.HasChildren)
                {
                    GetDocumentBody(eventArgs.Element).PrependChild(span);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Exemplo n.º 4
0
        private void HandleCreateSpecificationRequest(object sender, SpecificationEventArgs e)
        {
            var testProjectname = string.Format("{0}.Tests", e.Source.Item.ContainingProject.Name);
            var targetProject   = FindProject(dte.Solution.Projects.Cast <Project>(), testProjectname);

            if (targetProject == null)
            {
                MessageBox.Show(string.Format("You need create a test project {0} first.", testProjectname));
                //var specitem = targetProject.ProjectItems.AddFromTemplate(e.SpecName, e.SpecName);
                //var w = specitem.Open(Constants.vsViewKindCode);
                //w.Visible = true;
                return;
            }

            e.targetProject = targetProject;

            if (addSpecificationCommand == null)
            {
                addSpecificationCommand = new AddSpecificationCommand(dte);
            }

            addSpecificationCommand.Execute(e);
        }
 public void SpecificationProcessingEventHandler(object sender, SpecificationEventArgs eventArgs)
 {
 }
 /// <summary>
 /// Handles the SpecificationProcessed event that is triggered after the specification is processed
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="eventArgs">The <see cref="SpecificationEventArgs"/> instance containing the event data.</param>
 public void SpecificationProcessedEventHandler(object sender, SpecificationEventArgs eventArgs)
 {
     TestLog.AttachXHtml(eventArgs.Resource.Name, eventArgs.Element.ToXml());
 }
Exemplo n.º 7
0
 public void SpecificationProcessingEventHandler(object sender, SpecificationEventArgs eventArgs)
 {
     start = DateTime.Now;
 }