Beispiel #1
0
        public static void SetValueAsString <TEnum>(this IAIMPPropertyList propertyList, TEnum propId, string value) where TEnum : Enum
        {
            var str = Plugin.Core.CreateString(value);

            propertyList.SetValueAsObject(propId, str);
            Marshal.FinalReleaseComObject(str);
        }
Beispiel #2
0
        public static string GetValueAsString <TEnum>(this IAIMPPropertyList propertyList, TEnum propId) where TEnum : Enum
        {
            var value  = propertyList.GetValueAsObject <IAIMPString>(propId);
            var result = value.GetData();

            Marshal.FinalReleaseComObject(value);
            return(result);
        }
Beispiel #3
0
 public static T GetValueAsObject <T>(this IAIMPPropertyList propertyList, Enum propId)
 {
     propertyList.GetValueAsObject(Convert.ToInt32(propId), typeof(T).GUID, out var value).EnsureSuccess();
     return((T)value);
 }
Beispiel #4
0
 public static long GetValueAsInt64 <TEnum>(this IAIMPPropertyList propertyList, TEnum propId) where TEnum : Enum
 {
     propertyList.GetValueAsInt64(Convert.ToInt32(propId), out var value).EnsureSuccess();
     return(value);
 }
Beispiel #5
0
 public static void SetValueAsObject <TEnum>(this IAIMPPropertyList propertyList, TEnum propId, object value) where TEnum : Enum
 {
     propertyList.SetValueAsObject(Convert.ToInt32(propId), value).EnsureSuccess();
 }