Пример #1
0
 public static HtmlTextWriter AddTestHistory(this HtmlTextWriter writer, NunitGoTest nunitGoTest, string id = "")
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
     writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     writer.AddAttribute(HtmlTextWriterAttribute.Id, Output.GetHistoryChartId(nunitGoTest.Guid, nunitGoTest.DateTimeFinish));
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     writer.RenderEndTag();//DIV
     writer.RenderEndTag();//DIV
     return writer;
 }
Пример #2
0
 public static HtmlTextWriter AddEnvironment(this HtmlTextWriter writer, string id = "")
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
     writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     writer.AddTag(HtmlTextWriterTag.B, "Environment information: ");
     writer.RenderBeginTag(HtmlTextWriterTag.P);
     writer.Write(Bullet.HtmlCode + "CLR version: " + Environment.Version);
     writer.RenderEndTag();
     writer.RenderBeginTag(HtmlTextWriterTag.P);
     writer.Write(Bullet.HtmlCode + "OS version: " + Environment.OSVersion.VersionString);
     writer.RenderEndTag();
     writer.RenderBeginTag(HtmlTextWriterTag.P);
     writer.Write(Bullet.HtmlCode + "Platform: " + Environment.OSVersion.Platform);
     writer.RenderEndTag();
     writer.RenderBeginTag(HtmlTextWriterTag.P);
     writer.Write(Bullet.HtmlCode + "Machine name: " + Environment.MachineName);
     writer.RenderEndTag();
     writer.RenderBeginTag(HtmlTextWriterTag.P);
     writer.Write(Bullet.HtmlCode + "User domain: " + Environment.UserDomainName);
     writer.RenderEndTag();
     writer.RenderBeginTag(HtmlTextWriterTag.P);
     writer.Write(Bullet.HtmlCode + "User: " + Environment.UserName);
     writer.RenderEndTag();
     writer.RenderEndTag();//DIV
     return writer;
 }
Пример #3
0
        public static HtmlTextWriter AddTestEvents(this HtmlTextWriter writer, NunitGoTest nunitGoTest, string id = "")
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
            writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            var events = nunitGoTest.Events.OrderBy(x => x.Started);
            foreach (var testEvent in events)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.P);
                writer.AddTag(HtmlTextWriterTag.B, "Test event: ");
                writer.Write(testEvent.Name);
                writer.RenderEndTag(); //P

                writer.RenderBeginTag(HtmlTextWriterTag.P);
                writer.Write(Bullet.HtmlCode + "Started: " + testEvent.Started.ToString("dd.MM.yy HH:mm:ss.fff"));
                writer.RenderEndTag();
                writer.RenderBeginTag(HtmlTextWriterTag.P);
                writer.Write(Bullet.HtmlCode + "Finished: " + testEvent.Finished.ToString("dd.MM.yy HH:mm:ss.fff"));
                writer.RenderEndTag();
                writer.RenderBeginTag(HtmlTextWriterTag.P);
                writer.Write(Bullet.HtmlCode + "Duration: " + testEvent.DurationString);
                writer.RenderEndTag();

            }
            if (!events.Any())
                writer.Write("There are no test events in this test");
            writer.RenderEndTag();//DIV
            return writer;
        }
Пример #4
0
 public static void AddKnockoutDataBind(this IHtmlWriter writer, string name, DotvvmControl control, DotvvmProperty property, Action nullBindingAction = null,
     string valueUpdate = null, bool renderEvenInServerRenderingMode = false, bool setValueBack = false)
 {
     var expression = control.GetValueBinding(property);
     if (expression != null && (!control.RenderOnServer || renderEvenInServerRenderingMode))
     {
         writer.AddAttribute("data-bind", name + ": " + expression.GetKnockoutBindingExpression(), true, ", ");
         if (valueUpdate != null)
         {
             writer.AddAttribute("data-bind", "valueUpdate: '" + valueUpdate + "'", true, ", ");
         }
     }
     else
     {
         if (nullBindingAction != null) nullBindingAction();
         if (setValueBack && expression != null) control.SetValue(property, expression.Evaluate(control, property));
     }
 }
