本文整理汇总了C#中Folder.GetItems方法的典型用法代码示例。如果您正苦于以下问题:C# Folder.GetItems方法的具体用法?C# Folder.GetItems怎么用?C# Folder.GetItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder.GetItems方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadMailsFromFolders
private void LoadMailsFromFolders(Folder folder)
{
emailDetailsList = new List<EmailDetails>();
ItemCollection items = folder.GetItems();
for (int m = 0; m < items.Count; m++)
{
string custom_messageID = GenerateUID();
if (items[m] is PSTMessage)
{
PSTMessage message = (PSTMessage)items[m];
RecipientCollection recipColl = message.Recipients;
//InsertRecipientCount(message.InternetMessageId, recipColl);
foreach (Recipient r in recipColl)
{
EmailDetails emailDetails = new EmailDetails();
//emailDetails.ID = message.Id.ToString();
//emailDetails.parentID = message.ParentId.ToString();
emailDetails.CustomMessageID = custom_messageID;
emailDetails.MessageID = message.InternetMessageId;
emailDetails.FromDisplayName = message.SenderName;
emailDetails.RecipientDisplayName = r.DisplayName;
if (message.SenderAddressType == "EX")
emailDetails.FromEmailID = GetFromEmailFromExchangeString(message.SenderEmailAddress).ToLower() + "@virtusa.com";
else
emailDetails.FromEmailID = message.SenderEmailAddress;
if (r.AddressType == "EX")
emailDetails.RecipientEmailID = GetFromEmailFromExchangeString(r.EmailAddress).ToLower() + "@virtusa.com";
else
emailDetails.RecipientEmailID = r.EmailAddress;
emailDetails.RecipientDisplayName = r.DisplayName;
if (emailDetails.RecipientEmailID != null && emailDetails.RecipientEmailID.Contains('@'))
emailDetails.DomainName = emailDetails.RecipientEmailID.Split('@')[1];
emailDetails.RecipientType = r.RecipientType.ToString();
emailDetails.EmailDatetime = message.MessageDeliveryTime.ToString();
emailDetails.Subject = message.Subject;
if (emailDetails.RecipientEmailID != null)
emailDetailsList.Add(emailDetails);
//Debug.Print(r.EmailAddress);
//Debug.Print(message.Id + " - " + message.InternetMessageId + " - " + r.RecipientType + " - " + message.SenderEmailAddress + " - " + r.DisplayName + " - " + r.EmailAddress);
}
LoadContentToDB(emailDetailsList);
emailDetailsList.Clear();
recipColl.Clear();
}
}
}
示例2: PublishModuleTemplatesConfig
private Binary PublishModuleTemplatesConfig(string moduleName, Folder moduleFolder, Component moduleConfigComponent)
{
OrganizationalItemItemsFilter moduleTemplatesFilter = new OrganizationalItemItemsFilter(Session)
{
ItemTypes = new[] { ItemType.ComponentTemplate },
Recursive = true
};
ComponentTemplate[] moduleComponentTemplates = moduleFolder.GetItems(moduleTemplatesFilter).Cast<ComponentTemplate>().Where(ct => ct.IsRepositoryPublishable).ToArray();
if (!moduleComponentTemplates.Any())
{
return null;
}
IDictionary<string, int> moduleTemplatesConfig = new Dictionary<string, int>();
foreach (ComponentTemplate moduleTemplate in moduleComponentTemplates)
{
string templateKey = Utility.GetKeyFromTemplate(moduleTemplate);
int sameKeyAsTemplate;
if (moduleTemplatesConfig.TryGetValue(templateKey, out sameKeyAsTemplate))
{
Logger.Warning(string.Format("{0} has same key ('{1}') as CT '{2}'; supressing from output.", moduleTemplate, templateKey, sameKeyAsTemplate));
continue;
}
moduleTemplatesConfig.Add(templateKey, moduleTemplate.Id.ItemId);
}
string fileName = string.Format("{0}.{1}", moduleName, TemplateConfigName);
return AddJsonBinary(moduleTemplatesConfig,moduleConfigComponent, _configStructureGroup, fileName, variantId: "templates");
}
示例3: RunFolder
// ----------------------------------------------------------------------------
// Searches the given folder.
// ----------------------------------------------------------------------------
private StarTeam.Item RunFolder(Server stServer, Project stProject, StarTeam.View stView, Item.Type stType, Folder stFolder)
{
StarTeam.Item item = null;
// For each item of the appropriate type ...
foreach (Item stItem in stFolder.GetItems(stType))
{
item = RunItem(stServer, stProject, stView, stType, stFolder, stItem);
if (item != null)
return item;
}
if (m_bRecursive)
{
// For each subfolder ...
foreach (Folder stSubFolder in stFolder.SubFolders)
{
item = RunFolder(stServer, stProject, stView, stType, stSubFolder);
if (item != null && item.ToString() == "revision.txt")
return item;
}
}
return item;
}
示例4: PublishModuleSchemasConfig
private Binary PublishModuleSchemasConfig(string moduleName, Folder moduleFolder, Component moduleConfigComponent)
{
OrganizationalItemItemsFilter moduleSchemasFilter = new OrganizationalItemItemsFilter(Session)
{
ItemTypes = new [] { ItemType.Schema },
Recursive = true
};
Schema[] moduleSchemas = moduleFolder.GetItems(moduleSchemasFilter).Cast<Schema>().Where(s => s.Purpose == SchemaPurpose.Component).ToArray();
if (!moduleSchemas.Any())
{
return null;
}
IDictionary <string, int> moduleSchemasConfig = new Dictionary<string, int>();
foreach (Schema moduleSchema in moduleSchemas)
{
string schemaKey = Utility.GetKeyFromSchema(moduleSchema);
int sameKeyAsSchema;
if (moduleSchemasConfig.TryGetValue(schemaKey, out sameKeyAsSchema))
{
Logger.Warning(string.Format("{0} has same key ('{1}') as Schema '{2}'; supressing from output.", moduleSchema, schemaKey, sameKeyAsSchema));
continue;
}
moduleSchemasConfig.Add(schemaKey, moduleSchema.Id.ItemId);
}
string fileName = string.Format("{0}.{1}", moduleName, SchemasConfigName);
return AddJsonBinary(moduleSchemasConfig, moduleConfigComponent, _configStructureGroup, fileName, variantId: "schemas");
}
示例5: FindInFolder
private StarTeam.Item FindInFolder(Server stServer, Project stProject, StarTeam.View stView, Item.Type stType, Folder stFolder, String fileName)
{
StarTeam.Item item = null;
// For each item of the appropriate type ...
foreach (Item stItem in stFolder.GetItems(stType))
{
item = FindItem(stServer, stProject, stView, stType, stFolder, stItem, fileName);
if (item != null)
return item;
}
if (m_bRecursive)
{
// For each subfolder ...
foreach (Folder stSubFolder in stFolder.SubFolders)
{
item = FindInFolder(stServer, stProject, stView, stType, stSubFolder, fileName);
if (item != null && item.ToString() == fileName)
return item;
}
}
return item;
}