当前位置: 首页>>代码示例>>C#>>正文


C# SourceFile.getPackageName方法代码示例

本文整理汇总了C#中SourceFile.getPackageName方法的典型用法代码示例。如果您正苦于以下问题:C# SourceFile.getPackageName方法的具体用法?C# SourceFile.getPackageName怎么用?C# SourceFile.getPackageName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SourceFile的用法示例。


在下文中一共展示了SourceFile.getPackageName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetLocalPath

        /// <summary>
        /// 
        /// </summary>
		public String GetLocalPath(SourceFile file)
		{
			if (File.Exists(file.FullPath))
			{
				return file.FullPath;
			}
			if (m_PathMap.ContainsKey(file.FullPath))
			{
				return m_PathMap[file.FullPath];
			}
			Char pathSeparator = Path.DirectorySeparatorChar;
			foreach (Folder folder in PluginMain.settingObject.SourcePaths)
			{
				String pathFromPackage = file.getPackageName().Replace('/', pathSeparator);
                String localPath = folder.Path + pathSeparator + pathFromPackage + pathSeparator + file.Name;
				if (File.Exists(localPath))
				{
					m_PathMap[file.FullPath] = localPath;
					return localPath;
				}
			}
			return null;
        }
开发者ID:CamWiseOwl,项目名称:flashdevelop,代码行数:26,代码来源:DebuggerManager.cs

