本文整理汇总了C#中ListInfo类的典型用法代码示例。如果您正苦于以下问题:C# ListInfo类的具体用法?C# ListInfo怎么用?C# ListInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListInfo类属于命名空间,在下文中一共展示了ListInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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] };
}
示例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);
}
}
}
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例6: GetListUsers
public static IEnumerable<long> GetListUsers(ListInfo info)
{
lock (_listUserCache)
{
IEnumerable<long> users;
return _listUserCache.TryGetValue(info, out users) ? users : Enumerable.Empty<long>();
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
}
示例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();
}
}
示例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();
}
}
示例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];
}
}
示例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;
}
示例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;
}
示例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;
}