コード例 #1
0
 internal EnableInfoData(string enableInfo)
 {
     try
     {
         expression = EnableInfoParser.Parse(enableInfo);
     }
     catch (EnableInfoException)
     {
         expression = null;
     }
     resultCache = new Dictionary <EnableInfoVariables, bool>();
 }
コード例 #2
0
        /// <summary>
        /// Checks if the filter supports processing 16-bit images.
        /// </summary>
        /// <param name="grayScale">if set to <c>true</c> check if processing 16-bit gray scale is supported; otherwise check if 48-bit RGB is supported.</param>
        /// <returns>
        ///   <c>true</c> if the filter supports 16-bit mode; otherwise <c>false</c>.
        /// </returns>
        private bool Supports16BitMode(bool grayScale)
        {
            if (!string.IsNullOrEmpty(enableInfo))
            {
                EnableInfoParser parser = new EnableInfoParser(grayScale);
                return(parser.Parse(enableInfo));
            }

            if (grayScale)
            {
                return((supportedModes.Value & PSConstants.flagSupportsGray16) == PSConstants.flagSupportsGray16);
            }

            return((supportedModes.Value & PSConstants.flagSupportsRGB48) == PSConstants.flagSupportsRGB48);
        }
コード例 #3
0
 private void DetectSupportedModes()
 {
     if (!string.IsNullOrEmpty(enableInfo))
     {
         if (enableInfo == "true")
         {
             supportedModes = ushort.MaxValue; // All modes are supported
         }
         else
         {
             EnableInfoParser parser = new EnableInfoParser();
             supportedModes = parser.GetSupportedModes(enableInfo);
         }
     }
     else
     {
         supportedModes = 0;
     }
 }