Builder.Common.Builder.ExpandMacros C# (CSharp) Méthode

ExpandMacros() public méthode

public ExpandMacros ( string input ) : string
input string
Résultat string
        public string ExpandMacros(string input)
        {
            string sExpanded = input;
             bool bFound = true;

             ArrayList oMacros = Macros;

             while (bFound)
             {
            bFound = false;

            for (int i = 0; i < oMacros.Count; i++)
            {
               Macro oMacro = (Macro)oMacros[i];
               if (sExpanded.IndexOf(oMacro.Name) >= 0)
               {
                  bFound = true;
                  sExpanded = sExpanded.Replace(oMacro.Name, oMacro.Value);
               }
            }
             }

             return sExpanded;
        }

Usage Example

Exemple #1
0
        public bool ValidateSettings(Builder builder, out string result)
        {
            if (!File.Exists(builder.ExpandMacros(VSPath)))
            {
                result = "The Visual Studio executable does not exist in the specified path\r\n";
                return(false);
            }

            if (!File.Exists(builder.ExpandMacros(InnoSetupPath)))
            {
                result = "The InnoSetup executable does not exist in the specified path\r\n";
                return(false);
            }

            if (!Directory.Exists(builder.ExpandMacros(SourcePath)))
            {
                result = "The hMailserver source code does not exist in the specified path\r\n";
                return(false);
            }

            result = "";
            return(true);
        }
All Usage Examples Of Builder.Common.Builder::ExpandMacros