Пример #1
0
 public static extern ReturnCode DsmWinNew(
     [In, Out] TWIdentity origin,
     [In, Out] TWIdentity destination,
     DataGroups dg,
     DataArgumentType dat,
     Message msg,
     [In, Out] TWExtImageInfo data);
Пример #2
0
 public static ReturnCode DsmEntry(
     TWIdentity origin,
     TWIdentity destination,
     Message msg,
     TWExtImageInfo data)
 {
     if (PlatformInfo.Current.IsWindows)
     {
         if (PlatformInfo.Current.UseNewWinDSM)
         {
             return(NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data));
         }
         else
         {
             return(NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data));
         }
     }
     else if (PlatformInfo.Current.IsLinux)
     {
         return(NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data));
     }
     throw new PlatformNotSupportedException();
 }
Пример #3
0
        /// <summary>
        /// Gets the extended image information if applicable.
        /// </summary>
        /// <param name="infoIds">The information ids.</param>
        /// <returns></returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public IEnumerable <TWInfo> GetExtImageInfo(params ExtendedImageInfo[] infoIds)
        {
            if (infoIds != null && infoIds.Length > 0)// && DataSource.SupportedCaps.Contains(CapabilityId.ICapExtImageInfo))
            {
                var request = new TWExtImageInfo {
                    NumInfos = (uint)infoIds.Length
                };
                if (infoIds.Length > request.Info.Length)
                {
                    throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Info ID array exceeded maximum length of {0}.", request.Info.Length));
                }

                for (int i = 0; i < infoIds.Length; i++)
                {
                    request.Info[i].InfoID = infoIds[i];
                }

                if (DataSource.DGImage.ExtImageInfo.Get(request) == ReturnCode.Success)
                {
                    return(request.Info.Where(it => it.InfoID != ExtendedImageInfo.Invalid));
                }
            }
            return(Enumerable.Empty <TWInfo>());
        }
Пример #4
0
 /// <summary>
 /// This operation is used by the application to query the data source for extended image attributes.
 /// The application is responsible for creating and disiposing the info object.
 /// </summary>
 /// <param name="info">The information.</param>
 /// <returns></returns>
 public ReturnCode Get(TWExtImageInfo info)
 {
     Session.VerifyState(7, 7, DataGroups.Image, DataArgumentType.ExtImageInfo, Message.Get);
     return(Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.Get, info));
 }