Ejemplo n.º 1
0
        public void Dispose()
        {
            if (next != null)
            {
                next.Dispose();
                next = null;
            }

            ReleaseListenerChanged();
        }
Ejemplo n.º 2
0
        public static PropertyBinder Create(string path)
        {
            PropertyBinder first = null;

            if (string.IsNullOrEmpty(path) || path == ".")
            {
                first       = new PropertyBinder(null);
                first.first = first;
                first.last  = first;
                return(first);
            }

            string[] propertys = path.Split('.');

            PropertyBinder last = null;

            foreach (var p in propertys)
            {
                var parts = p.Trim().Split('[');


                string propName;

                for (int i = 0; i < parts.Length; i++)
                {
                    propName = parts[i].Trim();
                    if (propName.Length == 0)
                    {
                        continue;
                    }
                    bool isIndexer = false;
                    if (i > 0)
                    {
                        propName  = propName.Substring(0, propName.Length - 1);
                        isIndexer = true;
                    }


                    PropertyBinder binder = new PropertyBinder(propName, isIndexer);
                    if (first == null)
                    {
                        first = binder;
                    }
                    else
                    {
                        last.next = binder;
                    }
                    last = binder;
                }
            }
            PropertyBinder current = first;

            while (current != null)
            {
                current.first = first;
                current.last  = last;
                current       = current.next;
            }

            return(first);
        }