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


C# IList.IsEmpty方法代码示例

本文整理汇总了C#中IList.IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# IList.IsEmpty方法的具体用法?C# IList.IsEmpty怎么用?C# IList.IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IList的用法示例。


在下文中一共展示了IList.IsEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteEntities

 /// <summary>
 /// Elimina entidades (usuarios o grupos) a la regla con el id especificado
 /// </summary>
 /// <param name="rule"></param>
 /// <param name="entities"></param>
 public static IObservable<Rule> DeleteEntities(Rule rule, IList<IEntity> entities)
 {
     if (rule.Id == null) throw new InvalidDataException("The provided rule must have an Id");
     if (entities == null || entities.IsEmpty())
         return Observable.Defer(() => Observable.Return(rule));
     return RestEndpointFactory
         .Create<IRulesEndpoint>(SessionManager.Instance.CurrentLoggedUser)
         .DeleteEntities(rule.Id, entities.IsEmpty()
             ? "0"
             : entities.ToString(e => e.Id)).ToObservable()
         .SubscribeOn(ThreadPoolScheduler.Instance)
         .InterpretingErrors();
 }
开发者ID:diegoRodriguezAguila,项目名称:SGAM.Elfec.Admin,代码行数:18,代码来源:RulesManager.cs

示例2: InitializeTiles

        /// <summary>
        /// Dient eenmalig uitgevoerd te worden
        /// </summary>
        private void InitializeTiles(ISessionFactory factory)
        {
            Random random = new Random();
            int result = 0;
            var nhSession = factory.OpenSession();

            MapTiles = nhSession.QueryOver<MapTile>().List();
            if (MapTiles.IsEmpty())
            {
                MapTiles = new List<MapTile>();
                using (var transaction = nhSession.BeginTransaction())
                {
                    for (int x = 0; x < 8; x++)
                    {
                        for (int y = 0; y < 8; y++)
                        {
                            result = random.Next(0, 10);
                            var tile = new MapTile() {Name = "Wasteland", X = x, Y = y};
                            MapTiles.Add(tile);
                            nhSession.Save(tile);
                        }
                    }

                    transaction.Commit();
                }
            }
        }
开发者ID:Rawne,项目名称:laststand,代码行数:30,代码来源:MapTileFactory.cs

