コード例 #1
0
ファイル: ImageResource.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheType geocacheType)
        {
            string result;
            string fn;

            if (imageSize == Framework.Data.ImageSize.Map)
            {
                fn = string.Format("{0}.png", geocacheType.ID);
            }
            else
            {
                fn = string.Format("{0}.gif", geocacheType.ID);
            }
            result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "cachetypes", fn });
            if (!File.Exists(result))
            {
                if (imageSize != Framework.Data.ImageSize.Default)
                {
                    result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "cachetypes", fn });
                    if (!File.Exists(result))
                    {
                        result = null;
                    }
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: ImageSupport.cs プロジェクト: pheijmans-zz/GAPP
        public string GetDefaultImagePath(Framework.Data.ImageSize imageSize)
        {
            string result;

            result = Path.Combine(Path.Combine(_baseImagePath, imageSize.ToString()), DEFAULT_IMAGE);
            return(result);
        }
コード例 #3
0
ファイル: ImageResource.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheAttribute attr, Framework.Data.GeocacheAttribute.State state)
        {
            string result;
            string fn;
            string ext;

            if (attr.ID < 100)
            {
                ext = "gif";
            }
            else
            {
                //above 100 = opencaching.de
                ext = "png";
            }
            if (state == Framework.Data.GeocacheAttribute.State.Yes)
            {
                fn = string.Format("{0}.{1}", attr.ID, ext);
            }
            else if (state == Framework.Data.GeocacheAttribute.State.No)
            {
                fn = string.Format("_{0}.{1}", attr.ID, ext);
            }
            else
            {
                return(null);
            }
            result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "attributes", fn });
            if (!File.Exists(result))
            {
                if (imageSize != Framework.Data.ImageSize.Default)
                {
                    result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "attributes", fn });
                    if (!File.Exists(result))
                    {
                        result = null;
                    }
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
コード例 #4
0
ファイル: ImageResource.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheType geocacheType, bool corrected)
        {
            string result;
            string fn;

            if (imageSize == Framework.Data.ImageSize.Map)
            {
                fn = string.Format("{1}{0}.png", geocacheType.ID, corrected ? "c" : "");
            }
            else
            {
                fn = string.Format("{1}{0}.gif", geocacheType.ID, corrected ? "c" : "");
            }
            result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "cachetypes", fn });
            if (!File.Exists(result))
            {
                result = GetImagePath(imageSize, geocacheType);
            }
            return(result);
        }
コード例 #5
0
ファイル: ImageSupport.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Interfaces.ICore core, Framework.Data.ImageSize imageSize, Framework.Data.CompassDirection compassDir)
        {
            string result = null;

            foreach (Framework.Interfaces.IImageResource ir in _imageResourcePlugins)
            {
                result = ir.GetImagePath(imageSize, compassDir);
                if (!string.IsNullOrEmpty(result))
                {
                    break;
                }
            }
            if (result == null && imageSize != Framework.Data.ImageSize.Default)
            {
                result = GetImagePath(core, Framework.Data.ImageSize.Default, compassDir);
            }
            else if (string.IsNullOrEmpty(result))
            {
                //select default
                result = GetDefaultImagePath(imageSize);
            }
            return(result);
        }
コード例 #6
0
ファイル: ImageSupport.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Interfaces.ICore core, Framework.Data.ImageSize imageSize, Framework.Data.GeocacheAttribute attr, Framework.Data.GeocacheAttribute.State state)
        {
            string result = null;

            foreach (Framework.Interfaces.IImageResource ir in _imageResourcePlugins)
            {
                result = ir.GetImagePath(imageSize, attr, state);
                if (!string.IsNullOrEmpty(result))
                {
                    break;
                }
            }
            if (result == null && imageSize != Framework.Data.ImageSize.Default)
            {
                result = GetImagePath(core, Framework.Data.ImageSize.Default, attr, state);
            }
            else if (string.IsNullOrEmpty(result))
            {
                //select default
                result = GetDefaultImagePath(imageSize);
            }
            return(result);
        }
コード例 #7
0
ファイル: ImageResource.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.CompassDirection compassDir)
        {
            string result;
            string fn = string.Format("{0}.gif", compassDir.ToString());

            result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "compass", fn });
            if (!File.Exists(result))
            {
                if (imageSize != Framework.Data.ImageSize.Default)
                {
                    result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "compass", fn });
                    if (!File.Exists(result))
                    {
                        result = null;
                    }
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
コード例 #8
0
ファイル: ImageResource.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheContainer container)
        {
            string result;
            string fn;

            fn     = string.Format("{0}.gif", container.Name.Replace(' ', '_'));
            result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "container", fn });
            if (!File.Exists(result))
            {
                if (imageSize != Framework.Data.ImageSize.Default)
                {
                    result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "container", fn });
                    if (!File.Exists(result))
                    {
                        result = null;
                    }
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
コード例 #9
0
ファイル: ImageResource.cs プロジェクト: pheijmans-zz/GAPP
        public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.WaypointType waypointType)
        {
            string result;
            string fn;

            fn     = string.Format("{0}.gif", waypointType.ID);
            result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "wptypes", fn });
            if (!File.Exists(result))
            {
                if (imageSize != Framework.Data.ImageSize.Default)
                {
                    result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "wptypes", fn });
                    if (!File.Exists(result))
                    {
                        result = null;
                    }
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
コード例 #10
0
ファイル: ImageGrabber.cs プロジェクト: pheijmans-zz/GAPP
 public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.CompassDirection compassDir)
 {
     return(null);
 }
コード例 #11
0
ファイル: ImageGrabber.cs プロジェクト: pheijmans-zz/GAPP
 public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheContainer container)
 {
     return(null);
 }
コード例 #12
0
ファイル: ImageGrabber.cs プロジェクト: pheijmans-zz/GAPP
 public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.WaypointType waypointType)
 {
     return(null);
 }
コード例 #13
0
ファイル: ImageGrabber.cs プロジェクト: pheijmans-zz/GAPP
 public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.LogType logType)
 {
     return(null);
 }
コード例 #14
0
ファイル: ImageGrabber.cs プロジェクト: pheijmans-zz/GAPP
 public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheAttribute attr, Framework.Data.GeocacheAttribute.State state)
 {
     return(null);
 }
コード例 #15
0
ファイル: ImageGrabber.cs プロジェクト: pheijmans-zz/GAPP
 public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheType geocacheType, bool corrected)
 {
     return(null);
 }