internal static void MarshalPropSpec(ManagedPropSpec propSpec, ref PROPSPEC native)
        {
            native.propType = (uint)propSpec.PropType;
            PropSpecType propType = propSpec.PropType;

            if (propType == PropSpecType.Name)
            {
                native.union.name = Marshal.StringToCoTaskMemUni(propSpec.PropName);
                return;
            }
            if (propType == PropSpecType.Id)
            {
                native.union.propId = propSpec.PropId;
                return;
            }
            Invariant.Assert(false);
        }
        /// <summary>
        /// Marshal Managed to Native PROPSPEC
        /// </summary>
        /// <param name="propSpec"></param>
        /// <param name="native"></param>
        internal static void MarshalPropSpec(ManagedPropSpec propSpec, ref PROPSPEC native)
        {
            native.propType = (uint)propSpec.PropType;
            switch (propSpec.PropType)
            {
            case PropSpecType.Id:
                native.union.propId = (uint)propSpec.PropId;
                break;

            case PropSpecType.Name:
                native.union.name = Marshal.StringToCoTaskMemUni(propSpec.PropName);
                break;

            default:
                Invariant.Assert(false);     // propSpec.PropType is set by internal code in the filter logic.
                break;
            }
        }
Пример #3
0
 /// <summary>
 /// Handles native FULLPROPSPEC and does marshaling
 /// </summary>
 /// <param name="nativePropSpec"></param>
 internal ManagedFullPropSpec(FULLPROPSPEC nativePropSpec)
 {
     _guid     = nativePropSpec.guid;
     _property = new ManagedPropSpec(nativePropSpec.property);
 }
Пример #4
0
// If the following is not used once metadata filtering is implemented, remove completely from the code.
#if false
        /// <summary>
        /// Helper constructor
        /// </summary>
        /// <param name="guid">property guid</param>
        /// <param name="propName"></param>
        internal ManagedFullPropSpec(Guid guid, string propName)
        {
            _guid     = guid;
            _property = new ManagedPropSpec(propName);
        }
Пример #5
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="guid"></param>
 /// <param name="propId"></param>
 internal ManagedFullPropSpec(Guid guid, uint propId)
 {
     _guid     = guid;
     _property = new ManagedPropSpec(propId);
 }
Пример #6
0
        internal static void MarshalPropSpec(ManagedPropSpec propSpec, ref PROPSPEC native)
        {
            native.propType = (uint)propSpec.PropType;
            switch (propSpec.PropType)
            {
                case PropSpecType.Id:
                    native.union.propId = (uint)propSpec.PropId;
                    break;

                case PropSpecType.Name:
                    native.union.name = Marshal.StringToCoTaskMemUni(propSpec.PropName);
                    break;

                default:
                    Invariant.Assert(false); // propSpec.PropType is set by internal code in the filter logic.
                    break;
            }
        }
Пример #7
0
 /// <summary>
 /// Handles native FULLPROPSPEC and does marshaling 
 /// </summary> 
 /// <param name="nativePropSpec"></param>
 internal ManagedFullPropSpec(FULLPROPSPEC nativePropSpec) 
 {
     _guid = nativePropSpec.guid;
     _property = new ManagedPropSpec(nativePropSpec.property);
 } 
Пример #8
0
// If the following is not used once metadata filtering is implemented, remove completely from the code. 
#if false
        /// <summary>
        /// Helper constructor
        /// </summary> 
        /// <param name="guid">property guid</param>
        /// <param name="propName"></param> 
        internal ManagedFullPropSpec(Guid guid, string propName) 
        {
            _guid = guid; 
            _property = new ManagedPropSpec(propName);
        }
Пример #9
0
 /// <summary> 
 /// constructor
 /// </summary> 
 /// <param name="guid"></param>
 /// <param name="propId"></param>
 internal ManagedFullPropSpec(Guid guid, uint propId)
 { 
     _guid = guid;
     _property = new ManagedPropSpec(propId); 
 }