private void SetFormWithExtendedPropDef(ExtendedPropertyDefinition propDef) { if (propDef == null) { return; } if (propDef.Tag.HasValue) { this.TagRadio.Checked = true; this.NamedPropRadio.Checked = false; this.PropTagText.Text = string.Format("0x{0}", ConversionHelper.GetBase16(propDef.Tag.Value)); } else if (propDef.Name != null && propDef.Name.Length > 0) { this.NamedPropRadio.Checked = true; this.TagRadio.Checked = false; this.PropertyNameOrIdText.Text = propDef.Name; } else if (propDef.Id.HasValue) { NamedPropRadio.Checked = true; TagRadio.Checked = false; PropertyNameOrIdText.Text = string.Format("0x{0}", ConversionHelper.GetBase16(propDef.Id.Value)); } if (propDef.PropertySet.HasValue) { this.extendedPropertySetCombo.SelectedItem = propDef.PropertySet.Value; } else { if (propDef.PropertySetId.HasValue) { this.extendedPropertySetCombo.Text = propDef.PropertySetId.Value.ToString(); } } this.propertyTypeCombo.SelectedItem = propDef.MapiType; KnownExtendedPropertyInfo?info = KnownExtendedProperties.Instance().GetKnownExtendedPropertyInfo(propDef); if (info.HasValue) { if (info.Value.AlternateNames.Length > 0) { this.txtKnownNames.Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0}, {1}", info.Value.CanonicalNames, info.Value.AlternateNames); } else { this.txtKnownNames.Text = info.Value.CanonicalNames; } } else { this.txtKnownNames.Text = null; } }
/// <summary> /// Demonstrate the creation of an IPM.StickyNote base on /// http://download.microsoft.com/download/5/d/d/5dd33fdf-91f5-496d-9884-0a0b0ee698bb/%5bMS-OXONOTE%5d.pdf /// </summary> /// <param name="sender">The parameter is not used.</param> /// <param name="e">The parameter is not used.</param> private void MnuCreateStickyNote_Click(object sender, EventArgs e) { // TODO: Implement a form here try { this.Cursor = Cursors.WaitCursor; EmailMessage message = new EmailMessage(this.CurrentService); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidLidNoteColor, "3"); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidLidNoteWidth, Convert.ToString(0x000000C8)); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidLidNoteHeight, Convert.ToString(0x000000A6)); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidLidNoteX, Convert.ToString(0x0000006E)); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidLidNoteY, Convert.ToString(0x0000006E)); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidTagIconIndex, Convert.ToString(0x00000300)); message.SetExtendedProperty(KnownExtendedProperties.Instance().PidLidSideEffects, Convert.ToString(0x110)); message.ItemClass = "IPM.StickyNote"; message.Subject = "Test Note."; message.Save(this.currentFolder.Id); // Refresh the view this.RefreshContentAndDetails(); } finally { this.Cursor = Cursors.Default; } this.Cursor = Cursors.Default; }
/// <summary> /// Add all WellKnownProperties to the PropertySet /// </summary> /// <param name="sender">The parameter is not used.</param> /// <param name="e">The parameter is not used.</param> private void BtnAddAllProps_Click(object sender, EventArgs e) { foreach (PropertyDefinitionBase prop in KnownExtendedProperties.Instance().GetAllPropertyDefinitions()) { this.AddPropertyToDisplayTable(prop); } }
private void KnownNameText_TextChanged(object sender, EventArgs e) { // Lookup the known name, if found set the form control values based on the // ExtendedPropertyDefinition. ExtendedPropertyDefinition propDef = KnownExtendedProperties.Instance().GetExtendedPropertyDefinition( this.KnownNameText.Text); // If we didn't find the property, bailout... if (propDef == null) { DebugLog.WriteVerbose("Didn't find any property definition"); return; } SetFormWithExtendedPropDef(propDef); }