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


C# SPFieldCollection.Contains方法代码示例

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


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

示例1: TryGetField

        public SPField TryGetField(SPFieldCollection siteColumns, Guid fieldID)
        {
            siteColumns.RequireNotNull("siteColumns");
            fieldID.Require(Guid.Empty != fieldID, "fieldID");

            return siteColumns.Contains(fieldID) ? siteColumns[fieldID] : null;
        }
开发者ID:utdcometsoccer,项目名称:MySP2010Utilities,代码行数:7,代码来源:FieldOperations.cs

示例2: GetFieldById

        /// <summary>
        /// Gets the field by identifier.
        /// Returns null if the field is not found in the collection.
        /// </summary>
        /// <param name="fieldCollection">The field collection.</param>
        /// <param name="fieldId">The field identifier.</param>
        /// <returns>The SPField.</returns>
        public SPField GetFieldById(SPFieldCollection fieldCollection, Guid fieldId)
        {
            if (fieldCollection == null)
            {
                throw new ArgumentNullException("fieldCollection");
            }

            if (fieldId == null)
            {
                throw new ArgumentNullException("fieldId");
            }

            SPField field = null;
            if (fieldCollection.Contains(fieldId))
            {
                field = fieldCollection[fieldId] as SPField;
            }

            return field;
        }
开发者ID:andresglx,项目名称:Dynamite,代码行数:27,代码来源:FieldLocator.cs

示例3: FieldExists

        private bool FieldExists(SPFieldCollection fieldCollection, string displayName, Guid fieldId)
        {
            if (fieldCollection.Contains(fieldId))
            {
                // If Id is found in the collection.
                this._logger.Warn("Field with id '{0}' is already in the collection.", fieldId);
                return true;
            }

            SPField field;
            try
            {
                // Throws argument exception if not in collection.
                field = fieldCollection.GetField(displayName);
            }
            catch (ArgumentException)
            {
                return false;
            }

            if (field == null)
            {
                // Still can't find the field in the collection
                return false;
            }
            else
            {
                // We found it!
                this._logger.Warn("Field with display name '{0}' is already in the collection.", displayName);
                return true;
            }
        }
开发者ID:GAlexandreBastien,项目名称:Dynamite-2010,代码行数:32,代码来源:FieldHelper.cs

示例4: IsIn

 public bool IsIn(SPFieldCollection fieldCollection)
 {
     return (ID != System.Guid.Empty && fieldCollection.Contains(ID)) ||
         (!string.IsNullOrEmpty(Name) && fieldCollection.ContainsField(Name));
 }
开发者ID:TypesInCode,项目名称:J.SharePoint,代码行数:5,代码来源:SPFieldMetadata.cs

示例5: GetField

 public virtual SPField GetField(SPFieldCollection fieldCollection, Guid fieldId)
 {
     if (fieldCollection.Contains(fieldId))
     {
         return fieldCollection[fieldId];
     }
     else
     {
         return null;
     }
 }
开发者ID:powareverb,项目名称:spgenesis,代码行数:11,代码来源:SPGENFieldStorage.cs

示例6: ContainsField

 public virtual bool ContainsField(SPFieldCollection fieldCollection, Guid fieldId)
 {
     return fieldCollection.Contains(fieldId);
 }
开发者ID:powareverb,项目名称:spgenesis,代码行数:4,代码来源:SPGENFieldStorage.cs


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