本文整理汇总了C#中StringList.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# StringList.AddRange方法的具体用法?C# StringList.AddRange怎么用?C# StringList.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringList
的用法示例。
在下文中一共展示了StringList.AddRange方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFirsts
public override IList<string> GetFirsts()
{
StringList result = new StringList();
result.AddRange(Prefixes);
//we assume that prefix is always optional, so string can start with start-end symbol
result.AddRange(_startEndSymbols);
return result;
}
示例2: GetFirsts
public override IList<string> GetFirsts()
{
StringList result = new StringList();
result.AddRange(base.Prefixes);
//we assume that prefix is always optional, so number can always start with plain digit
result.AddRange(new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" });
// Python float numbers can start with a dot
if (IsSet(TermOptions.NumberAllowStartEndDot))
result.Add(DecimalSeparator.ToString());
return result;
}
示例3: Compute
/// <summary>
/// Called when the component should do it's actual work.
/// </summary>
public override void Compute()
{
//validate config
if (config.Directory == null)
{
throw new ComponentException("Directory has not been specified.");
}
if (Directory.Exists(config.Directory) == false)
{
throw new ComponentException(String.Format("Directory does not exist '{0}'.", config.Directory.Absolute));
}
string[] files;
if (String.IsNullOrEmpty(config.SearchPattern) == true)
{
files = Directory.GetFiles(config.Directory, "*", TranslateSearchOption(config.SearchOption));
}
else
{
files = Directory.GetFiles(config.Directory, config.SearchPattern, TranslateSearchOption(config.SearchOption));
}
StringList listOfFiles = new StringList();
listOfFiles.AddRange(files);
Workspace.Store("files", listOfFiles);
Workspace.Store("numberOfFiles", listOfFiles.Count);
Logger.Trace(String.Format("Found {0} files in the given directory that match given search pattern.", listOfFiles.Count));
}
示例4: CommentTerminal
private bool _isLineComment; //true if NewLine is one of EndSymbols; if yes, EOF is also considered a valid end symbol
#endregion Fields
#region Constructors
public CommentTerminal(String name, string startSymbol, params string[] endSymbols)
: base(name, TokenCategory.Comment)
{
this.StartSymbol = startSymbol;
this.EndSymbols = new StringList();
EndSymbols.AddRange(endSymbols);
}
示例5: LineContinuationTerminal
public LineContinuationTerminal(string name, params string[] startSymbols) : base(name, TokenCategory.Outline) {
var symbols = startSymbols.Where(s => !IsNullOrWhiteSpace(s)).ToArray();
StartSymbols = new StringList(symbols);
if (StartSymbols.Count == 0)
StartSymbols.AddRange(_defaultStartSymbols);
Priority = Terminal.HighestPriority;
}
示例6: CommentTerminal
public CommentTerminal(string name, string startSymbol, params string[] endSymbols)
: base(name, TokenCategory.Comment)
{
StartSymbol = startSymbol;
EndSymbols = new StringList();
EndSymbols.AddRange(endSymbols);
Priority = TerminalPriority.High; //assign max priority
}
示例7: CustomViewEngine
/// <summary>
/// Constructor
/// </summary>
public CustomViewEngine(params string[] additionalLocations)
{
StringList viewLocations = new StringList();
viewLocations.Add("~/Views/{1}/{0}.cshtml");
viewLocations.Add("~/Views/Shared/{0}.cshtml");
viewLocations.AddRange(additionalLocations);
this.PartialViewLocationFormats = viewLocations.ToArray();
this.ViewLocationFormats = viewLocations.ToArray();
}
示例8: GetFirsts
}//constructor
public override IList<string> GetFirsts() {
var result = new StringList();
result.AddRange(Firsts);
return result;
}
示例9: RunCommand
private void RunCommand(ClientPipelineArgs args)
{
string commandname = args.Parameters["name"];
var sl = new StringList();
sl.AddRange(ItemList.SelectedItems.Select(item => item.Value));
if (sl.Count > 0)
{
Current.Context.ReportItem.RunCommand(commandname, sl);
}
else
{
SheerResponse.Alert("You need to select at least one item");
}
}
示例10: ReflectionUtilConvertToListTest
public void ReflectionUtilConvertToListTest()
{
StringList stringData = new StringList();
stringData.AddRange("One", "Two", "Three");
List<string> updatedList = ReflectionUtil<string>.ConvertToList(new List<string>(stringData.ToArray()));
Assert.IsNotNull(updatedList);
Assert.AreEqual(stringData[0], updatedList[0]);
Assert.AreEqual(stringData[1], updatedList[1]);
Assert.AreEqual(stringData[2], updatedList[2]);
}
示例11: GetFirsts
public override IList<string> GetFirsts()
{
StringList result = new StringList();
result.AddRange(base.Prefixes);
//we assume that prefix is always optional, so number can always start with plain digit
result.AddRange(new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" });
return result;
}