Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set ConfigSource of default holder to "Default" instead of "AppConfig"
- Loading branch information
1 parent
c34b5fc
commit fb1717e
Showing
1 changed file
with
40 additions
and
39 deletions.
There are no files selected for viewing
79 changes: 40 additions & 39 deletions
79
TechTalk.SpecFlow.Generator/Interfaces/SpecFlowConfigurationHolder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,41 @@ | ||
using System; | ||
using System.Xml; | ||
using TechTalk.SpecFlow.Configuration; | ||
|
||
namespace TechTalk.SpecFlow.Generator.Interfaces | ||
{ | ||
/// IMPORTANT | ||
/// This class is used for interop with the Visual Studio Extension | ||
/// DO NOT REMOVE OR RENAME FIELDS! | ||
/// This breaks binary serialization accross appdomains | ||
[Serializable] | ||
public class SpecFlowConfigurationHolder : ISpecFlowConfigurationHolder | ||
{ | ||
private readonly string xmlString; | ||
|
||
public ConfigSource ConfigSource { get; private set; } | ||
|
||
public string Content => xmlString; | ||
|
||
public bool HasConfiguration => !string.IsNullOrEmpty(xmlString); | ||
|
||
public SpecFlowConfigurationHolder() | ||
{ | ||
xmlString = null; | ||
} | ||
|
||
public SpecFlowConfigurationHolder(ConfigSource configSource, string content) | ||
{ | ||
ConfigSource = configSource; | ||
xmlString = content; | ||
} | ||
|
||
public SpecFlowConfigurationHolder(XmlNode configXmlNode) | ||
{ | ||
xmlString = configXmlNode?.OuterXml; | ||
ConfigSource = ConfigSource.AppConfig; | ||
} | ||
} | ||
|
||
using System; | ||
using System.Xml; | ||
using TechTalk.SpecFlow.Configuration; | ||
|
||
namespace TechTalk.SpecFlow.Generator.Interfaces | ||
{ | ||
/// IMPORTANT | ||
/// This class is used for interop with the Visual Studio Extension | ||
/// DO NOT REMOVE OR RENAME FIELDS! | ||
/// This breaks binary serialization accross appdomains | ||
[Serializable] | ||
public class SpecFlowConfigurationHolder : ISpecFlowConfigurationHolder | ||
{ | ||
private readonly string xmlString; | ||
|
||
public ConfigSource ConfigSource { get; } | ||
|
||
public string Content => xmlString; | ||
|
||
public bool HasConfiguration => !string.IsNullOrEmpty(xmlString); | ||
|
||
public SpecFlowConfigurationHolder() | ||
{ | ||
ConfigSource = ConfigSource.Default; | ||
xmlString = null; | ||
} | ||
|
||
public SpecFlowConfigurationHolder(ConfigSource configSource, string content) | ||
{ | ||
ConfigSource = configSource; | ||
xmlString = content; | ||
} | ||
|
||
public SpecFlowConfigurationHolder(XmlNode configXmlNode) | ||
{ | ||
xmlString = configXmlNode?.OuterXml; | ||
ConfigSource = ConfigSource.AppConfig; | ||
} | ||
} | ||
|
||
} |