本文整理汇总了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;
}