• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MapType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MapType的典型用法代码示例。如果您正苦于以下问题:C# MapType类的具体用法?C# MapType怎么用?C# MapType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MapType类属于命名空间,在下文中一共展示了MapType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CacheTiles

        bool CacheTiles(ref MapType[] types, int zoom, GPoint p)
        {
            foreach(MapType type in types)
             {
            Exception ex;
            PureImage img;

            // tile number inversion(BottomLeft -> TopLeft) for pergo maps
            if(type == MapType.PergoTurkeyMap)
            {
               img = GMaps.Instance.GetImageFrom(type, new GPoint(p.X, maxOfTiles.Height - p.Y), zoom, out ex);
            }
            else // ok
            {
               img = GMaps.Instance.GetImageFrom(type, p, zoom, out ex);
            }

            if(img != null)
            {
               img.Dispose();
               img = null;
            }
            else
            {
               return false;
            }
             }
             return true;
        }
开发者ID:LeoTosti,项目名称:x-drone,代码行数:29,代码来源:TilePrefetcher.cs


示例2: LumpFactory

		/// <summary>
		/// Factory method to parse a <c>byte</c> array into a <c>List</c> of <see cref="Cubemap"/> objects.
		/// </summary>
		/// <param name="data">The data to parse.</param>
		/// <param name="type">The map type.</param>
		/// <param name="version">The version of this lump.</param>
		/// <returns>A <c>List</c> of <see cref="Cubemap"/> objects.</returns>
		/// <exception cref="ArgumentNullException"><paramref name="data" /> was <c>null</c>.</exception>
		/// <exception cref="ArgumentException">This structure is not implemented for the given maptype.</exception>
		public static List<Cubemap> LumpFactory(byte[] data, MapType type, int version = 0) {
			if (data == null) {
				throw new ArgumentNullException();
			}
			int structLength = 0;
			switch (type) {
				case MapType.Source17:
				case MapType.Source18:
				case MapType.Source19:
				case MapType.Source20:
				case MapType.Source21:
				case MapType.Source22:
				case MapType.Source23:
				case MapType.Source27:
				case MapType.TacticalInterventionEncrypted:
				case MapType.L4D2:
				case MapType.Vindictus:
				case MapType.DMoMaM: {
					structLength = 16;
					break;
				}
				default: {
					throw new ArgumentException("Map type " + type + " isn't supported by the SourceCubemap lump factory.");
				}
			}
			int offset = 0;
			List<Cubemap> lump = new List<Cubemap>(data.Length / structLength);
			byte[] bytes = new byte[structLength];
			for (int i = 0; i < data.Length / structLength; ++i) {
				Array.Copy(data, (i * structLength), bytes, 0, structLength);
				lump.Add(new Cubemap(bytes, type, version));
				offset += structLength;
			}
			return lump;
		}
开发者ID:wfowler1,项目名称:LibBSP,代码行数:44,代码来源:Cubemap.cs


示例3: Cubemap

		/// <summary>
		/// Creates a new <see cref="Cubemap"/> object from a <c>byte</c> array.
		/// </summary>
		/// <param name="data"><c>byte</c> array to parse.</param>
		/// <param name="type">The map type.</param>
		/// <param name="version">The version of this lump.</param>
		/// <exception cref="ArgumentNullException"><paramref name="data" /> was <c>null</c>.</exception>
		/// <exception cref="ArgumentException">This structure is not implemented for the given maptype.</exception>
		public Cubemap(byte[] data, MapType type, int version = 0) : this() {
			if (data == null) {
				throw new ArgumentNullException();
			}
			switch (type) {
				case MapType.Source17:
				case MapType.Source18:
				case MapType.Source19:
				case MapType.Source20:
				case MapType.Source21:
				case MapType.Source22:
				case MapType.Source23:
				case MapType.Source27:
				case MapType.TacticalInterventionEncrypted:
				case MapType.L4D2:
				case MapType.Vindictus:
				case MapType.DMoMaM: {
					origin = new Vector3(BitConverter.ToInt32(data, 0), BitConverter.ToInt32(data, 4), BitConverter.ToInt32(data, 8));
					size = BitConverter.ToInt32(data, 12);
					break;
				}
				default: {
					throw new ArgumentException("Map type " + type + " isn't supported by the SourceCubemap class.");
				}
			}
		}
开发者ID:wfowler1,项目名称:LibBSP,代码行数:34,代码来源:Cubemap.cs