Пример #5
0
        /// <summary>
        /// Renders a link to the file field as a hyperlink tag. Rendering directives in the Action parameter will construct the body of the link. You may add attributes to the link by adding them to the writer before invoking this method.
        /// </summary>
        public static void RenderFileFieldLink(this HtmlTextWriter writer, IFileField fileField, Action linkBody)
        {
            if (!fileField.HasValue) return;

            writer.AddAttribute("href", fileField.Url);
            writer.RenderBeginTag("a");
            linkBody();
            writer.RenderEndTag();
        }
 public static void AddAttributes(this HtmlTextWriter writer, IDictionary<string, object> attributes)
 {
   if (attributes!=null && attributes.Any())
   {
     foreach (KeyValuePair<string, object> attribute in attributes)
     {
       writer.AddAttribute(attribute.Key, attribute.Value.ToString(), true);
     }
   }
 }
Пример #7
0
        internal static void BeginTable(this HtmlTextWriter writer, string border, string cellpadding, string cellspacing, string[] headings)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Border, border);
            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, cellpadding);
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, cellspacing);
            writer.RenderBeginTag(HtmlTextWriterTag.Table);
            writer.RenderBeginTag(HtmlTextWriterTag.Thead);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            foreach (var header in headings)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write(header);
                writer.RenderEndTag(); // Td
            }

            writer.RenderEndTag(); // Tr
            writer.RenderEndTag(); // Thead
        }
 public static void OpenTreeItem(this HtmlTextWriter writer, string name, string id, string fontSize = "100%", bool isChecked = true)
 {
     writer.RenderBeginTag(HtmlTextWriterTag.Ul);
     writer.RenderBeginTag(HtmlTextWriterTag.Li);
     writer.AddAttribute(HtmlTextWriterAttribute.Type, "checkbox");
     if (isChecked)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked");
     }
     writer.AddAttribute(HtmlTextWriterAttribute.Id, id);
     writer.RenderBeginTag(HtmlTextWriterTag.Input);
     writer.RenderEndTag(); //INPUT
     writer.AddAttribute(HtmlTextWriterAttribute.For, id);
     writer.AddStyleAttribute(HtmlTextWriterStyle.FontWeight, "bold");
     writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, fontSize);
     writer.RenderBeginTag(HtmlTextWriterTag.Label);
     writer.Write(name);
     writer.RenderEndTag(); //LABEL
 }
Пример #9
0
        /// <summary>
        /// Adds a new row to the Prevalue Editor, (with an optional description).
        /// </summary>
        /// <param name="writer">The HtmlTextWriter.</param>
        /// <param name="label">The label for the field.</param>
        /// <param name="description">The description for the field.</param>
        /// <param name="controls">The controls for the field.</param>
        public static void AddPrevalueRow(this HtmlTextWriter writer, string label, string description, params Control[] controls)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'row'

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "label");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'label'

            var lbl = new HtmlGenericControl("label") { InnerText = label };

            if (controls.Length > 0 && !string.IsNullOrEmpty(controls[0].ClientID))
            {
                lbl.Attributes.Add("for", controls[0].ClientID);
            }

            lbl.RenderControl(writer);

            writer.RenderEndTag(); // end 'label'

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "field");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'field'

            foreach (var control in controls)
            {
                control.RenderControl(writer);
            }

            writer.RenderEndTag(); // end 'field'

            if (!string.IsNullOrEmpty(description))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "description");
                writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'description'

                var desc = new Literal() { Text = description };
                desc.RenderControl(writer);

                writer.RenderEndTag(); // end 'description'
            }

            writer.RenderEndTag(); // end 'row'
        }
 public static void AddAttributes(this HtmlTextWriter writer, IDictionary<string, object> attributes)
 {
     if (attributes.Any<KeyValuePair<string, object>>())
     {
         foreach (var pair in attributes)
         {
             if (pair.Value != null)
                 writer.AddAttribute(pair.Key, pair.Value.ToString(), true);
         }
     }
 }
Пример #11
0
        internal static void BeginDocument(this HtmlTextWriter writer, string title, string inlineStyleSheet)
        {
            writer.AddAttribute("http-equiv", "Content-Type");
            writer.AddAttribute("content", "text/html;charset=UTF-8");
            writer.RenderBeginTag(HtmlTextWriterTag.Meta);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Html);
            writer.RenderBeginTag(HtmlTextWriterTag.Style);
            writer.Write(inlineStyleSheet);
            writer.RenderEndTag(); // Style

            writer.RenderBeginTag(HtmlTextWriterTag.Head);
            writer.RenderBeginTag(HtmlTextWriterTag.Title);
            writer.Write(title);
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Body);
        }
