RenderingLibrary.Graphics.SolidRectangle.GetAtlasedTexture C# (CSharp) Method

GetAtlasedTexture() private method

Checks if the Colored Rectangle texture is located in a loaded atlas.
private GetAtlasedTexture ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework.Graphics.Texture2D
        private Texture2D GetAtlasedTexture()
        {
            Texture2D texture = null;

            if (ToolsUtilities.FileManager.IsRelative(AtlasedTextureName))
            {
                AtlasedTextureName = ToolsUtilities.FileManager.RelativeDirectory + AtlasedTextureName;

                AtlasedTextureName = ToolsUtilities.FileManager.RemoveDotDotSlash(AtlasedTextureName);
            }

            // see if an atlas exists:
            var atlasedTexture =
                global::RenderingLibrary.Content.LoaderManager.Self.TryLoadContent<AtlasedTexture>(AtlasedTextureName);

            if (atlasedTexture != null)
            {
                mSourceRect = new Rectangle(atlasedTexture.SourceRectangle.Left + 1,
                    atlasedTexture.SourceRectangle.Top + 1, 1, 1);

                texture = atlasedTexture.Texture;
            }

            return texture;
        }