Skip to content

Code Formatting issue #2417

@kyle0418

Description

@kyle0418

There is a formatting issue in the document: HtmlElementInsertionOrientation Enum

if (webBrowser1.Document != null) 
{
	HtmlDocument doc = webBrowser1.Document;

          // Do not insert the warning again if it already exists. 
          HtmlElementCollection returnedElems = doc.All.GetElementsByName("ADatumWarningDiv");
          if ((returnedElems != null) && (returnedElems.Count > 0)) 
	{
              return;
	}

          HtmlElement divElem = doc.CreateElement("DIV");
          divElem.Name = "ADatumWarningDiv";
          divElem.Style = "background-color:black;color:white;font-weight:bold;width:100%;";
          divElem.InnerText = message;

          divElem = doc.Body.InsertAdjacentElement(HtmlElementInsertionOrientation.AfterBegin, divElem);
}

Should be like this:

if (webBrowser1.Document != null)
{
    HtmlDocument doc = webBrowser1.Document;

    // Do not insert the warning again if it already exists. 
    HtmlElementCollection returnedElems = doc.All.GetElementsByName("ADatumWarningDiv");
    if ((returnedElems != null) && (returnedElems.Count > 0))
    {
        return;
    }

    HtmlElement divElem = doc.CreateElement("DIV");
    divElem.Name = "ADatumWarningDiv";
    divElem.Style = "background-color:black;color:white;font-weight:bold;width:100%;";
    divElem.InnerText = message;

    divElem = doc.Body.InsertAdjacentElement(HtmlElementInsertionOrientation.AfterBegin, divElem);
}

Please check and modify it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    easyIssue should be easy to implement, good for first-time contributorshelp wantedGood for community contributors to help [up-for-grabs]

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions