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


C# Folder.SetExtendedProperty方法代码示例

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


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

示例1: exchCreateFolder

        static Microsoft.Exchange.WebServices.Data.FolderId exchCreateFolder(ExchangeService service, string fldrDisplayName, Microsoft.Exchange.WebServices.Data.FolderId fldrParentID, ExtendedPropertyDefinition fldrRetentionPolicyTag, System.Guid fldrRetentionPolicyGUID, ExtendedPropertyDefinition fldrRetentionFlagTag, int fldrRetentionFlagValue)
        {
            // Verify that the paramters passed in are valid
            if (fldrDisplayName.Length == 0)
            {
                Console.WriteLine("\tError in exchCreateFolder : Invalid Folder Name");
                return null;
            }

            //Generate process output
            Console.Write("\tCreating Folder : " + fldrDisplayName + "...");

            if (service == null)
            {
                Console.WriteLine("error:Exchange Service reference Invalid");
                return null;
            }
            if (fldrParentID == null)
            {
                Console.WriteLine("error:Invalid Parent Folder");
                return null;
            }
            //if (fldrRetentionPolicyTag == null)
            //{
            //    Console.WriteLine("\t\tError in exchCreateFolder : Invalid Retention Policy Tag");
            //    return null;
            //}
            //if (fldrRetentionPolicyGUID == null)
            //{
            //    Console.WriteLine("\tError in exchCreateFolder : Invalid Retention Policy GUID");
            //    return null;
            //}

            //if (fldrRetentionFlagTag == null)
            //{
            //    Console.WriteLine("\t\tError in exchCreateFolder : Invalid Retention Policy Flag Tag");
            //    return null;
            //}

            //if (fldrRetentionFlagValue < 1)
            //{
            //    Console.WriteLine("\t\tError in exchCreateFolder : Invalid Retention Policy Flag Value");
            //    return null;
            //}

            //We have all of the inforamtion we need to make folders, create folder and assign retention policy.

            // Create Folder instance
            Folder newFolder = new Folder(service);

            try
            {
                // Assign attributes to folder and save it to exchange server
                newFolder.DisplayName = fldrDisplayName;
                if (fldrRetentionPolicyTag != null)
                {
                    Console.Write("Applying Retention Policy Tag..");
                    newFolder.SetExtendedProperty(fldrRetentionPolicyTag, fldrRetentionPolicyGUID.ToByteArray());
                    newFolder.SetExtendedProperty(fldrRetentionFlagTag, fldrRetentionFlagValue);

                }
                newFolder.Save(fldrParentID);

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.Message);
                return null;

            }

            Console.WriteLine("success.");
            //Return the folder id reference
            return newFolder.Id;
        }
开发者ID:beyerch,项目名称:ExchFldrGen,代码行数:75,代码来源:FolderGenerator.cs


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