Example #1
0
        public GifImagesObj Get(string search = "", int limit = 25, int offset = 0, string Type = "giphy")
        {
            IGifImages SelectedGifImages = GIFactory.GetInstance(Type);
            var        imagesObj         = SelectedGifImages.get(search, offset, limit);

            return(imagesObj);
        }
Example #2
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                Gorgon.Log.Print("Gorgon Graphics Context shutting down...", LoggingLevel.Simple);

                if (!IsDeferred)
                {
                    _trackedObjects.ReleaseAll();
                }
                else
                {
                    Context.ClearState();
                }

                DestroyInterfaces();

                // Only clean up the context if the context is deferred.
                if (IsDeferred)
                {
                    if (_commands != null)
                    {
                        // Release any outstanding command lists.
                        while (_commands.Count > 0)
                        {
                            ReleaseCommands(_commands[_commands.Count - 1]);
                        }
                    }

                    if (Context != null)
                    {
                        Context.Flush();
                        Context.Dispose();
                    }

                    Context = null;

                    // Remove us from object tracking.
                    ImmediateContext.RemoveTrackedObject(this);
                }
                else
                {
                    Gorgon.Log.Print("Removing D3D11 Device object...", LoggingLevel.Verbose);

                    // Destroy the video device interface.
                    if (D3DDevice != null)
                    {
                        D3DDevice.Dispose();
                        D3DDevice = null;
                    }

                    if (Adapter != null)
                    {
                        Adapter.Dispose();
                        Adapter = null;
                    }

                    if (GIFactory != null)
                    {
                        GIFactory.Dispose();
                        GIFactory = null;
                    }

                    if (VideoDevice != null)
                    {
                        VideoDevice.Graphics = null;
                    }

                    Gorgon.Log.Print("Removing DXGI factory interface...", LoggingLevel.Verbose);
                    if (GIFactory != null)
                    {
                        GIFactory.Dispose();
                        GIFactory = null;
                    }

                    // Remove us from the object tracker.
                    Gorgon.RemoveTrackedObject(this);
                }

                Gorgon.Log.Print("Gorgon Graphics Context shut down successfully", LoggingLevel.Simple);
            }

            _disposed = true;
        }