当前位置: 首页>>代码示例>>C#>>正文


C# StringList类代码示例

本文整理汇总了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();
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:28,代码来源:PermissionLimit.cs

示例2: FolderSet

 private void FolderSet(StringList FldList)
 {
     for (int i = 0; i < FldList.Count; i++)
     {
         this.FolderAddSet(FldList[i]);
     }
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:7,代码来源:dlgFolderSetting.cs

示例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;
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:26,代码来源:FileDao.cs

示例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);
        }
开发者ID:TheByte,项目名称:sones,代码行数:13,代码来源:CommentTerminal.cs

示例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;
 }
开发者ID:juehv,项目名称:uscxml,代码行数:7,代码来源:CustomDataModel.cs

示例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);
        }
      }
    }
开发者ID:HydAu,项目名称:sitecore8ecommerce,代码行数:30,代码来源:ConfigureSecurity.cs

示例7: GetFirsts

 public override IList<string> GetFirsts()
 {
     var firsts = new StringList();
     foreach (var t in LineTerminators)
         firsts.Add(t.ToString());
     return firsts;
 }
开发者ID:HyperSharp,项目名称:Hyperspace.DotLua,代码行数:7,代码来源:NewLineTerminal.cs

示例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;
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:43,代码来源:ClientExtension.cs

示例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;
        }
开发者ID:lovethisgame,项目名称:SharpNL,代码行数:25,代码来源:DictionaryNameFinderEvaluatorTest.cs

示例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;
 }
开发者ID:yuanfei05,项目名称:vita,代码行数:27,代码来源:EntityMemberMask.cs

示例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));
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:32,代码来源:DirectoryReader.cs

示例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;
        }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:33,代码来源:DccCommand.cs

示例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;
 }
开发者ID:cg123,项目名称:xenko,代码行数:7,代码来源:LineContinuationTerminal.cs

示例14: HistoryUserListSet

 public void HistoryUserListSet(StringList uc)
 {
     if (uc.Count > 0)
     {
         this.txbUserCode.Text = uc[uc.Count - 1];
     }
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:7,代码来源:KioskUserCode.cs

示例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
 }
开发者ID:HyperSharp,项目名称:Hyperspace.DotLua,代码行数:8,代码来源:CommentTerminal.cs


注:本文中的StringList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。