Beispiel #1
0
        /// <summary>
        /// Least lazy SelectOption
        /// Provides the very best way to add options you want to use for AssemblyLinker. If option needs to have extra info provided, put it into extraInfo.
        /// SelectOptions allows you to place options at four places:
        ///     Start of options before name of the compiled file (Position.PRESTART)
        ///     End of options before name of the compiled file (Position.PRE)
        ///     Start of options after name of the compiled file (Position.POSTSTART)
        ///     End of options after name of the compiled file (Position.POST)
        /// NOTE: When adding options with extra info required, don't add the '='. SelectOption already adds it itself.
        /// </summary>
        /// <param name="option"></param>
        /// <param name="extraInfo"></param>
        /// <param name="pos"></param>
        public static void SelectOption(AssemblyLinker option, string extraInfo, Position pos)
        {
            if (Enum.IsDefined(typeof(AssemblyLinkerExtra), option) && String.IsNullOrEmpty(extraInfo))
            {
                Exceptions.Exception(14);
                return;
            }

            if (Enum.IsDefined(typeof(AssemblyLinkerExtra), option))
            {
                switch (pos)
                {
                case Position.PRESTART:
                    PreOptions.Insert(0, Options[option] + EquationChar + extraInfo);
                    break;

                case Position.PRE:
                    PreOptions.Add(Options[option] + EquationChar + extraInfo);
                    break;

                case Position.POSTSTART:
                    PostOptions.Insert(0, Options[option] + EquationChar + extraInfo);
                    break;

                case Position.POST:
                    PostOptions.Add(Options[option] + EquationChar + extraInfo);
                    break;
                }
            }
            else
            {
                switch (pos)
                {
                case Position.PRESTART:
                    PreOptions.Insert(0, Options[option]);
                    break;

                case Position.PRE:
                    PreOptions.Add(Options[option]);
                    break;

                case Position.POSTSTART:
                    PostOptions.Insert(0, Options[option]);
                    break;

                case Position.POST:
                    PostOptions.Add(Options[option]);
                    break;
                }
            }
        }
 public static AssemblyLinkerAddResult Add(AssemblyLinker option, string optionText)
 {
     try
     {
         if (!Options.ContainsKey(option))
         {
             Options.Add(option, optionText);
             return AssemblyLinkerAddResult.SUCCESS;
         }
         else
         {
             return AssemblyLinkerAddResult.EXISTS;
         }
     }
     catch
     {
         return AssemblyLinkerAddResult.FAIL;
     }
 }
Beispiel #3
0
 public static AssemblyLinkerAddResult Add(AssemblyLinker option, string optionText)
 {
     try
     {
         if (!Options.ContainsKey(option))
         {
             Options.Add(option, optionText);
             return(AssemblyLinkerAddResult.SUCCESS);
         }
         else
         {
             return(AssemblyLinkerAddResult.EXISTS);
         }
     }
     catch
     {
         return(AssemblyLinkerAddResult.FAIL);
     }
 }
 public static AssemblyLinkerAddResult Add(AssemblyLinker option, string optionText, bool overwriteExisting)
 {
     try
     {
         if (!Options.ContainsKey(option))
         {
             Options.Add(option, optionText);
             return AssemblyLinkerAddResult.SUCCESS;
         }
         else
         {
             if (overwriteExisting)
             {
                 return AssemblyLinkerAddResult.OVERWRITE;
             }
             return AssemblyLinkerAddResult.EXISTS;
         }
     }
     catch
     {
         return AssemblyLinkerAddResult.FAIL;
     }
 }
Beispiel #5
0
 public static AssemblyLinkerAddResult Add(AssemblyLinker option, string optionText, bool overwriteExisting)
 {
     try
     {
         if (!Options.ContainsKey(option))
         {
             Options.Add(option, optionText);
             return(AssemblyLinkerAddResult.SUCCESS);
         }
         else
         {
             if (overwriteExisting)
             {
                 return(AssemblyLinkerAddResult.OVERWRITE);
             }
             return(AssemblyLinkerAddResult.EXISTS);
         }
     }
     catch
     {
         return(AssemblyLinkerAddResult.FAIL);
     }
 }
        /// <summary>
        /// Least lazy SelectOption
        /// Provides the very best way to add options you want to use for AssemblyLinker. If option needs to have extra info provided, put it into extraInfo. 
        /// SelectOptions allows you to place options at four places:
        ///     Start of options before name of the compiled file (Position.PRESTART)
        ///     End of options before name of the compiled file (Position.PRE)
        ///     Start of options after name of the compiled file (Position.POSTSTART)
        ///     End of options after name of the compiled file (Position.POST)     
        /// NOTE: When adding options with extra info required, don't add the '='. SelectOption already adds it itself.
        /// </summary>
        /// <param name="option"></param>
        /// <param name="extraInfo"></param>
        /// <param name="pos"></param>
        public static void SelectOption(AssemblyLinker option, string extraInfo, Position pos)
        {
            if (Enum.IsDefined(typeof(AssemblyLinkerExtra), option) && String.IsNullOrEmpty(extraInfo))
            {
                Exceptions.Exception(14);
                return;
            }

            if (Enum.IsDefined(typeof(AssemblyLinkerExtra), option))
            {
                switch (pos)
                {
                    case Position.PRESTART:
                        PreOptions.Insert(0, Options[option] + EquationChar + extraInfo);
                        break;
                    case Position.PRE:
                        PreOptions.Add(Options[option] + EquationChar + extraInfo);
                        break;
                    case Position.POSTSTART:
                        PostOptions.Insert(0, Options[option] + EquationChar + extraInfo);
                        break;
                    case Position.POST:
                        PostOptions.Add(Options[option] + EquationChar + extraInfo);
                        break;
                }
            }
            else
            {
                switch (pos)
                {
                    case Position.PRESTART:
                        PreOptions.Insert(0, Options[option]);
                        break;
                    case Position.PRE:
                        PreOptions.Add(Options[option]);
                        break;
                    case Position.POSTSTART:
                        PostOptions.Insert(0, Options[option]);
                        break;
                    case Position.POST:
                        PostOptions.Add(Options[option]);
                        break;
                }
            }
        }
 /// <summary>
 /// Moderately lazy SelectOption
 /// </summary>
 /// <param name="option"> Option you want to add </param>
 /// <param name="extraInfo"> Extra information needed to be provided too ILasmExtra Options </param>
 public static void SelectOption(AssemblyLinker option, string extraInfo)
 {
     SelectOption(option, extraInfo, Position.PRE);
 }
 /// <summary>
 /// Laziest SelectOption
 /// </summary>
 /// <param name="option"> Option you want to add </param>
 public static void SelectOption(AssemblyLinker option)
 {
     SelectOption(option, null);
 }
Beispiel #9
0
 /// <summary>
 /// Moderately lazy SelectOption
 /// </summary>
 /// <param name="option"> Option you want to add </param>
 /// <param name="extraInfo"> Extra information needed to be provided too ILasmExtra Options </param>
 public static void SelectOption(AssemblyLinker option, string extraInfo)
 {
     SelectOption(option, extraInfo, Position.PRE);
 }
Beispiel #10
0
 /// <summary>
 /// Laziest SelectOption
 /// </summary>
 /// <param name="option"> Option you want to add </param>
 public static void SelectOption(AssemblyLinker option)
 {
     SelectOption(option, null);
 }