示例3: IndexHint

 public IndexHint(IndexHintAction hintAction,
                  IndexHintType hintType,
                  IndexHintScope hintScope,
                  IList<string> indexList)
 {
     if (hintAction == IndexHintAction.None)
     {
         throw new ArgumentException("index hint hintAction is null");
     }
     if (hintType == IndexHintType.None)
     {
         throw new ArgumentException("index hint hintType is null");
     }
     if (hintScope == IndexHintScope.None)
     {
         throw new ArgumentException("index hint hintScope is null");
     }
     HintAction = hintAction;
     IndexType = hintType;
     HintScope = hintScope;
     if (indexList == null || indexList.IsEmpty())
     {
         IndexList = new List<string>(0);
     }
     else if (indexList is List<string>)
     {
         IndexList = indexList;
     }
     else
     {
         IndexList = new List<string>(indexList);
     }
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:33,代码来源:IndexHint.cs

示例4: SignatureHelpItems

        public SignatureHelpItems(
            IList<SignatureHelpItem> items,
            TextSpan applicableSpan,
            int argumentIndex,
            int argumentCount,
            string argumentName,
            int? selectedItem = null)
        {
            Contract.ThrowIfNull(items);
            Contract.ThrowIfTrue(items.IsEmpty());
            Contract.ThrowIfTrue(selectedItem.HasValue && selectedItem.Value > items.Count);

            if (argumentIndex < 0)
            {
                throw new ArgumentException($"{nameof(argumentIndex)} < 0", nameof(argumentIndex));
            }

            if (argumentCount < argumentIndex)
            {
                throw new ArgumentException($"{nameof(argumentCount)} < {nameof(argumentIndex)}", nameof(argumentIndex));
            }

            this.Items = items;
            this.ApplicableSpan = applicableSpan;
            this.ArgumentIndex = argumentIndex;
            this.ArgumentCount = argumentCount;
            this.SelectedItemIndex = selectedItem;
            this.ArgumentName = argumentName;
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:29,代码来源:SignatureHelpItems.cs

示例5: GroupConcat

        public GroupConcat(bool distinct,
                           IList<IExpression> exprList,
                           IExpression orderBy,
                           bool isDesc,
                           IList<IExpression> appendedColumnNames,
                           string separator)
            : base("GROUP_CONCAT", exprList)
        {
            IsDistinct = distinct;
            OrderBy = orderBy;
            IsDesc = isDesc;
            if (appendedColumnNames == null || appendedColumnNames.IsEmpty())
            {
                AppendedColumnNames = new List<IExpression>(0);
            }
            else if (appendedColumnNames is List<IExpression>)
            {
                AppendedColumnNames = appendedColumnNames;
            }
            else
            {
                AppendedColumnNames = new List<IExpression>(
                    appendedColumnNames);
            }

            Separator = separator ?? ",";
        }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:27,代码来源:GroupConcat.cs

示例6: TableReferences

 /// <exception cref="System.SqlSyntaxErrorException" />
 public TableReferences(IList<TableReference> list)
 {
     if (list == null || list.IsEmpty())
     {
         throw new SqlSyntaxErrorException("at least one table reference");
     }
     _list = EnsureListType(list);
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:9,代码来源:TableReferences.cs

示例7: CommentColumns

        public ActionResult CommentColumns(string id, IList<Column> columns)
        {
            if (!columns.IsEmpty())
            {
                foreach (var item in columns)
                {
                    this.DynamicQuery.Provider.DbMetadata.CommentColumn(id, item.Name, item.Description);
                }
            }

            return CloseDialogWithAlert("修改成功!");
        }
开发者ID:fenglinz,项目名称:Sparrow,代码行数:12,代码来源:ConfigurationController.cs

示例8: IndexDefinition

        public IndexDefinition(IndexType indexType,
                               IList<IndexColumnName> columns,
                               IList<IndexOption> options)
        {
            IndexType = indexType;
            if (columns == null || columns.IsEmpty())
            {
                throw new ArgumentException("columns is null or empty");
            }

            Columns = columns;
            Options = options == null || options.IsEmpty() ? new List<IndexOption>(0) : options;
        }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:13,代码来源:IndexDefinition.cs

示例9: TableRuleConfig

 public TableRuleConfig(string name, IList<RuleConfig> rules)
 {
     if (name == null)
     {
         throw new ArgumentException("name is null");
     }
     this.name = name;
     if (rules == null || rules.IsEmpty())
     {
         throw new ArgumentException("no rule is found");
     }
     this.rules = new List<RuleConfig>(rules).AsReadOnly();
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:13,代码来源:TableRuleConfig.cs

示例10: DalSetStatement

 public DalSetStatement(IList<Pair<VariableExpression, IExpression>> assignmentList)
 {
     if (assignmentList == null || assignmentList.IsEmpty())
     {
         AssignmentList = new List<Pair<VariableExpression, IExpression>>(0);
     }
     else if (assignmentList is List<Pair<VariableExpression, IExpression>>)
     {
         AssignmentList = assignmentList;
     }
     else
     {
         AssignmentList = new List<Pair<VariableExpression, IExpression>>(assignmentList);
     }
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:15,代码来源:DALSetStatement.cs

示例11: FunctionExpression

 public FunctionExpression(string functionName, IList<IExpression> arguments)
 {
     this.functionName = functionName;
     if (arguments == null || arguments.IsEmpty())
     {
         this.arguments = new List<IExpression>(0);
     }
     else if (arguments is List<IExpression>)
     {
         this.arguments = arguments;
     }
     else
     {
         this.arguments = new List<IExpression>(arguments);
     }
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:16,代码来源:FunctionExpression.cs

示例12: SignatureHelpItems

        public SignatureHelpItems(
            IList<SignatureHelpItem> items,
            TextSpan applicableSpan,
            int argumentIndex,
            int argumentCount,
            string argumentName,
            int? selectedItem = null)
        {
            Contract.ThrowIfNull(items);
            Contract.ThrowIfTrue(items.IsEmpty());
            Contract.ThrowIfTrue(selectedItem.HasValue && selectedItem.Value >= items.Count);

            if (argumentIndex < 0)
            {
                throw new ArgumentException($"{nameof(argumentIndex)} < 0. {argumentIndex} < 0", nameof(argumentIndex));
            }

            if (argumentCount < argumentIndex)
            {
                throw new ArgumentException($"{nameof(argumentCount)} < {nameof(argumentIndex)}. {argumentCount} < {argumentIndex}", nameof(argumentIndex));
            }

            // Adjust the `selectedItem` index if duplicates are able to be removed.
            var distinctItems = items.Distinct().ToList();
            if (selectedItem.HasValue && items.Count != distinctItems.Count)
            {
                // `selectedItem` index has already been determined to be valid, it now needs to be adjusted to point
                // to the equivalent item in the reduced list to account for duplicates being removed
                // E.g.,
                //   items = {A, A, B, B, C, D}
                //   selectedItem = 4 (index for item C)
                // ergo
                //   distinctItems = {A, B, C, D}
                //   actualItem = C
                //   selectedItem = 2 (index for item C)
                var actualItem = items[selectedItem.Value];
                selectedItem = distinctItems.IndexOf(actualItem);
                Debug.Assert(selectedItem.Value >= 0, "actual item was not part of the final list");
            }

            this.Items = distinctItems;
            this.ApplicableSpan = applicableSpan;
            this.ArgumentIndex = argumentIndex;
            this.ArgumentCount = argumentCount;
            this.SelectedItemIndex = selectedItem;
            this.ArgumentName = argumentName;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:47,代码来源:SignatureHelpItems.cs

示例13: DdlDropTableStatement

 public DdlDropTableStatement(IList<Identifier> tableNames,
                              bool temp,
                              bool ifExists,
                              DropTableMode dropTableMode)
 {
     if (tableNames == null || tableNames.IsEmpty())
     {
         TableNames = new List<Identifier>(0);
     }
     else
     {
         TableNames = tableNames;
     }
     IsTemp = temp;
     IsIfExists = ifExists;
     Mode = dropTableMode;
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:17,代码来源:DDLDropTableStatement.cs

示例14: TableRefFactor

 public TableRefFactor(Identifier table, string alias, IList<IndexHint> hintList)
     : base(alias)
 {
     this.table = table;
     if (hintList == null || hintList.IsEmpty())
     {
         HintList = new List<IndexHint>(0);
     }
     else if (hintList is List<IndexHint>)
     {
         HintList = hintList;
     }
     else
     {
         HintList = new List<IndexHint>(hintList);
     }
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:17,代码来源:TableRefFactor.cs

示例15: ShowProfile

        public ShowProfile(IList<ProfileType> types, IExpression forQuery, Limit limit)
        {
            if (types == null || types.IsEmpty())
            {
                ProfileTypes = new List<ProfileType>(0);
            }
            else if (types is List<ProfileType>)
            {
                ProfileTypes = types;
            }
            else
            {
                ProfileTypes = new List<ProfileType>(types);
            }

            ForQuery = forQuery;
            Limit = limit;
        }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:18,代码来源:ShowProfile.cs


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