public static IEnumerable <T> GetEnumerable <T>(this INiIterator <T> self)
        {
            if (self == null)
            {
                throw new ArgumentNullException("self");
            }

            using (self)
            {
                while (true)
                {
                    bool available;
                    ErrorUtil.ThrowOnFailure(self.Next(out available));

                    if (!available)
                    {
                        break;
                    }

                    T current;
                    ErrorUtil.ThrowOnFailure(self.GetCurrent(out current));

                    yield return(current);
                }
            }
        }
Example #2
0
        internal HResult GetDocumentWindowIterator(out INiIterator <INiWindowFrame> iterator)
        {
            iterator = null;

            try
            {
                iterator = new NiDocumentWindowIterator(((IEnumerable <IDockContent>)_dockPanel.Documents.ToArray()).GetEnumerator());

                return(HResult.OK);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
Example #3
0
        public HResult GetDocumentIterator(out INiIterator <int> iterator)
        {
            iterator = null;

            try
            {
                iterator = new Iterator(_registrations.Keys.GetEnumerator());

                return(HResult.OK);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
Example #4
0
 public HResult GetDocumentWindowIterator(out INiIterator<INiWindowFrame> iterator)
 {
     return _env.MainForm.GetDocumentWindowIterator(out iterator);
 }