Пример #12
0
 public static void AddTag(this HtmlTextWriter writer, HtmlTextWriterTag tag,
     Dictionary<string, string> attributes1, 
     Dictionary<HtmlTextWriterAttribute, string> attributes2,
     string value = "")
 {
     foreach (var attribute in attributes1)
     {
         writer.AddAttribute(attribute.Key, attribute.Value);
     }
     foreach (var attribute in attributes2)
     {
         writer.AddAttribute(attribute.Key, attribute.Value);
     }
     writer.RenderBeginTag(tag);
     if (value != "")
     {
         writer.Write(value);
     }
     writer.RenderEndTag();
 }
        public static void AddAttributes(this HtmlTextWriter writer, IDictionary<string, object> attributes)
        {
            Guard.IsNotNull(writer, "writer");

            if (!attributes.IsNullOrEmpty())
            {
                foreach (KeyValuePair<string, object> attribute in attributes)
                {
                    writer.AddAttribute(attribute.Key, attribute.Value.ToString(), true);
                }
            }
        }
        /// <summary>
        ///   Adds the prevalue row heading.
        /// </summary>
        /// <param name = "writer">The writer.</param>
        /// <param name = "heading">The heading.</param>
        public static void AddPrevalueHeading(this HtmlTextWriter writer, string heading)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'row'

            writer.RenderBeginTag(HtmlTextWriterTag.H3); // start 'h3'

            writer.Write(heading);

            writer.RenderEndTag(); // end 'h3'

            writer.RenderEndTag(); // end 'row'
        }
Пример #15
0
 public static HtmlTextWriter AddScreenshots(this HtmlTextWriter writer, NunitGoTest nunitGoTest, string id = "")
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
     writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     var screens = nunitGoTest.Screenshots.OrderBy(x => x.Date);
     foreach (var screenshot in screens)
     {
         writer.Write("Screenshot (Date: " + screenshot.Date.ToString("dd.MM.yy HH:mm:ss.fff") + "):");
         writer.AddAttribute(HtmlTextWriterAttribute.Href, @"./../../Screenshots/" + screenshot.Name);
         writer.RenderBeginTag(HtmlTextWriterTag.A);
         writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
         writer.AddAttribute(HtmlTextWriterAttribute.Src, @"./../../Screenshots/" + screenshot.Name);
         writer.AddAttribute(HtmlTextWriterAttribute.Alt, screenshot.Name);
         writer.RenderBeginTag(HtmlTextWriterTag.Img);
         writer.RenderEndTag();//IMG
         writer.RenderEndTag();//A
     }
     if(!screens.Any())
         writer.Write("There are no screenshots in this test");
     writer.RenderEndTag();//DIV
     return writer;
 }
        public static void AddPrevalueHeading(this HtmlTextWriter writer, string heading, string note)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'row'

            writer.RenderBeginTag(HtmlTextWriterTag.H3); // start 'h3'

            writer.Write(heading);

            writer.RenderEndTag(); // end 'h3'

            if (!string.IsNullOrEmpty(note))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note");
                writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'note'

                writer.Write(note);

                writer.RenderEndTag(); // end 'note'
            }

            writer.RenderEndTag(); // end 'row'
        }
        /// <summary>
        /// Adds a new row to the Prevalue Editor, (with an optional description).
        /// </summary>
        /// <param name="writer">The HtmlTextWriter.</param>
        /// <param name="label">The label for the field.</param>
        /// <param name="description">The description for the field.</param>
        /// <param name="controls">The controls for the field.</param>
        public static void AddPrevalueRow(this HtmlTextWriter writer, string label, string description, params Control[] controls)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'row'

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "label");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'label'

            Label lbl = new Label() { Text = label };
            lbl.RenderControl(writer);

            writer.RenderEndTag(); // end 'label'

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "field");
            writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'field'

            foreach (Control control in controls)
            {
                control.RenderControl(writer);

            }

            writer.RenderEndTag(); // end 'field'

            if (!string.IsNullOrEmpty(description))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "description");
                writer.RenderBeginTag(HtmlTextWriterTag.Div); // start 'description'

                Label desc = new Label() { Text = description };
                desc.RenderControl(writer);

                writer.RenderEndTag(); // end 'description'
            }

            writer.RenderEndTag(); // end 'row'
        }
