コード例 #1
0
 public void Add(object item)
 {
     InnerList.Add(item);
 }
コード例 #2
0
        public bool MoveNext()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "RangeRetriever", "Entering MoveNext");

            if (_endReached)
            {
                return(false);
            }

            // Determine if we have already visited the current object.
            if (_currentIndex < InnerList.Count)
            {
                _currentResult = InnerList[_currentIndex];
                _currentIndex++;
                return(true);
            }
            else if (_cacheFilled)
            {
                // We have just walked the entire cache.  No need to visit the directory
                // since we cached everything that is out there.
                return(false);
            }

            if (!_endReached && _currentEnumerator == null)
            {
                // First time we're being called
                GlobalDebug.WriteLineIf(GlobalDebug.Info, "RangeRetriever", "MoveNext: first time");

                _currentEnumerator = GetNextChunk();

                if (_currentEnumerator == null)
                {
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "RangeRetriever", "MoveNext: got null enumerator for first time");
                    _endReached = true;
                }
            }

            if (_endReached)
            {
                return(false);
            }

            bool needToRetry;
            bool f;

            do
            {
                needToRetry = false;

                f = _currentEnumerator.MoveNext();

                if (f)
                {
                    // Got a result, prepare to return it
                    _currentResult = _currentEnumerator.Current;
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "RangeRetriever", "MoveNext: got a result '{0}'", _currentResult.ToString());
                }
                else
                {
                    // Ran out of results in this range, try the next chunk
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "RangeRetriever", "MoveNext: retrieving next range");
                    _currentEnumerator = GetNextChunk();

                    if (_currentEnumerator == null)
                    {
                        // No more chunks remain
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "RangeRetriever", "MoveNext: end reached");
                        _endReached  = true;
                        _cacheFilled = _cacheValues; //Set cachedFilled boolean to cacheValues flags.
                    }
                    else
                    {
                        // Got the next chunk, try pulling a result out of it
                        needToRetry = true;
                    }
                }
            }while (needToRetry);

            if (f)
            {
                if (_cacheValues)
                {
                    InnerList.Add(_currentResult);
                }
                _currentIndex++;
            }

            return(f);
        }
コード例 #3
0
 public IChannel Add(IChannel value)
 {
     InnerList.Add(value);
     return(value);
 }
コード例 #4
0
 /// <summary>
 /// Add element.
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public int Add(IErrorSet value)
 {
     return(InnerList.Add(value));
 }
コード例 #5
0
 internal void BringWindowToFront(FloatWindow fw)
 {
     InnerList.Remove(fw);
     InnerList.Add(fw);
 }
コード例 #6
0
 private int Add(ReplicationCursor cursor)
 {
     return(InnerList.Add(cursor));
 }
コード例 #7
0
 public int Add(Automobil automobil)
 {
     return(InnerList.Add(automobil));
 }
コード例 #8
0
 internal int Add(ReplicationConnection value) => InnerList.Add(value);
コード例 #9
0
 public int Add(LineItem item)
 {
     return(InnerList.Add(item));
 }
コード例 #10
0
 public int Add(RAW_DATA value)
 {
     return(InnerList.Add(value));
 }
コード例 #11
0
ファイル: FiltersSequence.cs プロジェクト: haf/Accord.Net
 /// <summary>
 /// Add new filter to the sequence.
 /// </summary>
 ///
 /// <param name="filter">Filter to add to the sequence.</param>
 ///
 public void Add(IFilter filter)
 {
     InnerList.Add(filter);
 }
コード例 #12
0
 public void Add(AnalyticsRule r)
 {
     InnerList.Add(r);
 }
コード例 #13
0
 protected void Add(string netName, string path, ShareType shareType, string remark)
 {
     InnerList.Add(new Share(_server, netName, path, shareType, remark));
 }
コード例 #14
0
 protected void Add(Share share)
 {
     InnerList.Add(share);
 }
コード例 #15
0
 internal void AddDirect(EventLogPermissionEntry value)
 {
     InnerList.Add(value);
 }
