本文整理汇总了C#中StringList类的典型用法代码示例。如果您正苦于以下问题:C# StringList类的具体用法?C# StringList怎么用?C# StringList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringList类属于命名空间,在下文中一共展示了StringList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
public string GetValue()
{
StringTable table = new StringTable();
//table.Add("LimitType", LimitType.ToString());
table.Add("LimitType", ((byte)LimitType).ToString());
foreach (KeyValuePair<Guid, List<Guid>> item in ExcludeRoles)
{
if (item.Value != null)
{
StringList roles = new StringList();
foreach (Guid roleID in item.Value)
{
roles.Add(roleID.ToString());
}
table.Add("ExcludeRoles-" + item.Key.ToString("N"), roles.ToString());
}
}
return table.ToString();
}
示例2: FolderSet
private void FolderSet(StringList FldList)
{
for (int i = 0; i < FldList.Count; i++)
{
this.FolderAddSet(FldList[i]);
}
}
示例3: CreateTempUploadFile
public override int CreateTempUploadFile(int userID, string uploadAction, string searchInfo, StringList customParamList, string filename, string serverFileName, string md5, long fileSize, string fileID)
{
int tempUploadFileID;
using (SqlQuery query = new SqlQuery())
{
query.CommandType = CommandType.StoredProcedure;
query.CommandText = "bx_CreateTempUploadFile";
query.CreateParameter<int>("@UserID", userID, SqlDbType.Int);
query.CreateParameter<string>("@UploadAction", uploadAction, SqlDbType.VarChar, 100);
query.CreateParameter<string>("@SearchInfo", searchInfo, SqlDbType.NVarChar, 100);
query.CreateParameter<string>("@CustomParams", customParamList.ToString(), SqlDbType.NVarChar, 3000);
query.CreateParameter<string>("@FileName", filename, SqlDbType.NVarChar, 256);
query.CreateParameter<string>("@ServerFileName", serverFileName, SqlDbType.VarChar, 100);
query.CreateParameter<string>("@MD5", md5, SqlDbType.Char, 32);
query.CreateParameter<long>("@FileSize", fileSize, SqlDbType.Int);
query.CreateParameter<string>("@FileID", fileID, SqlDbType.VarChar, 50);
SqlParameter returnParam = query.CreateParameter<int>("@TempUploadFileID", SqlDbType.Int, ParameterDirection.Output);
query.ExecuteNonQuery();
tempUploadFileID = (int)returnParam.Value;
}
return tempUploadFileID;
}
示例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: getNames
public override StringList getNames()
{
// name of this datamodel to be used in scxml element
StringList names = new StringList();
names.add("simple");
return names;
}
示例6: Process
/// <summary>
/// Runs the processor.
/// </summary>
/// <param name="args">The arguments.</param>
public virtual void Process(PipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
User user = args.CustomData["user"] as User;
if (user == null)
{
Log.Error("The user is null", this);
return;
}
GeneralSettings generalSettings = Context.Entity.GetConfiguration<GeneralSettings>();
StringList roles = new StringList(generalSettings.DefaultCustomerRoles);
foreach (string role in roles)
{
if (Roles.RoleExists(role))
{
user.Roles.Add(Role.FromName(role));
}
else
{
Log.Warn(string.Format("Role: '{0}' does not exist", role), this);
}
}
}
示例7: GetFirsts
public override IList<string> GetFirsts()
{
var firsts = new StringList();
foreach (var t in LineTerminators)
firsts.Add(t.ToString());
return firsts;
}
示例8: ClientExtension
/// <summary>
/// Initializes a new instance of the <see cref="ClientExtension"/> class.
/// </summary>
/// <param name="type">Extension type</param>
/// <param name="scope">Extension install scope</param>
/// <param name="manifestStream">Manifest stream, can be null</param>
/// <param name="marketplaceAssetID">The asset ID for Office Marketplace</param>
/// <param name="marketplaceContentMarket">The content market for Office Marketplace</param>
/// <param name="isAvailable">Whether extension is available</param>
/// <param name="isMandatory">Whether extension is mandatory</param>
/// <param name="isEnabledByDefault">Whether extension is enabled by default</param>
/// <param name="providedTo">Who the extension is provided for (e.g. "entire org" or "specific users")</param>
/// <param name="specificUsers">List of users extension is provided for, can be null</param>
/// <param name="appStatus">App status</param>
/// <param name="etoken">Etoken</param>
public ClientExtension(
ExtensionType type,
ExtensionInstallScope scope,
Stream manifestStream,
string marketplaceAssetID,
string marketplaceContentMarket,
bool isAvailable,
bool isMandatory,
bool isEnabledByDefault,
ClientExtensionProvidedTo providedTo,
StringList specificUsers,
string appStatus,
string etoken)
: this()
{
this.Type = type;
this.Scope = scope;
this.ManifestStream = manifestStream;
this.MarketplaceAssetID = marketplaceAssetID;
this.MarketplaceContentMarket = marketplaceContentMarket;
this.IsAvailable = isAvailable;
this.IsMandatory = isMandatory;
this.IsEnabledByDefault = isEnabledByDefault;
this.ProvidedTo = providedTo;
this.SpecificUsers = specificUsers;
this.AppStatus = appStatus;
this.Etoken = etoken;
}
示例9: CreateDictionary
private static SharpNL.Dictionary.Dictionary CreateDictionary() {
var sampleStream = CreateSample();
var sample = sampleStream.Read();
var entries = new List<string[]>();
while (sample != null) {
Span[] names = sample.Names;
if (names != null && names.Length > 0) {
var toks = sample.Sentence;
foreach (Span name in names) {
var nameToks = new string[name.Length];
Array.Copy(toks, name.Start, nameToks, 0, name.Length);
entries.Add(nameToks);
}
}
sample = sampleStream.Read();
}
sampleStream.Dispose();
var dictionary = new SharpNL.Dictionary.Dictionary(true);
foreach (var entry in entries) {
var dicEntry = new StringList(entry);
dictionary.Add(dicEntry);
}
return dictionary;
}
示例10: Create
public static EntityMemberMask Create(EntityInfo entity, string propertiesOrGroups)
{
var invalidNames = new StringList();
var mask = new EntityMemberMask(propertiesOrGroups, entity);
var props = propertiesOrGroups.SplitNames(',', ';');
foreach (var name in props) {
//first try member
if (string.IsNullOrWhiteSpace(name))
continue;
var grp = entity.GetPropertyGroup(name);
if (grp != null) {
foreach (var m in grp.Members)
mask.Set(m);
continue;
}
var member = entity.GetMember(name);
if (member != null) {
mask.Set(member);
continue;
}
//name is invalid
invalidNames.Add(name);
}
if (invalidNames.Count > 0)
Util.Throw("Properties/subgroups [{0}] not found in entity {1}.", string.Join(",", invalidNames), entity.EntityType);
return mask;
}
示例11: 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));
}
示例12: Execute
public override ReturnCode Execute(
Interpreter interpreter,
IClientData clientData,
ArgumentList arguments,
ref Result result
)
{
if ((arguments == null) || (arguments.Count < 2))
{
result = Utility.WrongNumberOfArguments(
this, 1, arguments, "command");
return ReturnCode.Error;
}
try
{
var processor = new CommandLineProcessor();
var o = processor.Pharse(arguments.Select(argument => (string) argument).Skip(1).ToArray());
if (!(o is string) && o is IEnumerable)
result = new StringList(o);
else
{
result = o == null ? "" : new Variant(o).ToString();
}
}
catch (Exception exception)
{
Log.Error("Script error ", exception);
result = "Error on command execution " + exception.Message;
}
return ReturnCode.Ok;
}
示例13: 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;
}
示例14: HistoryUserListSet
public void HistoryUserListSet(StringList uc)
{
if (uc.Count > 0)
{
this.txbUserCode.Text = uc[uc.Count - 1];
}
}
示例15: 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
}