Пример #18
0
        public static void Populate(this ComboBox comboBox, System.Object[] items)
        {
            comboBox.Clear();
            // types of ListStore columns are taken from alValuesList
            ListStore listStore = new Gtk.ListStore(typeof(string));
            comboBox.Model = listStore;
            CellRendererText text = new CellRendererText();
            comboBox.PackStart(text, true);
            comboBox.AddAttribute(text, "text", 0);

            foreach (var item in items)
            {
                listStore.AppendValues(item.ToString());
            }
        }
Пример #19
0
 public static HtmlTextWriter AddOutput(this HtmlTextWriter writer, NunitGoTest nunitGoTest, string testOutput, string id = "")
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
     writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     if (nunitGoTest.HasOutput)
     {
         writer.RenderBeginTag(HtmlTextWriterTag.P);
         writer.AddTag(HtmlTextWriterTag.B, "Test output: ");
         writer.Write(NunitTestHtml.GenerateTxtView(testOutput));
         writer.RenderEndTag(); //P
     }
     else
     {
         writer.Write("Test output is empty");
     }
     writer.RenderEndTag();//DIV
     return writer;
 }
Пример #20
0
        public static HtmlTextWriter AddTestResult(this HtmlTextWriter writer, NunitGoTest nunitGoTest, string id = "")
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
            writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.AddTag(HtmlTextWriterTag.B, "Test full name: ");
            writer.Write(nunitGoTest.FullName);
            writer.RenderEndTag(); //P

            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.AddTag(HtmlTextWriterTag.B, "Test name: ");
            writer.Write(nunitGoTest.Name);
            writer.RenderEndTag(); //P

            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.AddTag(HtmlTextWriterTag.B, "Test duration: ");
            writer.Write(TimeSpan.FromSeconds(nunitGoTest.TestDuration).ToString(@"hh\:mm\:ss\:fff"));
            writer.RenderEndTag(); //P

            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.AddTag(HtmlTextWriterTag.B, "Time period: ");
            var start = nunitGoTest.DateTimeStart.ToString("dd.MM.yy HH:mm:ss.fff");
            var end = nunitGoTest.DateTimeFinish.ToString("dd.MM.yy HH:mm:ss.fff");
            writer.Write(start + " - " + end);
            writer.RenderEndTag(); //P

            writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, nunitGoTest.GetColor());
            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.RenderBeginTag(HtmlTextWriterTag.B);
            writer.Write("Test result: ");
            writer.RenderEndTag(); //B
            writer.Write(nunitGoTest.Result);
            writer.RenderEndTag(); //P

            writer.RenderEndTag(); //DIV
            return writer;
        }
Пример #21
0
 public static HtmlTextWriter AddFailure(this HtmlTextWriter writer, NunitGoTest nunitGoTest, string id = "")
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Id, id.Equals("") ? "table-cell" : id);
     writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "20px");
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     if (!nunitGoTest.IsSuccess())
     {
         writer.RenderBeginTag(HtmlTextWriterTag.P);
         writer.AddTag(HtmlTextWriterTag.B, "Message: ");
         writer.Write(NunitTestHtml.GenerateTxtView(nunitGoTest.TestMessage));
         writer.RenderEndTag(); //P
         writer.RenderBeginTag(HtmlTextWriterTag.P);
         writer.AddTag(HtmlTextWriterTag.B, "Stack trace: ");
         writer.Write(NunitTestHtml.GenerateTxtView(nunitGoTest.TestStackTrace));
         writer.RenderEndTag(); //P
     }
     else
     {
         writer.Write("Test was successful, there is no failure message");
     }
     writer.RenderEndTag();//DIV
     return writer;
 }
 public static TestElement WithAttribute(this TestElement testElement, string name, string value)
 {
     testElement.AddAttribute(new TestAttributeNode(name,value));
     return testElement;
 }
