コード例 #1
0
        private static uint GetMAPIPropTag(DetailsTemplateControl control, MAPIPropertiesDictionary propertiesDictionary)
        {
            if (control.GetControlType() == DetailsTemplateControl.ControlTypes.Button)
            {
                return(ButtonControl.MapiInt);
            }
            string attributeName = control.m_AttributeName;

            if (attributeName == null)
            {
                return(0U);
            }
            AttributeInfo attributeInfo = propertiesDictionary[attributeName];

            if (attributeInfo == null)
            {
                return(0U);
            }
            uint mapiID = (uint)attributeInfo.MapiID;

            return((uint)(control.GetMapiPrefix() | (DetailsTemplateControl.MapiPrefix)(mapiID << 16)));
        }
コード例 #2
0
 private static void SetControlToByteArray(byte[] target, ref int controlOffset, ref int captionOffset, DetailsTemplateControl control, MAPIPropertiesDictionary propertiesDictionary)
 {
     uint[] array = new uint[]
     {
         (uint)control.X,
         (uint)control.Width,
         (uint)control.Y,
         (uint)control.Height,
         (uint)control.GetControlType(),
         (uint)control.GetControlFlags(),
         DetailsTemplateAdapter.GetMAPIPropTag(control, propertiesDictionary),
         (uint)control.m_MaxLength
     };
     for (int i = 0; i < array.Length; i++)
     {
         DetailsTemplateAdapter.SetBytesToByteArray(target, controlOffset, DetailsTemplateAdapter.Get4byteFromInt(array[i]));
         controlOffset += 4;
     }
     DetailsTemplateAdapter.SetBytesToByteArray(target, controlOffset, DetailsTemplateAdapter.Get4byteFromInt((uint)captionOffset));
     DetailsTemplateAdapter.SetCaptionToByteArray(target, ref captionOffset, control.m_Text);
     controlOffset += 4;
 }