Esempio n. 1
0
 // Token: 0x060007BA RID: 1978 RVA: 0x00018214 File Offset: 0x00016414
 private void SetPathParameterCollection(PropertyPath.PathParameterCollection parameters)
 {
     if (this._parameters != null)
     {
         this._parameters.CollectionChanged -= this.ParameterCollectionChanged;
     }
     this._parameters = parameters;
     if (this._parameters != null)
     {
         this._parameters.CollectionChanged += this.ParameterCollectionChanged;
     }
 }
Esempio n. 2
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Windows.PropertyPath" /> class, with the provided pathing token string and parameters.</summary>
 /// <param name="path">A string that specifies the <see cref="P:System.Windows.PropertyPath.Path" />, in a tokenized format.</param>
 /// <param name="pathParameters">An array of objects that sets the <see cref="P:System.Windows.PropertyPath.PathParameters" />.  </param>
 // Token: 0x0600079E RID: 1950 RVA: 0x00017C34 File Offset: 0x00015E34
 public PropertyPath(string path, params object[] pathParameters)
 {
     if (Dispatcher.CurrentDispatcher == null)
     {
         throw new InvalidOperationException();
     }
     this._path = path;
     if (pathParameters != null && pathParameters.Length != 0)
     {
         PropertyPath.PathParameterCollection pathParameterCollection = new PropertyPath.PathParameterCollection(pathParameters);
         this.SetPathParameterCollection(pathParameterCollection);
     }
     this.PrepareSourceValueInfo(null);
 }
Esempio n. 3
0
        // Token: 0x060007B9 RID: 1977 RVA: 0x00018014 File Offset: 0x00016214
        private void NormalizePath()
        {
            StringBuilder stringBuilder = new StringBuilder();

            PropertyPath.PathParameterCollection pathParameterCollection = new PropertyPath.PathParameterCollection();
            for (int i = 0; i < this._arySVI.Length; i++)
            {
                switch (this._arySVI[i].drillIn)
                {
                case DrillIn.Never:
                    if (this._arySVI[i].type == SourceValueType.Property)
                    {
                        stringBuilder.Append('.');
                    }
                    break;

                case DrillIn.Always:
                    stringBuilder.Append('/');
                    break;
                }
                switch (this._arySVI[i].type)
                {
                case SourceValueType.Property:
                    if (this._earlyBoundPathParts[i] != null)
                    {
                        stringBuilder.Append('(');
                        stringBuilder.Append(pathParameterCollection.Count.ToString(TypeConverterHelper.InvariantEnglishUS.NumberFormat));
                        stringBuilder.Append(')');
                        pathParameterCollection.Add(this._earlyBoundPathParts[i]);
                    }
                    else
                    {
                        stringBuilder.Append(this._arySVI[i].name);
                    }
                    break;

                case SourceValueType.Indexer:
                    stringBuilder.Append('[');
                    if (this._earlyBoundPathParts[i] != null)
                    {
                        IndexerParameterInfo[] array = (IndexerParameterInfo[])this._earlyBoundPathParts[i];
                        int num = 0;
                        for (;;)
                        {
                            IndexerParameterInfo indexerParameterInfo = array[num];
                            if (indexerParameterInfo.type != null)
                            {
                                stringBuilder.Append('(');
                                stringBuilder.Append(pathParameterCollection.Count.ToString(TypeConverterHelper.InvariantEnglishUS.NumberFormat));
                                stringBuilder.Append(')');
                                pathParameterCollection.Add(indexerParameterInfo.value);
                            }
                            else
                            {
                                stringBuilder.Append(indexerParameterInfo.value);
                            }
                            num++;
                            if (num >= array.Length)
                            {
                                break;
                            }
                            stringBuilder.Append(',');
                        }
                    }
                    else
                    {
                        stringBuilder.Append(this._arySVI[i].name);
                    }
                    stringBuilder.Append(']');
                    break;
                }
            }
            if (pathParameterCollection.Count > 0)
            {
                this._path = stringBuilder.ToString();
                this.SetPathParameterCollection(pathParameterCollection);
            }
        }