/// <summary> /// 执行宏添加常引用指令 /// </summary> /// <param name="macroInstructionParameters"></param> /// <exception cref="FileNotFoundException"></exception> /// <exception cref="UnauthorizedAccessException"></exception> /// <exception cref="ConstQuoteNameAlreadyExistsException"></exception> private void ExecuteMacroAddConstQuote(List <string> macroInstructionParameters) { try { if (macroInstructionParameters.Count != 2) { throw new MacroFormatException(); } string constQuoteName = AConstQuote.ConstQuoteNamePull(macroInstructionParameters[0]); AConstQuote.Add(constQuoteName, macroInstructionParameters[1]); } catch (Exception) { throw; } }
/// <summary> /// 执行宏删除常引用指令 /// </summary> /// <param name="delConstQuoteName"></param> private void ExecuteMacroDelConstQuote(string delConstQuoteName) { AConstQuote.Delete(AConstQuote.ConstQuoteNamePull(delConstQuoteName)); }
public void ConstQuoteNamePullTest(string nameMayWithStuffix, string excepted) { Assert.AreEqual(excepted, AConstQuote.ConstQuoteNamePull(nameMayWithStuffix)); }