コード例 #16
0
        // ------------------ Public Methods --------------------

        /// <summary> Populate the collection by looking for commonly implemented property pages. </summary>
        protected void addFromGraph(
            ICaptureGraphBuilder2 graphBuilder,
            IBaseFilter videoDeviceFilter, IBaseFilter audioDeviceFilter,
            IBaseFilter videoCompressorFilter, IBaseFilter audioCompressorFilter,
            SourceCollection videoSources, SourceCollection audioSources)
        {
            object filter = null;
            Guid   cat;
            Guid   med;
            Guid   iid;
            int    hr;

            Trace.Assert(graphBuilder != null);

            // 1. the video capture filter
            addIfSupported(videoDeviceFilter, "Video Capture Device");

            // 2. the video capture pin
            cat = PinCategory.Capture;
            med = MediaType.Interleaved;
            iid = typeof(IAMStreamConfig).GUID;
            hr  = graphBuilder.FindInterface(
                ref cat, ref med, videoDeviceFilter, ref iid, out filter);
            if (hr != 0)
            {
                med = MediaType.Video;
                hr  = graphBuilder.FindInterface(
                    ref cat, ref med, videoDeviceFilter, ref iid, out filter);
                if (hr != 0)
                {
                    filter = null;
                }
            }
            addIfSupported(filter, "Video Capture Pin");

            // 3. the video preview pin
            cat = PinCategory.Preview;
            med = MediaType.Interleaved;
            iid = typeof(IAMStreamConfig).GUID;
            hr  = graphBuilder.FindInterface(
                ref cat, ref med, videoDeviceFilter, ref iid, out filter);
            if (hr != 0)
            {
                med = MediaType.Video;
                hr  = graphBuilder.FindInterface(
                    ref cat, ref med, videoDeviceFilter, ref iid, out filter);
                if (hr != 0)
                {
                    filter = null;
                }
            }
            addIfSupported(filter, "Video Preview Pin");

            // 4. the video crossbar(s)
            ArrayList crossbars = new ArrayList();
            int       num       = 1;

            for (int c = 0; c < videoSources.Count; c++)
            {
                CrossbarSource s = videoSources[c] as CrossbarSource;
                if (s != null)
                {
                    if (crossbars.IndexOf(s.Crossbar) < 0)
                    {
                        crossbars.Add(s.Crossbar);
                        if (addIfSupported(s.Crossbar, "Video Crossbar " + (num == 1 ? "" : num.ToString())))
                        {
                            num++;
                        }
                    }
                }
            }
            crossbars.Clear();

            // 5. the video compressor
            addIfSupported(videoCompressorFilter, "Video Compressor");

            // 6. the video TV tuner
            cat = PinCategory.Capture;
            med = MediaType.Interleaved;
            iid = typeof(IAMTVTuner).GUID;
            hr  = graphBuilder.FindInterface(
                ref cat, ref med, videoDeviceFilter, ref iid, out filter);
            if (hr != 0)
            {
                med = MediaType.Video;
                hr  = graphBuilder.FindInterface(
                    ref cat, ref med, videoDeviceFilter, ref iid, out filter);
                if (hr != 0)
                {
                    filter = null;
                }
            }
            addIfSupported(filter, "TV Tuner");

            // 7. the video compressor (VFW)
            IAMVfwCompressDialogs compressDialog = videoCompressorFilter as IAMVfwCompressDialogs;

            if (compressDialog != null)
            {
                VfwCompressorPropertyPage page = new VfwCompressorPropertyPage("Video Compressor", compressDialog);
                InnerList.Add(page);
            }

            // 8. the audio capture filter
            addIfSupported(audioDeviceFilter, "Audio Capture Device");

            // 9. the audio capture pin
            cat = PinCategory.Capture;
            med = MediaType.Audio;
            iid = typeof(IAMStreamConfig).GUID;
            hr  = graphBuilder.FindInterface(
                ref cat, ref med, audioDeviceFilter, ref iid, out filter);
            if (hr != 0)
            {
                filter = null;
            }
            addIfSupported(filter, "Audio Capture Pin");

            // 9. the audio preview pin
            cat = PinCategory.Preview;
            med = MediaType.Audio;
            iid = typeof(IAMStreamConfig).GUID;
            hr  = graphBuilder.FindInterface(
                ref cat, ref med, audioDeviceFilter, ref iid, out filter);
            if (hr != 0)
            {
                filter = null;
            }
            addIfSupported(filter, "Audio Preview Pin");

            // 10. the audio crossbar(s)
            num = 1;
            for (int c = 0; c < audioSources.Count; c++)
            {
                CrossbarSource s = audioSources[c] as CrossbarSource;
                if (s != null)
                {
                    if (crossbars.IndexOf(s.Crossbar) < 0)
                    {
                        crossbars.Add(s.Crossbar);
                        if (addIfSupported(s.Crossbar, "Audio Crossbar " + (num == 1 ? "" : num.ToString())))
                        {
                            num++;
                        }
                    }
                }
            }
            crossbars.Clear();

            // 11. the audio compressor
            addIfSupported(audioCompressorFilter, "Audio Compressor");
        }