Пример #23
0
 public static void AddAttribute(this HtmlTextWriter writer, string key, Color value)
 {
     writer.AddAttribute(key, HexColor(value));
 }
Пример #24
0
 public static void AddAttribute(this HtmlTextWriter writer, string key, object value)
 {
     writer.AddAttribute(key, value.ToString());
 }
Пример #25
0
 /// <summary>
 /// 
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="node_"></param>
 /// <param name="value_"></param>
 public static void SaveValue(this XmlNode node_, object value_)
 {
     if (value_ != null)
     {
         string typeName = value_.GetType().AssemblyQualifiedName;
         int index = typeName.IndexOf(',', typeName.IndexOf(',') + 1);
         typeName = typeName.Substring(0, index);
         node_.AddAttribute("valueType", typeName);
         node_.InnerText = Convert.ToString(value_);
     }
     else
     {
         node_.AddAttribute("valueType", "null");
     }
 }
 public static HtmlTextWriter Attribute(this HtmlTextWriter writer, HtmlTextWriterAttribute attribute, string content = "")
 {
     writer.AddAttribute(attribute, content);
     return writer;
 }
Пример #27
0
 private static void WriteUrlLink(this HtmlTextWriter writer, string url, string displayValue)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Href, url);
     writer.AddAttribute(HtmlTextWriterAttribute.Target, "_blank");
     writer.RenderBeginTag(HtmlTextWriterTag.A);
     writer.Write(displayValue);
     writer.RenderEndTag();
 }
Пример #28
0
        // Adds a test-suite or test-case element, with result info
        private static void AddResult(this XmlNode parent, TestResult result, bool recursive)
        {
            var thisNode = parent.AddTest(result.Test, false);

            string status = GetTranslatedResultState(result.ResultState);

            var colon = status.IndexOf(':');
            string label = null;
            if (colon > 0)
            {
                label = status.Substring(colon + 1);
                status = status.Substring(0, colon);
            }

            thisNode.AddAttribute("result", status);
            if (label != null)
                thisNode.AddAttribute("label", label);

            // TODO: Check values are the same between V2 and V3
            if (result.FailureSite != FailureSite.Test)
                parent.AddAttribute("site", result.FailureSite.ToString());

            //start-time not available
            //end-time not available
            thisNode.AddAttribute("duration", result.Time.ToString("0.000000", NumberFormatInfo.InvariantInfo));

            if (result.Test.IsSuite)
            {
                // TODO: These values all should be calculated
                thisNode.AddAttribute("total", result.Test.TestCount.ToString());
                thisNode.AddAttribute("passed", "0");
                thisNode.AddAttribute("failed", "0");
                thisNode.AddAttribute("inconclusive", "0");
                thisNode.AddAttribute("skipped", "0");
            }
            thisNode.AddAttribute("asserts", result.AssertCount.ToString());

            if (status == "Failed")
                thisNode.AddFailureElement(result);
            else if (result.Message != null)
                thisNode.AddReasonElement(result);

            //OutputElement not available

            if (recursive && result.HasResults)
                foreach (TestResult child in result.Results)
                    thisNode.AddResult(child, recursive);
        }
Пример #29
0
 public static void AddKnockoutDataBind(this IHtmlWriter writer, string name, IEnumerable<KeyValuePair<string, IValueBinding>> expressions, DotvvmControl control, DotvvmProperty property)
 {
     writer.AddAttribute("data-bind", name + ": {" + String.Join(",", expressions.Select(e => "'" + e.Key + "': " + e.Value.GetKnockoutBindingExpression())) + "}", true, ", ");
 }
Пример #30
0
        /// <summary>
        /// Returns synthesis plan of a given design descriptor. If none exists, a new one gets created.
        /// </summary>
        /// <param name="dd">a design descriptor</param>
        /// <returns>the synthesis plan</returns>
        /// <remarks>The synthesis plan is attached as an attribute to the descriptor.</remarks>
        public static HLSPlan GetHLSPlan(this DesignDescriptor dd)
        {
            Contract.Requires<ArgumentNullException>(dd != null);

            var plan = dd.QueryAttribute<HLSPlan>();
            if (plan == null)
            {
                plan = HLSPlan.CreateDefaultPlan();
                dd.AddAttribute(plan);
            }
            return plan;
        }