Пример #1
0
        private bool ChangeConfigurationValue(ParseContext context, XObject x, string currentValue, out string newValue)
        {
            var valueModified = ChangeConfigurationStringValue(context, currentValue, out newValue);

            // first check for type converter
            var attributeDefinition = GetAttribute(x);

            if (attributeDefinition != null)
            {
                if (attributeDefinition.TypeName == "PathType")
                {
                    newValue = ProcsDE.GetFileName(x, newValue);

                    valueModified |= true;
                }
                else if (attributeDefinition.TypeName == "PathArray")
                {
                    newValue = Procs.JoinPaths(Procs.SplitPaths(newValue).Select(c => ProcsDE.GetFileName(x, c)));

                    valueModified |= true;
                }
                else if (attributeDefinition.TypeName == "CertificateType")
                {
                    if (String.IsNullOrEmpty(newValue) || !newValue.StartsWith("store://"))
                    {
                        newValue       = ProcsDE.GetFileName(x, newValue);
                        valueModified |= true;
                    }
                }
            }

            return(valueModified);
        }         // func ChangeConfigurationValue