示例4: SetSummaryParameters

        void SetSummaryParameters(DatabaseCommand command, MapType map, GameModeType gameMode, Summoner summoner, PlayerStatSummary summary, bool forceNullRating)
        {
            if (forceNullRating)
            {
                command.Set("current_rating", DbType.Int32, null);
                command.Set("top_rating", DbType.Int32, null);
            }
            else
            {
                //Zero rating means that the Elo is below 1200 and is not revealed by the server
                if (summary.rating == 0)
                    command.Set("current_rating", DbType.Int32, null);
                else
                    command.Set("current_rating", summary.rating);
                command.Set("top_rating", summary.maxRating);
            }

            command.Set("summoner_id", summoner.Id);
            command.Set("map", (int)map);
            command.Set("game_mode", (int)gameMode);

            command.Set("wins", summary.wins);
            command.Set("losses", summary.losses);
            command.Set("leaves", summary.leaves);
        }
开发者ID:tsubus,项目名称:RiotControl,代码行数:25,代码来源:UpdateSummoner.cs


示例5: Priority

 public override int? Priority(Type sourceType, Type destinationType, MapType mapType)
 {
     if (sourceType.IsCollection() && destinationType.IsCollection())
         return -125;
     else
         return null;
 }
开发者ID:xcolon,项目名称:Mapster,代码行数:7,代码来源:CollectionAdapter.cs