示例2: filesMatch

		/// <summary> Compare two files and determine if they are the same.
		/// Our criteria included only line count package names
		/// and the name of the class itself.  If there are
		/// any other differences then we won't be able to detect
		/// them.  We should probably do something like an MD5
		/// computation on the characters in ScriptText. Then
		/// we'd really be sure of a match.
		/// </summary>
		/// <param name="a">first file to compare
		/// </param>
		/// <param name="b">second file to compare
		/// </param>
		/// <returns>  true if files appear to be the same
		/// </returns>
		public virtual bool filesMatch(SourceFile a, SourceFile b)
		{
			bool yes = true;
			
			if (a == null || b == null)
				yes = false;
			else if (String.CompareOrdinal(a.getPackageName(), b.getPackageName()) != 0)
				yes = false;
			else if (String.CompareOrdinal(a.Name, b.Name) != 0)
				yes = false;
			else if (a.LineCount != b.LineCount)
			// warning, this is sometimes expensive, so do it last
				yes = false;
			
			return yes;
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:30,代码来源:FileInfoCache.cs

示例3: GetLocalPath

 /// <summary>
 /// 
 /// </summary>
 public String GetLocalPath(SourceFile file)
 {
     if (file == null) return null;
     String fileFullPath = file.getFullPath();
     if (m_PathMap.ContainsKey(fileFullPath))
     {
         return m_PathMap[fileFullPath];
     }
     if (File.Exists(fileFullPath))
     {
         m_PathMap[fileFullPath] = fileFullPath;
         return fileFullPath;
     }
     Char pathSeparator = Path.DirectorySeparatorChar;
     String pathFromPackage = file.getPackageName().ToString().Replace('/', pathSeparator);
     String fileName = file.getName();
     foreach (Folder folder in PluginMain.settingObject.SourcePaths)
     {
         StringBuilder localPathBuilder = new StringBuilder(260/*Windows max path length*/);
         localPathBuilder.Append(folder.Path);
         localPathBuilder.Append(pathSeparator);
         localPathBuilder.Append(pathFromPackage);
         localPathBuilder.Append(pathSeparator);
         localPathBuilder.Append(fileName);
         String localPath = localPathBuilder.ToString();
         if (File.Exists(localPath))
         {
             m_PathMap[fileFullPath] = localPath;
             return localPath;
         }
     }
     IProject project = PluginBase.CurrentProject;
     if (project != null)
     {
         var basePaths = project.SourcePaths.Length == 0 ? new[] { Path.GetDirectoryName(project.ProjectPath) } : project.SourcePaths;
         var lookupPaths = basePaths.
                             Concat(ProjectManager.PluginMain.Settings.GetGlobalClasspaths(project.Language)).
                             Select(project.GetAbsolutePath).Distinct();
         foreach (string cp in lookupPaths)
         {
             StringBuilder localPathBuilder = new StringBuilder(260/*Windows max path length*/);
             localPathBuilder.Append(cp);
             localPathBuilder.Append(pathSeparator);
             localPathBuilder.Append(pathFromPackage);
             localPathBuilder.Append(pathSeparator);
             localPathBuilder.Append(fileName);
             String localPath = localPathBuilder.ToString();
             if (File.Exists(localPath))
             {
                 m_PathMap[fileFullPath] = localPath;
                 return localPath;
             }
         }
     }
     m_PathMap[fileFullPath] = null;
     return null;
 }
开发者ID:zpLin,项目名称:flashdevelop,代码行数:60,代码来源:DebuggerManager.cs

示例4: GetLocalPath

 /// <summary>
 /// 
 /// </summary>
 public String GetLocalPath(SourceFile file)
 {
     if (file == null) return null;
     String fileFullPath = file.getFullPath();
     if (m_PathMap.ContainsKey(fileFullPath))
     {
         return m_PathMap[fileFullPath];
     }
     if (File.Exists(fileFullPath))
     {
         m_PathMap[fileFullPath] = fileFullPath;
         return fileFullPath;
     }
     Char pathSeparator = Path.DirectorySeparatorChar;
     String pathFromPackage = file.getPackageName().ToString().Replace('/', pathSeparator);
     String fileName = file.getName();
     foreach (Folder folder in PluginMain.settingObject.SourcePaths)
     {
         StringBuilder localPathBuilder = new StringBuilder(260/*Windows max path length*/);
         localPathBuilder.Append(folder.Path);
         localPathBuilder.Append(pathSeparator);
         localPathBuilder.Append(pathFromPackage);
         localPathBuilder.Append(pathSeparator);
         localPathBuilder.Append(fileName);
         String localPath = localPathBuilder.ToString();
         if (File.Exists(localPath))
         {
             m_PathMap[fileFullPath] = localPath;
             return localPath;
         }
     }
     Project project = PluginBase.CurrentProject as Project;
     if (project != null)
     {
         foreach (string cp in project.Classpaths)
         {
             StringBuilder localPathBuilder = new StringBuilder(260/*Windows max path length*/);
             localPathBuilder.Append(project.Directory);
             localPathBuilder.Append(pathSeparator);
             localPathBuilder.Append(cp);
             localPathBuilder.Append(pathSeparator);
             localPathBuilder.Append(pathFromPackage);
             localPathBuilder.Append(pathSeparator);
             localPathBuilder.Append(fileName);
             String localPath = localPathBuilder.ToString();
             if (File.Exists(localPath))
             {
                 m_PathMap[fileFullPath] = localPath;
                 return localPath;
             }
         }
     }
     m_PathMap[fileFullPath] = null;
     return null;
 }
开发者ID:thecocce,项目名称:flashdevelop,代码行数:58,代码来源:DebuggerManager.cs

示例5: GetLocalPath

 /// <summary>
 /// 
 /// </summary>
 public String GetLocalPath(SourceFile file)
 {
     if (file == null) return null;
     if (File.Exists(file.getFullPath()))
     {
         return file.getFullPath();
     }
     if (m_PathMap.ContainsKey(file.getFullPath()))
     {
         return m_PathMap[file.getFullPath()];
     }
     Char pathSeparator = Path.DirectorySeparatorChar;
     String pathFromPackage = file.getPackageName().ToString().Replace('/', pathSeparator);
     foreach (Folder folder in PluginMain.settingObject.SourcePaths)
     {
         String localPath = folder.Path + pathSeparator + pathFromPackage + pathSeparator + file.getName();
         if (File.Exists(localPath))
         {
             m_PathMap[file.getFullPath()] = localPath;
             return localPath;
         }
     }
     Project project = PluginBase.CurrentProject as Project;
     if (project != null)
     {
         foreach (string cp in project.Classpaths)
         {
             String localPath = project.Directory + pathSeparator + cp + pathSeparator + pathFromPackage + pathSeparator + file.getName();
             if (File.Exists(localPath))
             {
                 m_PathMap[file.getFullPath()] = localPath;
                 return localPath;
             }
         }
     }
     return null;
 }
开发者ID:vovkasm,项目名称:flashdevelop,代码行数:40,代码来源:DebuggerManager.cs


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