• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ListInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ListInfo的典型用法代码示例。如果您正苦于以下问题:C# ListInfo类的具体用法?C# ListInfo怎么用?C# ListInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListInfo类属于命名空间,在下文中一共展示了ListInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FilterList

 public FilterList(string ownerAndslug)
 {
     var splited = ownerAndslug.Split('/');
     if (splited.Length != 2)
         throw new ArgumentException("owner and slug must be separated as slash, once.");
     _listInfo = new ListInfo() { OwnerScreenName = splited[0], Slug = splited[1] };
 }
开发者ID:azyobuzin,项目名称:StarryEyes,代码行数:7,代码来源:FilterList.cs


示例2: Execute

        public override void Execute()
        {
            foreach (SiteCollInfo siteCollInfo in Owner.WorkingSiteCollections)
            {
                using (var siteColl = Owner.ObjectsFactory.GetSite(siteCollInfo.URL))
                {
                    foreach (SiteInfo siteInfo in siteCollInfo.Sites)
                    {
                        using(var web = siteColl.OpenWeb(siteInfo.ID))
                        {
                            Random rnd = new Random();
                            int listsToCreate = rnd.Next(WorkingDefinition.MaxNumberOfListsAndLibrariesPerSite+1);
                            int bigListsToCreate = WorkingDefinition.NumberOfBigListsPerSite;
                            Log.Write("Creating lists in site '" + web.Url + "'");
                            listsToCreate += bigListsToCreate;
                            int bigListsCreated = 0;
                            for( int s = 0; s < listsToCreate; s++ )
                            {
                                try
                                {
                                    SPDGListTemplateType listTemplate;
                                    if (bigListsCreated >= bigListsToCreate)
                                    {
                                        getNextTemplateType();

                                        listTemplate = _lastTemplateType;
                                    }
                                    else
                                    {
                                        _lastListPrefix = "List";
                                        listTemplate = SPDGListTemplateType.GenericList;
                                    }

                                    string listName = findAvailableListName(web);
                                    Guid listGuid = web.AddList(listName, string.Empty, (int)listTemplate);
                                    Owner.IncrementCurrentTaskProgress("Created List '" + listName + "' in site '" + web.Url + "'");
                                    var list = web.GetList(listGuid);
                                    web.AddNavigationNode(list.Title, list.DefaultViewUrl, NavigationNodeLocation.QuickLaunchLists);
                                    ListInfo listInfo = new ListInfo();
                                    listInfo.Name = listName;
                                    listInfo.TemplateType = listTemplate;
                                    listInfo.isLib = (listTemplate == SPDGListTemplateType.DocumentLibrary ? true : false);
                                    if (!listInfo.isLib && bigListsCreated < bigListsToCreate)
                                    {
                                        listInfo.isBigList = true;
                                        bigListsCreated++;
                                    }
                                    siteInfo.Lists.Add(listInfo);

                                }
                                catch(Exception ex )
                                {
                                    Errors.Log(ex);
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:Acceleratio,项目名称:SPDG,代码行数:60,代码来源:ListsDataGenerationTask.cs


示例3: GetListMembers

 public static async Task<IEnumerable<long>> GetListMembers(ListInfo listInfo)
 {
     var user = await Database.UserCrud.GetAsync(listInfo.OwnerScreenName).ConfigureAwait(false);
     if (user == null) return Enumerable.Empty<long>();
     var list = await Database.ListCrud.GetAsync(user.Id, listInfo.Slug).ConfigureAwait(false);
     if (list == null) return Enumerable.Empty<long>();
     return await GetListMembers(list.Id).ConfigureAwait(false);
 }
开发者ID:karno,项目名称:StarryEyes,代码行数:8,代码来源:ListProxy.cs


示例4: GetListDescription

 public static async Task<DatabaseList> GetListDescription(ListInfo listInfo)
 {
     return await Task.Run(async () =>
     {
         var userId = UserProxy.GetId(listInfo.OwnerScreenName);
         return await Database.ListCrud.GetAsync(userId, listInfo.Slug).ConfigureAwait(false);
     }).ConfigureAwait(false);
 }
开发者ID:karno,项目名称:StarryEyes,代码行数:8,代码来源:ListProxy.cs


示例5: StartReceive

 public void StartReceive(string receiverScreenName, ListInfo info)
 {
     var ai = AccountsStore.Accounts.FirstOrDefault(aset => aset.AuthenticateInfo.UnreliableScreenName == receiverScreenName);
     if (ai != null)
         StartReceive(ai.AuthenticateInfo, info);
     else
         StartReceive(info);
 }
开发者ID:ssk-uo,项目名称:StarryEyes,代码行数:8,代码来源:ListReceiveManager.cs


示例6: GetListUsers

 public static IEnumerable<long> GetListUsers(ListInfo info)
 {
     lock (_listUserCache)
     {
         IEnumerable<long> users;
         return _listUserCache.TryGetValue(info, out users) ? users : Enumerable.Empty<long>();
     }
 }
开发者ID:ssk-uo,项目名称:StarryEyes,代码行数:8,代码来源:CacheStore.cs


示例7: StartReceive

 public void StartReceive(string receiverScreenName, ListInfo info)
 {
     var account =
         Setting.Accounts.Collection.FirstOrDefault(
             a => a.UnreliableScreenName.Equals(receiverScreenName, StringComparison.CurrentCultureIgnoreCase));
     if (account != null)
     {
         this.StartReceive(account, info);
     }
     else
     {
         this.StartReceive(info);
     }
 }
开发者ID:Kei-Nanigashi,项目名称:StarryEyes,代码行数:14,代码来源:ListReceiveManager.cs


示例8: MeshBatcher

 public MeshBatcher()
 {
     int modelsMax = 1024 * 16;
     models = new ListInfo[modelsMax];
     for (int i = 0; i < modelsMax; i++)
     {
         models[i] = new ListInfo();
     }
     modelsCount = 0;
     BindTexture = true;
     glTextures = new int[10];
     glTexturesLength = 10;
     empty = new int[modelsMax];
     emptyCount = 0;
 }
开发者ID:MagistrAVSH,项目名称:manicdigger,代码行数:15,代码来源:MeshBatcher.ci.cs


示例9: StartReceive

 public void StartReceive(TwitterAccount account, ListInfo info)
 {
     lock (this._listReceiverLocker)
     {
         if (this._listReceiverReferenceCount.ContainsKey(info))
         {
             this._listReceiverReferenceCount[info]++;
         }
         else
         {
             var lr = new ListReceiver(account, info);
             this._listReceiverReferenceCount.Add(info, 1);
             this._listReceiverResolver.Add(info, lr);
         }
     }
 }
开发者ID:R4ndZ-Alice,项目名称:StarryEyes,代码行数:16,代码来源:ListReceiveManager.cs


示例10: StopReceive

        public void StopReceive(ListInfo info)
        {
            lock (this._listReceiverLocker)
            {
                if (!this._listReceiverReferenceCount.ContainsKey(info))
                {
                    return;
                }

                if (--this._listReceiverReferenceCount[info] != 0) return;
                // dispose connection
                this._listReceiverReferenceCount.Remove(info);
                var lr = this._listReceiverResolver[info];
                this._listReceiverResolver.Remove(info);
                lr.Dispose();
            }
        }
开发者ID:R4ndZ-Alice,项目名称:StarryEyes,代码行数:17,代码来源:ListReceiveManager.cs


示例11: StopReceive

        public void StopReceive(ListInfo info)
        {
            lock (this._listReceiverLocker)
            {
                if (!this._listReceiverReferenceCount.ContainsKey(info))
                {
                    return;
                }

                if (--this._listReceiverReferenceCount[info] != 0) return;
                // dispose receivers
                this._listReceiverReferenceCount.Remove(info);
                var d = _receiverDictionary[info];
                _receiverDictionary.Remove(info);
                d.Dispose();
            }
        }
开发者ID:Kei-Nanigashi,项目名称:StarryEyes,代码行数:17,代码来源:ListReceiveManager.cs


示例12: FilterList

 public FilterList(string ownerAndslug)
 {
     var splited = ownerAndslug.Split('/');
     if (splited.Length < 2 || splited.Length > 3)
     {
         throw new ArgumentException("owner and slug must be separated as slash, once.");
     }
     if (splited.Length == 2)
     {
         _listInfo = new ListInfo { OwnerScreenName = splited[0], Slug = splited[1] };
         _receiver = splited[0];
     }
     else
     {
         _listInfo = new ListInfo { OwnerScreenName = splited[1], Slug = splited[2] };
         _receiver = splited[0];
     }
 }
开发者ID:R4ndZ-Alice,项目名称:StarryEyes,代码行数:18,代码来源:FilterList.cs


示例13: FilterList

 public FilterList(string ownerAndslug)
 {
     var splited = ownerAndslug.Split('/');
     if (splited.Length < 2 || splited.Length > 3)
     {
         throw new ArgumentException("owner and slug must be separated as slash, once.");
     }
     if (splited.Length == 2)
     {
         _listInfo = new ListInfo(splited[0], splited[1]);
         this._receiverScreenName = splited[0];
     }
     else
     {
         _listInfo = new ListInfo(splited[1], splited[2]);
         this._receiverScreenName = splited[0];
     }
     _watcher = new ListWatcher(_listInfo);
     _watcher.OnListMemberUpdated += this.RaiseInvalidateRequired;
 }
开发者ID:Mojopon,项目名称:StarryEyes,代码行数:20,代码来源:FilterList.cs


示例14: CreateFieldRef

        private static Field CreateFieldRef(ListInfo listInfo, Field field, FieldRef fieldRef)
        {
            field.EnsureProperty(f => f.SchemaXmlWithResourceTokens);
            XElement element = XElement.Parse(field.SchemaXmlWithResourceTokens);

            element.SetAttributeValue("AllowDeletion", "TRUE");

            field.SchemaXml = element.ToString();

            var createdField = listInfo.SiteList.Fields.Add(field);

            createdField.Context.Load(createdField, cf => cf.Id, cf => cf.Title, cf => cf.Hidden, cf => cf.Required);
            createdField.Context.ExecuteQueryRetry();

            var isDirty = false;
            if (!string.IsNullOrEmpty(fieldRef.DisplayName) && createdField.Title != fieldRef.DisplayName)
            {
                createdField.Title = fieldRef.DisplayName;
                isDirty = true;
            }
            if (createdField.Hidden != fieldRef.Hidden)
            {
                createdField.Hidden = fieldRef.Hidden;
                isDirty = true;
            }
            if (createdField.Required != fieldRef.Required)
            {
                createdField.Required = fieldRef.Required;
                isDirty = true;
            }
            if (isDirty)
            {
                createdField.Update();
                createdField.Context.ExecuteQueryRetry();
            }

            return createdField;
        }
开发者ID:s-KaiNet,项目名称:PnP-Sites-Core,代码行数:38,代码来源:ObjectListInstance.cs


示例15: CreateField

        private static Field CreateField(XElement fieldElement, ListInfo listInfo, TokenParser parser, string originalFieldXml, ClientRuntimeContext context, PnPMonitoredScope scope)
        {
            Field field = null;
            fieldElement = PrepareField(fieldElement);

            var fieldXml = parser.ParseString(fieldElement.ToString(), "~sitecollection", "~site");
            if (IsFieldXmlValid(parser.ParseString(originalFieldXml), parser, context))
            {
                field = listInfo.SiteList.Fields.AddFieldAsXml(fieldXml, false, AddFieldOptions.AddFieldInternalNameHint);
                listInfo.SiteList.Context.Load(field);
                listInfo.SiteList.Context.ExecuteQueryRetry();

                bool isDirty = false;
            #if !SP2013
                if (originalFieldXml.ContainsResourceToken())
                {
                    var originalFieldElement = XElement.Parse(originalFieldXml);
                    var nameAttributeValue = originalFieldElement.Attribute("DisplayName") != null ? originalFieldElement.Attribute("DisplayName").Value : "";
                    if (nameAttributeValue.ContainsResourceToken())
                    {
                        if (field.TitleResource.SetUserResourceValue(nameAttributeValue, parser))
                        {
                            isDirty = true;
                        }
                    }
                    var descriptionAttributeValue = originalFieldElement.Attribute("Description") != null ? originalFieldElement.Attribute("Description").Value : "";
                    if (descriptionAttributeValue.ContainsResourceToken())
                    {
                        if (field.DescriptionResource.SetUserResourceValue(descriptionAttributeValue, parser))
                        {
                            isDirty = true;
                        }
                    }
                }
            #endif
                if (isDirty)
                {
                    field.Update();
                    listInfo.SiteList.Context.ExecuteQueryRetry();
                }
            }
            else
            {
                // The field Xml was found invalid
                var tokenString = parser.GetLeftOverTokens(originalFieldXml).Aggregate(String.Empty, (acc, i) => acc + " " + i);
                scope.LogError("The field was found invalid: {0}", tokenString);
                throw new Exception(string.Format("The field was found invalid: {0}", tokenString));
            }
            return field;
        }
开发者ID:s-KaiNet,项目名称:PnP-Sites-Core,代码行数:50,代码来源:ObjectListInstance.cs


示例16: UpdateField

        private Field UpdateField(ClientObject web, ListInfo listInfo, Guid fieldId, XElement templateFieldElement, Field existingField, PnPMonitoredScope scope, TokenParser parser, string originalFieldXml)
        {
            Field field = null;
            web.Context.Load(existingField, f => f.SchemaXmlWithResourceTokens);
            web.Context.ExecuteQueryRetry();

            var existingFieldElement = XElement.Parse(existingField.SchemaXmlWithResourceTokens);

            var equalityComparer = new XNodeEqualityComparer();

            // Is field different in template?
            if (equalityComparer.GetHashCode(existingFieldElement) != equalityComparer.GetHashCode(templateFieldElement))
            {
                // Is existing field of the same type?
                if (existingFieldElement.Attribute("Type").Value == templateFieldElement.Attribute("Type").Value)
                {
                    templateFieldElement = PrepareField(templateFieldElement);
                    if (IsFieldXmlValid(parser.ParseString(templateFieldElement.ToString()), parser, web.Context))
                    {
                        foreach (var attribute in templateFieldElement.Attributes())
                        {
                            if (existingFieldElement.Attribute(attribute.Name) != null)
                            {
                                existingFieldElement.Attribute(attribute.Name).Value = attribute.Value;
                            }
                            else
                            {
                                existingFieldElement.Add(attribute);
                            }
                        }
                        foreach (var element in templateFieldElement.Elements())
                        {
                            if (existingFieldElement.Element(element.Name) != null)
                            {
                                existingFieldElement.Element(element.Name).Remove();
                            }
                            existingFieldElement.Add(element);
                        }

                        if (existingFieldElement.Attribute("Version") != null)
                        {
                            existingFieldElement.Attributes("Version").Remove();
                        }
                        existingField.SchemaXml = parser.ParseString(existingFieldElement.ToString(), "~sitecollection", "~site");
                        existingField.UpdateAndPushChanges(true);
                        web.Context.ExecuteQueryRetry();
                        bool isDirty = false;
            #if !SP2013
                        if (originalFieldXml.ContainsResourceToken())
                        {
                            var originalFieldElement = XElement.Parse(originalFieldXml);
                            var nameAttributeValue = originalFieldElement.Attribute("DisplayName") != null ? originalFieldElement.Attribute("DisplayName").Value : "";
                            if (nameAttributeValue.ContainsResourceToken())
                            {
                                if (existingField.TitleResource.SetUserResourceValue(nameAttributeValue, parser))
                                {
                                    isDirty = true;
                                }
                            }
                            var descriptionAttributeValue = originalFieldElement.Attribute("Description") != null ? originalFieldElement.Attribute("Description").Value : "";
                            if (descriptionAttributeValue.ContainsResourceToken())
                            {
                                if (existingField.DescriptionResource.SetUserResourceValue(descriptionAttributeValue, parser))
                                {
                                    isDirty = true;
                                }
                            }
                        }
            #endif
                        if (isDirty)
                        {
                            existingField.Update();
                            web.Context.ExecuteQueryRetry();
                            field = existingField;
                        }
                    }
                    else
                    {
                        // The field Xml was found invalid
                        var tokenString = parser.GetLeftOverTokens(originalFieldXml).Aggregate(String.Empty, (acc, i) => acc + " " + i);
                        scope.LogError("The field was found invalid: {0}", tokenString);
                        throw new Exception(string.Format("The field was found invalid: {0}", tokenString));
                    }
                }
                else
                {
                    var fieldName = existingFieldElement.Attribute("Name") != null ? existingFieldElement.Attribute("Name").Value : existingFieldElement.Attribute("StaticName").Value;
                    scope.LogWarning(CoreResources.Provisioning_ObjectHandlers_ListInstances_Field__0____1___exists_in_list__2____3___but_is_of_different_type__Skipping_field_, fieldName, fieldId, listInfo.TemplateList.Title, listInfo.SiteList.Id);
                    WriteWarning(string.Format(CoreResources.Provisioning_ObjectHandlers_ListInstances_Field__0____1___exists_in_list__2____3___but_is_of_different_type__Skipping_field_, fieldName, fieldId, listInfo.TemplateList.Title, listInfo.SiteList.Id), ProvisioningMessageType.Warning);
                }
            }
            return field;
        }
开发者ID:s-KaiNet,项目名称:PnP-Sites-Core,代码行数:93,代码来源:ObjectListInstance.cs


示例17: ListMemberReceiver

 public ListMemberReceiver(TwitterAccount auth, ListInfo listInfo)
 {
     _auth = auth;
     _listInfo = listInfo;
 }
开发者ID:karno,项目名称:StarryEyes,代码行数:5,代码来源:ListMemberReceiver.cs


示例18: SaveAction

		public void SaveAction(NSObject sender)
		{
			ListInfo listInfo = new ListInfo(FileUrl);
			listInfo.Color = selectedColor;
			listInfo.Name = selectedTitle;

			listInfo.CreateAndSaveWithCompletionHandler (success => {
				if (success) {
					MasterController.OnNewListInfo(listInfo);
				} else {
					// In your app, you should handle this error gracefully.
					Console.WriteLine ("Unable to create new document at URL: {0}", FileUrl.AbsoluteString);
					throw new InvalidProgramException();
				}
				DismissViewController(true, null);
			});
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:17,代码来源:NewDocumentController.cs


示例19: GetList

 private ListInfo GetList(XmlElement listElement)
 {
     var list = new ListInfo();
     list.Values.AddRange(from XmlElement valueElement
                             in listElement.SelectNodes(ValueInfoElement)
                          select GetValue(valueElement));
     return list;
 }
开发者ID:sbambach,项目名称:ATF,代码行数:8,代码来源:SkinService.cs


示例20: Setter

 public Setter(string propertyName, ListInfo listInfo)
 {
     PropertyName = propertyName;
     ListInfo = listInfo;
 }
开发者ID:sbambach,项目名称:ATF,代码行数:5,代码来源:SkinService.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ListItem类代码示例发布时间:2022-05-24
下一篇:
C# ListDictionary类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap