VsTeXProject.VisualStudio.Project.ProjectConfig.TrySplitConfigurationCanonicalName C# (CSharp) Méthode

TrySplitConfigurationCanonicalName() static private méthode

Splits the canonical configuration name into platform and configuration name.
static private TrySplitConfigurationCanonicalName ( string canonicalName, string &configName, string &platformName ) : bool
canonicalName string The canonicalName name.
configName string The name of the configuration.
platformName string The name of the platform.
Résultat bool
        internal static bool TrySplitConfigurationCanonicalName(string canonicalName, out string configName,
            out string platformName)
        {
            configName = string.Empty;
            platformName = string.Empty;

            if (string.IsNullOrEmpty(canonicalName))
            {
                return false;
            }

            var splittedCanonicalName = canonicalName.Split(new[] {'|'}, StringSplitOptions.RemoveEmptyEntries);

            if (splittedCanonicalName == null ||
                (splittedCanonicalName.Length != 1 && splittedCanonicalName.Length != 2))
            {
                return false;
            }

            configName = splittedCanonicalName[0];
            if (splittedCanonicalName.Length == 2)
            {
                platformName = splittedCanonicalName[1];
            }

            return true;
        }