コード例 #17
0
 internal int Add(Domain domain) => InnerList.Add(domain);
コード例 #18
0
 internal int Add(ActiveDirectorySite site) => InnerList.Add(site);
コード例 #19
0
 /// <summary>
 /// Add an object to the collection
 /// </summary>
 /// <param name="sector"></param>
 public virtual void Add(LBMeterThreshold sector)
 {
     InnerList.Add(sector);
 }
コード例 #20
0
 public int Add(Glyph value)
 {
     return(InnerList.Add(value));
 }
コード例 #21
0
 public void Add(PointF p)
 {
     InnerList.Add(p);
 }
コード例 #22
0
ファイル: FilterCollection.cs プロジェクト: rob3c/ScreenToGif
        /// <summary>
        /// Populate the InnerList with a list of filters from a particular category
        /// </summary>
        protected void GetFilters(Guid category)
        {
            int              hr;
            object           comObj  = null;
            ICreateDevEnum   enumDev = null;
            UCOMIEnumMoniker enumMon = null;
            var              mon     = new UCOMIMoniker[1];

            try
            {
                // Get the system device enumerator
                Type srvType = Type.GetTypeFromCLSID(Uuid.Clsid.SystemDeviceEnum);
                if (srvType == null)
                {
                    throw new NotImplementedException("System Device Enumerator");
                }
                comObj  = Activator.CreateInstance(srvType);
                enumDev = (ICreateDevEnum)comObj;

                // Create an enumerator to find filters in category
                hr = enumDev.CreateClassEnumerator(ref category, out enumMon, 0);
                if (hr != 0)
                {
                    return;
                }
                //throw new NotSupportedException("No devices of the category");


                // Loop through the enumerator
                int f;

                do
                {
                    // Next filter
                    hr = enumMon.Next(1, mon, out f);

                    if ((hr != 0) || (mon[0] == null))
                    {
                        break;
                    }

                    // Add the filter
                    var filter = new Filter(mon[0]);
                    InnerList.Add(filter);

                    // Release resources
                    Marshal.ReleaseComObject(mon[0]);
                    mon[0] = null;
                } while (true);

                // Sort
                InnerList.Sort();
            }
            finally
            {
                enumDev = null;
                if (mon[0] != null)
                {
                    Marshal.ReleaseComObject(mon[0]);
                }
                mon[0] = null;
                if (enumMon != null)
                {
                    Marshal.ReleaseComObject(enumMon);
                }
                enumMon = null;
                if (comObj != null)
                {
                    Marshal.ReleaseComObject(comObj);
                }
                comObj = null;
            }
        }
コード例 #23
0
 public void Add(Person person)
 {
     InnerList.Add(person);
 }
コード例 #24
0
 // public methods...
 /// <summary>
 /// Adds file offset to the collection.
 /// </summary>
 /// <param name="offset">The offset to add.</param>
 public int Add(FileOffset offset)
 {
     return(InnerList.Add(offset));
 }
コード例 #25
0
 /// <summary>
 /// Add
 /// </summary>
 /// <param name="t">The t.</param>
 /// <returns></returns>
 public int Add(PageStripDetails t)
 {
     return(InnerList.Add(t));
 }
コード例 #26
0
 /// <summary>
 /// Adds the attribute to the collection.
 /// </summary>
 public void Add(WixXmlAttribute attribute)
 {
     InnerList.Add(attribute);
 }
コード例 #27
0
ファイル: Urls.cs プロジェクト: speedbirdservices/UfXtract
 public int Add(Url newUrl)
 {
     return(InnerList.Add(newUrl));
 }
コード例 #28
0
 public void Add(ServiceThread thread)
 {
     InnerList.Add(thread);
 }
コード例 #29
0
 /// <summary>
 /// <para>Appends a <see cref="ValidationError"/> to the end of the collection.</para>
 /// </summary>
 /// <param name="validationError">
 /// <para>The <see cref="ValidationError"/> to add.</para>
 /// </param>
 public void Add(ValidationError validationError)
 {
     InnerList.Add(validationError);
 }
コード例 #30
0
 public int Add(TalkRef value)
 {
     return(InnerList.Add(value));
 }