internal override sealed bool AddOptionCallback(PrintCapabilityOption baseOption)
        {
            FixedMediaSizeOption option = baseOption as FixedMediaSizeOption;
            bool complete = false;

            // All PageMediaSize options must have an option name
            if (option._optionName == null)
            {
                return(complete);
            }

            int enumValue = PrintSchemaMapper.SchemaNameToEnumValueWithArray(
                PrintSchemaTags.Keywords.PageMediaSizeKeys.MediaSizeNames,
                PrintSchemaTags.Keywords.PageMediaSizeKeys.MediaSizeEnums,
                option._optionName);

            // We only support standard Print Schema options
            if (enumValue > 0)
            {
                option._value = (PageMediaSizeName)enumValue;
                if ((option._mediaSizeWidth > 0) ||
                    (option._mediaSizeHeight > 0))
                {
                    this.FixedMediaSizes.Add(option);
                    complete = true;
                }
            }

            return(complete);
        }
        internal override sealed bool AddOptionCallback(PrintCapabilityOption baseOption)
        {
            bool added = false;

            InputBinOption option = baseOption as InputBinOption;

            // Validate the option is complete before adding it to the collection
            if (option._optionName != null)
            {
                int enumValue = PrintSchemaMapper.SchemaNameToEnumValueWithArray(
                    PrintSchemaTags.Keywords.InputBinKeys.InputBinNames,
                    PrintSchemaTags.Keywords.InputBinKeys.InputBinEnums,
                    option._optionName);

                if (enumValue > 0)
                {
                    // We require the InputBin option to have an option name
                    option._value = (InputBin)enumValue;
                    this.InputBins.Add(option);
                    added = true;
                }
            }

            return(added);
        }
        internal override sealed bool AddOptionCallback(PrintCapabilityOption baseOption)
        {
            bool added = false;

            NUpPresentationDirectionOption option = baseOption as NUpPresentationDirectionOption;

            // validate the option is complete before adding it to the collection
            if (option._optionName != null)
            {
                int enumValue = PrintSchemaMapper.SchemaNameToEnumValueWithArray(
                    PrintSchemaTags.Keywords.NUpKeys.DirectionNames,
                    PrintSchemaTags.Keywords.NUpKeys.DirectionEnums,
                    option._optionName);

                if (enumValue > 0)
                {
                    option._value = (PagesPerSheetDirection)enumValue;
                    this.PresentationDirections.Add(option);
                    added = true;
                }
            }

            return(added);
        }
        internal override sealed bool AddOptionCallback(PrintCapabilityOption baseOption)
        {
            bool added = false;

            TrueTypeFontModeOption option = baseOption as TrueTypeFontModeOption;

            // validate the option is complete before adding it to the collection
            if (option._optionName != null)
            {
                int enumValue = PrintSchemaMapper.SchemaNameToEnumValueWithArray(
                    PrintSchemaTags.Keywords.PageTrueTypeFontModeKeys.ModeNames,
                    PrintSchemaTags.Keywords.PageTrueTypeFontModeKeys.ModeEnums,
                    option._optionName);

                if (enumValue > 0)
                {
                    option._value = (TrueTypeFontMode)enumValue;
                    this.TrueTypeFontModes.Add(option);
                    added = true;
                }
            }

            return(added);
        }
Ejemplo n.º 5
0
        internal override sealed bool AddOptionCallback(PrintCapabilityOption baseOption)
        {
            bool complete = false;

            ScalingOption option = baseOption as ScalingOption;

            if (option._optionName != null)
            {
                int enumValue = PrintSchemaMapper.SchemaNameToEnumValueWithArray(
                    PrintSchemaTags.Keywords.PageScalingKeys.ScalingNames,
                    PrintSchemaTags.Keywords.PageScalingKeys.ScalingEnums,
                    option._optionName);

                if (enumValue > 0)
                {
                    option._value = (PageScaling)enumValue;
                }
            }

            if (option.Value != PageScaling.Unspecified)
            {
                if (option.Value == PageScaling.None)
                {
                    // Non-custom scaling option doesn't need any ParameterRefs
                    complete = true;
                }
                else if (option.Value == PageScaling.Custom)
                {
                    // Custom scaling option must have the 2 scale ParameterRefs
                    if ((option._scaleWIndex >= 0) &&
                        (option._scaleHIndex >= 0))
                    {
                        complete = true;
                    }
                    else
                    {
                        // Need to reset the local parameter required flag since we are
                        // ignoring the custom scaling option
                        if (option._scaleWIndex >= 0)
                        {
                            option.OwnerFeature.OwnerPrintCap.SetLocalParameterDefAsRequired(option._scaleWIndex, false);
                        }

                        if (option._scaleHIndex >= 0)
                        {
                            option.OwnerFeature.OwnerPrintCap.SetLocalParameterDefAsRequired(option._scaleHIndex, false);
                        }
                    }
                }
                else if (option.Value == PageScaling.CustomSquare)
                {
                    // Custom square scaling option must have the scale ParameterRef
                    if (option._squareScaleIndex >= 0)
                    {
                        complete = true;
                    }
                    else
                    {
                        // Need to reset the local parameter required flag since we are
                        // ignoring the custom scaling option
                        if (option._squareScaleIndex >= 0)
                        {
                            option.OwnerFeature.OwnerPrintCap.SetLocalParameterDefAsRequired(option._squareScaleIndex, false);
                        }
                    }
                }
            }

            if (complete)
            {
                this.ScalingOptions.Add(option);
            }

            return(complete);
        }