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


C# Folder.GetItems方法代码示例

本文整理汇总了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();
                }
            }
        }
开发者ID:mohankornipati,项目名称:ViConnect,代码行数:54,代码来源:Form1.cs

示例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");
        }
开发者ID:sdl,项目名称:dxa-content-management,代码行数:30,代码来源:PublishConfiguration.cs

示例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;
        }
开发者ID:RichardRanft,项目名称:RevEdit,代码行数:26,代码来源:StarTeamServices.cs

示例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");
        }
开发者ID:sdl,项目名称:dxa-content-management,代码行数:30,代码来源:PublishConfiguration.cs

示例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;
        }
开发者ID:RichardRanft,项目名称:RevEdit,代码行数:23,代码来源:StarTeamServices.cs


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