Пример #1
0
        void IPersistable.Deserialize(AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatReader reader)
        {
            base.Deserialize(reader);
            reader.RegisterDeclaration(ParameterInfo.m_Declaration);
            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.Prompt:
                    this.m_prompt = reader.ReadString();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.DynamicPrompt:
                    this.m_dynamicPrompt = reader.ReadBoolean();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.IsUserSupplied:
                    this.m_isUserSupplied = reader.ReadBoolean();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.Value:
                    this.m_values = reader.ReadVariantArray();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.DynamicValidValues:
                    this.m_dynamicValidValues = reader.ReadBoolean();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.DynamicDefaultValue:
                    this.m_dynamicDefaultValue = reader.ReadBoolean();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.DependencyList:
                    this.m_dependencyList = reader.ReadListOfRIFObjects <ParameterInfoCollection>();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.ValidValues:
                    this.m_validValues = reader.ReadListOfRIFObjects <ValidValueList>();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.Label:
                    this.m_labels = reader.ReadStringArray();
                    break;

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.MemberName.DependencyIndexList:
                    this.m_dependencyIndexList = reader.ReadInt32Array();
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
        }
Пример #2
0
 public ParameterInfo(ParameterInfo source)
     : base(source)
 {
     this.m_isUserSupplied      = source.m_isUserSupplied;
     this.m_valuesChanged       = source.m_valuesChanged;
     this.m_dynamicValidValues  = source.m_dynamicValidValues;
     this.m_dynamicDefaultValue = source.m_dynamicDefaultValue;
     this.m_state                   = source.State;
     this.m_othersDependOnMe        = source.m_othersDependOnMe;
     this.m_useExplicitDefaultValue = source.m_useExplicitDefaultValue;
     this.m_prompt                  = source.m_prompt;
     this.m_dynamicPrompt           = source.m_dynamicPrompt;
     if (source.m_values != null)
     {
         int num = source.m_values.Length;
         this.m_values = new object[num];
         for (int i = 0; i < num; i++)
         {
             this.m_values[i] = source.m_values[i];
         }
     }
     if (source.m_labels != null)
     {
         int num2 = source.m_labels.Length;
         this.m_labels = new string[num2];
         for (int j = 0; j < num2; j++)
         {
             this.m_labels[j] = source.m_labels[j];
         }
     }
     if (source.m_dependencyList != null)
     {
         int count = source.m_dependencyList.Count;
         this.m_dependencyList = new ParameterInfoCollection(count);
         for (int k = 0; k < count; k++)
         {
             this.m_dependencyList.Add(source.m_dependencyList[k]);
         }
     }
     if (source.m_validValues != null)
     {
         int count2 = source.m_validValues.Count;
         this.m_validValues = new ValidValueList(count2);
         for (int l = 0; l < count2; l++)
         {
             this.m_validValues.Add(source.m_validValues[l]);
         }
     }
 }
Пример #3
0
 public void Parse(string name, List <string> defaultValues, string type, string nullable, string prompt, bool promptIsExpr, string promptUser, string allowBlank, string multiValue, ValidValueList validValues, string usedInQuery, bool hidden, ErrorContext errorContext, CultureInfo language)
 {
     base.Parse(name, defaultValues, type, nullable, prompt, promptUser, allowBlank, multiValue, usedInQuery, hidden, errorContext, language);
     if (hidden)
     {
         this.m_prompt = "";
     }
     else if (prompt == null)
     {
         this.m_prompt = name + ":";
     }
     else
     {
         this.m_prompt = prompt;
     }
     this.DynamicPrompt = promptIsExpr;
     if (validValues != null)
     {
         int count = validValues.Count;
         for (int i = 0; i < count; i++)
         {
             object obj = default(object);
             if (!ParameterBase.CastFromString(validValues[i].StringValue, out obj, base.DataType, language))
             {
                 if (errorContext != null)
                 {
                     errorContext.Register(ProcessingErrorCode.rsParameterPropertyTypeMismatch, Severity.Error, ObjectType.ReportParameter, name, "ValidValue");
                     continue;
                 }
                 throw new ReportParameterTypeMismatchException(name);
             }
             validValues[i].Value = obj;
             base.ValidateValue(obj, errorContext, base.ParameterObjectType, "ValidValue");
         }
         this.m_validValues = validValues;
     }
 }
Пример #4
0
        public void Parse(string name, string type, string nullable, string allowBlank, string multiValue, string usedInQuery, string state, string dynamicPrompt, string prompt, string promptUser, ParameterInfoCollection dependencies, string dynamicValidValues, ValidValueList validValues, string dynamicDefaultValue, List <string> defaultValues, List <string> values, string[] labels, CultureInfo language)
        {
            bool hidden       = prompt != null && 0 == prompt.Length;
            bool promptIsExpr = false;

            if (dynamicPrompt != null)
            {
                promptIsExpr = bool.Parse(dynamicPrompt);
            }
            this.Parse(name, defaultValues, type, nullable, prompt, promptIsExpr, promptUser, allowBlank, multiValue, validValues, usedInQuery, hidden, null, language);
            if (state != null)
            {
                this.State = (ReportParameterState)Enum.Parse(typeof(ReportParameterState), state);
            }
            this.DependencyList = dependencies;
            if (dynamicValidValues != null)
            {
                this.DynamicValidValues = bool.Parse(dynamicValidValues);
            }
            if (dynamicDefaultValue != null)
            {
                this.DynamicDefaultValue = bool.Parse(dynamicDefaultValue);
            }
            if (values != null)
            {
                this.Values = new object[values.Count];
                for (int i = 0; i < values.Count; i++)
                {
                    if (!ParameterBase.CastFromString(values[i], out this.Values[i], base.DataType, language))
                    {
                        throw new InternalCatalogException("Can not cast report parameter to correct type when reading from XML");
                    }
                }
            }
            this.Labels = labels;
        }