示例6: GoogleMapsDisclaimer

 /// <summary>
 /// Initialize with custom parameters
 /// </summary>
 /// <param name="mapToWgs84Transform">Transformation to transform MapCoordinates to WGS84</param>
 /// <param name="mapType">Type of Map Displayed</param>
 /// <param name="disclaimerDownloaded">Optional EventHandler that is called after Disclaimer Async Download (to be used to refresh map)</param>
 /// <param name="downloadAsync">wether to download disclaimer information async (non blocking operation)</param>
 public GoogleMapsDisclaimer(IMathTransform mapToWgs84Transform, MapType mapType, EventHandler disclaimerDownloaded, bool downloadAsync) : this()
 {
     m_MathTransform = mapToWgs84Transform;
     m_RunAsync = downloadAsync;
     m_DownloadComplete = disclaimerDownloaded;
     m_MapType = mapType;
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:14,代码来源:GoogleMapsDisclamer.cs


示例7: CreateExportUtility

 public IExportUtility CreateExportUtility(MapType mapType, ExportType exportType)
 {
     IExportUtility exportUtil = null;
     switch (mapType)
     {
         case MapType.IBIS:
             switch (exportType)
             {
                 case ExportType.Compendium:
                     exportUtil = new CompendiumExportUtility(MapManager);
                     break;
                 case ExportType.GlymaXml:
                     exportUtil = new GlymaXmlExportUtility(MapManager);
                     break;
                 case ExportType.PDF:
                     exportUtil = new PdfExportUtility(MapManager);
                     break;
                 case ExportType.Word:
                     exportUtil = new WordExportUtility(MapManager);
                     break;
             }
             break;
         //TODO: Handle other map types with other export utilities.
     }
     
     return exportUtil;
 }
开发者ID:chris-tomich,项目名称:Glyma,代码行数:27,代码来源:ExportUtilityFactory.cs


示例8: MapGenerator

        public MapGenerator(MapType Type, Map Map)
        {
            // List of map connections available
            available_conns = new List<Connector>();
            rnd = new Random();

            type = Type;
            map = Map;

            width = 50;
            height = 50;

            map.mapData = new int[width, height];
            map.Width = width;
            map.Height = height;

            map.entities = new List<Entity>();

            SetTypeTextures();

            // Fills map
            FillRandRect(0, 0, width - 1, height - 1, 1, 3);

            // Randomly place the first connector
            Connector connection = new Connector();
            connection.posX = width / 2;
            connection.posY = height / 2;
            connection.dir = GetRandomDirection();
            connection.noDoor = true;

            available_conns.Add(connection);

            // Generate some rooms
            int numGenerated = 0;
            int tries = 0;
            while (numGenerated < 20 && tries < 30 && available_conns.Count > 0)
            {
                // Attempt to make a room with the first connector
                Connector tryThis = available_conns.First();
                bool didGenerate = MakeRoom(tryThis);
                if (didGenerate)
                {
                    // This connection generated fine, remove the connector
                    numGenerated++;
                    available_conns.Remove(tryThis);
                }
                else
                {
                    // Check to see if we've tried too many times already
                    if (tries++ > 2)
                    {
                        tries = 0;
                        available_conns.Remove(tryThis);
                    }
                }
            }

            PlaceStairsUp();
            PlaceStairsDown();
        }
开发者ID:THEGUY3000,项目名称:zunehack,代码行数:60,代码来源:MapGenerator.cs


示例9: LoadAggregatedChampionStatistics

 List<AggregatedChampionStatistics> LoadAggregatedChampionStatistics(Summoner summoner, MapType map, GameModeType gameMode, NpgsqlConnection database)
 {
     const string query =
         "with source as " +
         "(select player.champion_id, player.won, player.kills, player.deaths, player.assists, player.gold, player.minion_kills from game_result, player where game_result.map = cast(:map as map_type) and game_result.game_mode = cast(:game_mode as game_mode_type) and (game_result.team1_id = player.team_id or game_result.team2_id = player.team_id) and player.summoner_id = :summoner_id) " +
         "select statistics.champion_id, coalesce(champion_wins.wins, 0) as wins, coalesce(champion_losses.losses, 0) as losses, statistics.kills, statistics.deaths, statistics.assists, statistics.gold, statistics.minion_kills from " +
         "(select source.champion_id, sum(source.kills) as kills, sum(source.deaths) as deaths, sum(source.assists) as assists, sum(source.gold) as gold, sum(source.minion_kills) as minion_kills from source group by source.champion_id) " +
         "as statistics " +
         "left outer join " +
         "(select champion_id, count(*) as wins from source where won = true group by champion_id) " +
         "as champion_wins " +
         "on statistics.champion_id = champion_wins.champion_id " +
         "left outer join " +
         "(select champion_id, count(*) as losses from source where won = false group by champion_id) " +
         "as champion_losses " +
         "on statistics.champion_id = champion_losses.champion_id;";
     DatabaseCommand select = GetCommand(query, database);
     select.SetEnum("map", map.ToEnumString());
     select.SetEnum("game_mode", gameMode.ToEnumString());
     select.Set("summoner_id", summoner.Id);
     using (NpgsqlDataReader reader = select.ExecuteReader())
     {
         List<AggregatedChampionStatistics> output = new List<AggregatedChampionStatistics>();
         while (reader.Read())
         {
             AggregatedChampionStatistics statistics = new AggregatedChampionStatistics(reader);
             statistics.ChampionName = GetChampionName(statistics.ChampionId);
             output.Add(statistics);
         }
         output.Sort();
         return output;
     }
 }
开发者ID:LeeSeungSoo,项目名称:RiotControl,代码行数:33,代码来源:Database.cs


示例10: MapInfo

 public MapInfo(PureProjection Projection, RectLatLng Area, int Zoom, MapType Type)
 {
     this.Projection = Projection;
      this.Area = Area;
      this.Zoom = Zoom;
      this.Type = Type;
 }
开发者ID:wrbrooks,项目名称:VB3,代码行数:7,代码来源:StaticImage.cs


示例11: ProcessSummary

        void ProcessSummary(MapType map, GameModeType gameMode, string target, Summoner summoner, List<PlayerStatSummary> summaries, DbConnection connection, bool forceNullRating = false)
        {
            foreach (var summary in summaries)
            {
                if (summary.playerStatSummaryType != target)
                    continue;
                using (var update = Command("update summoner_rating set wins = :wins, losses = :losses, leaves = :leaves, kills = :kills, deaths = :deaths, assists = :assists, current_rating = :current_rating, top_rating = :top_rating where summoner_id = :summoner_id and map = :map and game_mode = :game_mode", connection))
                {
                    SetSummaryParameters(update, map, gameMode, summoner, summary, forceNullRating);

                    int rowsAffected = update.Execute();
                    if (rowsAffected == 0)
                    {
                        //We're dealing with a new summoner rating entry, insert it
                        using (var insert = Command("insert into summoner_rating (summoner_id, map, game_mode, wins, losses, leaves, kills, deaths, assists, current_rating, top_rating) values (:summoner_id, :map, :game_mode, :wins, :losses, :leaves, :kills, :deaths, :assists, :current_rating, :top_rating)", connection))
                        {
                            SetSummaryParameters(insert, map, gameMode, summoner, summary, forceNullRating);
                            insert.Execute();
                            //SummonerMessage(string.Format("New rating for mode {0}", target), summoner);
                        }
                    }
                    else
                    {
                        //This rating was already in the database and was updated
                        //SummonerMessage(string.Format("Updated rating for mode {0}", target), summoner);
                    }
                    break;
                }
            }
        }
开发者ID:christallire,项目名称:RiotControl,代码行数:30,代码来源:UpdateSummoner.cs


示例12: GenerateMapScriptCore

        /// <summary>
        /// Registers the JavaScript to display the map.
        /// </summary>
        /// <param name="scriptManager">The page's script manager.</param>
        /// <param name="mapType">Type of the map.</param>
        /// <param name="mapSectionId">The ID of the section (div) on the page in which the map should be created.</param>
        /// <param name="currentLocationSpanId">The ID of the span showing the current location text.</param>
        /// <param name="noLocationSpanId">The ID of the span shown when no location is selected.</param>
        /// <param name="instructionSpanId">The ID of the span with driving directions, etc.</param>
        /// <param name="directionsLinkId">The ID of the link to driving directions.</param>
        /// <param name="directionsSectionId">The ID of the section (div) with driving directions text.</param>
        /// <param name="locations">The list of locations to display.</param>
        /// <param name="showAllLocationsOnLoad">if set to <c>true</c> shows the map with all locations on it by default.</param>
        public override void GenerateMapScriptCore(ScriptManager scriptManager, MapType mapType, string mapSectionId, string currentLocationSpanId, string noLocationSpanId, string instructionSpanId, string directionsLinkId, string directionsSectionId, LocationCollection locations, bool showAllLocationsOnLoad)
        {
            ICollection<JavaScript.Location> locationsAsJson = locations.AsJson();
            string mapParameters = String.Format(CultureInfo.InvariantCulture, "currentLocationSpan: {0}, noLocationSpan: {1}, instructionSpan: {2}, directionsLink: {3}, directionsSection: {4}, mapType: {5}, locationsArray: {6}", GetElementJavaScript(currentLocationSpanId), GetElementJavaScript(noLocationSpanId), GetElementJavaScript(instructionSpanId), GetElementJavaScript(directionsLinkId), GetElementJavaScript(directionsSectionId), ConvertMapType(mapType), new JavaScriptSerializer().Serialize(locationsAsJson));

            scriptManager.Scripts.Add(new ScriptReference(GetLoaderUrl(this.ApiKey)));
            scriptManager.Scripts.Add(new ScriptReference("Engage.Dnn.Locator.JavaScript.BaseLocator.js", "EngageLocator"));
            scriptManager.Scripts.Add(new ScriptReference("Engage.Dnn.Locator.JavaScript.GoogleLocator.js", "EngageLocator"));
            ScriptManager.RegisterStartupScript(
                    scriptManager.Page,
                    typeof(GoogleProvider),
                    "Initialize",
                    "google.setOnLoadCallback(jQuery(function(){ jQuery.noConflict(); $create(Engage.Dnn.Locator.GoogleMap, {" + mapParameters + "}, {}, {}, $get('" + mapSectionId + "')); }));",
                    true);

            if (showAllLocationsOnLoad)
            {
                ScriptManager.RegisterStartupScript(
                        scriptManager.Page,
                        typeof(GoogleProvider),
                        "showAllLocations",
                        "google.setOnLoadCallback(jQuery(function(){ $find('" + mapSectionId + "$GoogleMap').showAllLocations(); }));",
                        true);
            }
        }
开发者ID:EngageSoftware,项目名称:Engage-Locator,代码行数:38,代码来源:GoogleProvider.cs


示例13: LumpFactory

		/// <summary>
		/// Factory method to parse a <c>byte</c> array into a <c>List</c> of <see cref="Node"/> objects.
		/// </summary>
		/// <param name="data">The data to parse.</param>
		/// <param name="type">The map type.</param>
		/// <param name="version">The version of this lump.</param>
		/// <returns>A <c>List</c> of <see cref="Node"/> objects.</returns>
		/// <exception cref="ArgumentNullException"><paramref name="data" /> was <c>null</c>.</exception>
		/// <exception cref="ArgumentException">This structure is not implemented for the given maptype.</exception>
		public static List<Node> LumpFactory(byte[] data, MapType type, int version = 0) {
			if (data == null) {
				throw new ArgumentNullException();
			}
			int structLength = 0;
			switch (type) {
				case MapType.Quake: {
					structLength = 24;
					break;
				}
				case MapType.Quake2:
				case MapType.SiN:
				case MapType.SoF:
				case MapType.Daikatana: {
					structLength = 28;
					break;
				}
				case MapType.Source17:
				case MapType.Source18:
				case MapType.Source19:
				case MapType.Source20:
				case MapType.Source21:
				case MapType.Source22:
				case MapType.Source23:
				case MapType.Source27:
				case MapType.L4D2:
				case MapType.TacticalInterventionEncrypted:
				case MapType.DMoMaM: {
					structLength = 32;
					break;
				}
				case MapType.Vindictus: {
					structLength = 48;
					break;
				}
				case MapType.Quake3:
				case MapType.FAKK:
				case MapType.CoD:
				case MapType.STEF2:
				case MapType.STEF2Demo:
				case MapType.MOHAA:
				case MapType.Raven:
				case MapType.Nightfire: {
					structLength = 36;
					break;
				}
				default: {
					throw new ArgumentException("Map type " + type + " isn't supported by the Node lump factory.");
				}
			}
			int offset = 0;
			List<Node> lump = new List<Node>(data.Length / structLength);
			byte[] bytes = new byte[structLength];
			for (int i = 0; i < data.Length / structLength; ++i) {
				Array.Copy(data, (i * structLength), bytes, 0, structLength);
				lump.Add(new Node(bytes, type, version));
				offset += structLength;
			}
			return lump;
		}
开发者ID:wfowler1,项目名称:LibBSP,代码行数:69,代码来源:Node.cs


示例14: GoogleMapsDisclaimer

 /// <summary>
 /// Initialize with custom parameters
 /// </summary>
 /// <remarks>
 /// IMPORTANT: In Async mode you need to use UpdateBoundingBox when the MapBox/MapImage center or ZoomLevel changes, else the text will be wrong
 /// </remarks>
 /// <param name="mapToWgs84Transform">Transformation to transform MapCoordinates to WGS84</param>
 /// <param name="mapType">Type of Map Displayed</param>
 /// <param name="disclaimerDownloaded">Optional EventHandler that is called after Disclaimer Async Download (to be used to refresh map)</param>
 /// <param name="runInAsyncMode">whether to download disclaimer information async (non blocking operation)</param>
 public GoogleMapsDisclaimer(IMathTransform mapToWgs84Transform, MapType mapType, EventHandler disclaimerDownloaded, bool runInAsyncMode) : this()
 {
     _mathTransform = mapToWgs84Transform;
     _runInRunAsyncMode = runInAsyncMode;
     _downloadCompleteHandler = disclaimerDownloaded;
     _mapType = mapType;
 }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:17,代码来源:GoogleMapsDisclamer.cs


示例15: playGame

		/// <summary>
		/// Sets up the game to be played in the map specified
		/// </summary>
		/// <param name="mode">Mode.</param>
		/// <param name="map">Map.</param>
		public void playGame(GameModeType mode, MapType map){

			Debug.Log ("about to load scene");

			switch(map){

			case MapType.Prototype:
				SceneManager.LoadScene ("PrototypeMap", LoadSceneMode.Single);		
				break;

			}

			Debug.Log ("Scene loaded");

			GameObject container = new GameObject ("_SCRIPTS_");
			Object.DontDestroyOnLoad (container);

			switch(mode){

			case GameModeType.ProtectTheQueen:
				
				currentModeBeingPlayed = container.AddComponent<ProtectTheQueen.ProtectTheQueenModeBehavior> ();
				break;

			}


		}
开发者ID:VideoGameDevClub,项目名称:VacuumCleanSupreme,代码行数:33,代码来源:GameManager.cs


示例16: Edge

		/// <summary>
		/// Creates a new <see cref="Edge"/> object from a <c>byte</c> array.
		/// </summary>
		/// <param name="data"><c>byte</c> array to parse.</param>
		/// <param name="type">The map type.</param>
		/// <param name="version">The version of this lump.</param>
		/// <exception cref="ArgumentNullException"><paramref name="data"/> was <c>null</c>.</exception>
		/// <exception cref="ArgumentException">This structure is not implemented for the given maptype.</exception>
		public Edge(byte[] data, MapType type, int version = 0) : this() {
			if (data == null) {
				throw new ArgumentNullException();
			}
			switch (type) {
				case MapType.Quake:
				case MapType.SiN:
				case MapType.Daikatana:
				case MapType.Source17:
				case MapType.Source18:
				case MapType.Source19:
				case MapType.Source20:
				case MapType.Source21:
				case MapType.Source22:
				case MapType.Source23:
				case MapType.Source27:
				case MapType.L4D2:
				case MapType.TacticalInterventionEncrypted:
				case MapType.DMoMaM:
				case MapType.Quake2:
				case MapType.SoF: {
					firstVertex = BitConverter.ToUInt16(data, 0);
					secondVertex = BitConverter.ToUInt16(data, 2);
					break;
				}
				case MapType.Vindictus: {
					firstVertex = BitConverter.ToInt32(data, 0);
					secondVertex = BitConverter.ToInt32(data, 4);
					break;
				}
				default: {
					throw new ArgumentException("Map type " + type + " isn't supported by the Edge class.");
				}
			}
		}
开发者ID:wfowler1,项目名称:LibBSP,代码行数:43,代码来源:Edge.cs


示例17: PutImageToCache

        public bool PutImageToCache(MemoryStream tile, MapType type, Point pos, int zoom)
        {
            FileStream fs = null;
            try
            {
                string fileName = GetFilename(type, pos, zoom, true);
                fs = new FileStream(fileName, FileMode.Create);
                tile.WriteTo(fs);
                tile.Flush();
                fs.Close();
                fs.Dispose();
                tile.Seek(0, SeekOrigin.Begin);

                return true;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Error in FilePureImageCache.PutImageToCache:\r\n" + ex.ToString());
                if (fs != null)
                {
                    fs.Close();
                    fs.Dispose();
                }
                return false;
            }
        }
开发者ID:deb761,项目名称:BikeMap,代码行数:26,代码来源:FilePureImageCache.cs


示例18: GetImageFromCache

 public PureImage GetImageFromCache(MapType type, Point pos, int zoom)
 {
     try
     {
         string fileName = GetFilename(type, pos, zoom, false);
         FileInfo fi = new FileInfo(fileName);
         if (fi.Exists && fi.LastWriteTimeUtc > _CacheDate)
         {
             Image image = Image.FromFile(fileName);
             WindowsFormsImage img = new WindowsFormsImage();
             img.Img = image;
             img.Data = new MemoryStream();
             image.Save(img.Data, System.Drawing.Imaging.ImageFormat.Jpeg);
             System.Diagnostics.Debug.WriteLine(string.Format("{0} FilePureImageCache.GetImageFromCache(type={1}, pos={2}, zoom={3}, file date={4}) succeeded.", DateTime.Now, type, pos, zoom, fi.LastWriteTimeUtc));
             return img;
         }
         else
         {
             System.Diagnostics.Debug.WriteLine(string.Format("{0} FilePureImageCache.GetImageFromCache(type={1}, pos={2}, zoom={3}) NOT IN CACHE.", DateTime.Now, type, pos, zoom));
             return null;
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Error in FilePureImageCache.GetImageFromCache:\r\n" + ex.ToString());
         return null;
     }
 }
开发者ID:deb761,项目名称:BikeMap,代码行数:28,代码来源:FilePureImageCache.cs


示例19: GetTile

 public MapTile GetTile(int zoom, int tileX, int tileY, MapType type)
 {
     string key = String.Format("{0},{1},{2},{3}", zoom, tileX, tileY, type);
     cacheLock.EnterUpgradeableReadLock();
     try
     {
         if (cache.ContainsKey(key))
         {
             cacheAccessCounter[key] = DateTime.Now.Ticks;
             return cache[key];
         }
         else
         {
             MapTile tile = innerFactory.GetTile(zoom, tileX, tileY, type);
             cacheLock.EnterWriteLock();
             try
             {
                 if (tile != null)
                 {
                     cache[key] = tile;
                     cacheAccessCounter[key] = DateTime.Now.Ticks;
                 }
                 return tile;
             }
             finally
             {
                 cacheLock.ExitWriteLock();
             }
         }
     }
     finally
     {
         cacheLock.ExitUpgradeableReadLock();
     }
 }
开发者ID:253525306,项目名称:myfriendsaround,代码行数:35,代码来源:InMemoryCacheMapTileFactory.cs


示例20: CanMap

        protected override bool CanMap(Type sourceType, Type destinationType, MapType mapType)
        {
            if (sourceType == typeof (string) || sourceType == typeof (object))
                return false;

            var dictType = destinationType.GetDictionaryType();
            return dictType?.GetGenericArguments()[0] == typeof (string);
        }
开发者ID:centur,项目名称:Mapster,代码行数:8,代码来源:DictionaryAdapter.cs



注:本文中的MapType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MapView类代码示例发布时间:2022-05-24
下一篇:
C# MapToMeta类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap