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;
            }
        }
Exemple #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);
 }
Exemple #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);
        }
Exemple #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);
 }
        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;
            }
        }
Exemple #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);
 } 
Exemple #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);
        }
Exemple #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); 
 }