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


C# FileCopySet.Add方法代码示例

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


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

示例1: PopulateSupportFileListInternal

		void PopulateSupportFileListInternal (FileCopySet list, ConfigurationSelector configuration)
		{
			if (supportReferDistance <= 2)
				base.PopulateSupportFileList (list, configuration);

			//rename the app.config file
			list.Remove ("app.config");
			list.Remove ("App.config");
			
			ProjectFile appConfig = Files.FirstOrDefault (f => f.FilePath.FileName.Equals ("app.config", StringComparison.CurrentCultureIgnoreCase));
			if (appConfig != null) {
				string output = GetOutputFileName (configuration).FileName;
				list.Add (appConfig.FilePath, true, output + ".config");
			}
			
			//collect all the "local copy" references and their attendant files
			foreach (ProjectReference projectReference in References) {
				if (!projectReference.LocalCopy || !projectReference.CanSetLocalCopy)
					continue;

				if (ParentSolution != null && projectReference.ReferenceType == ReferenceType.Project) {
					DotNetProject p = ParentSolution.FindProjectByName (projectReference.Reference) as DotNetProject;

					if (p == null) {
						LoggingService.LogWarning ("Project '{0}' referenced from '{1}' could not be found", projectReference.Reference, this.Name);
						continue;
					}
					DotNetProjectConfiguration conf = p.GetConfiguration (configuration) as DotNetProjectConfiguration;
					//VS COMPAT: recursively copy references's "local copy" files
					//but only copy the "copy to output" files from the immediate references
					if (processedProjects.Add (p) || supportReferDistance == 1) {
						foreach (var v in p.GetOutputFiles (configuration))
							list.Add (v, true, v.CanonicalPath.ToString ().Substring (conf.OutputDirectory.CanonicalPath.ToString ().Length + 1));

						foreach (var v in p.GetSupportFileList (configuration))
							list.Add (v.Src, v.CopyOnlyIfNewer, v.Target);
					}
				}
				else if (projectReference.ReferenceType == ReferenceType.Assembly) {
					// VS COMPAT: Copy the assembly, but also all other assemblies referenced by it
					// that are located in the same folder
					foreach (string file in GetAssemblyRefsRec (projectReference.Reference, new HashSet<string> ())) {
						// Indirectly referenced assemblies are only copied if a newer copy doesn't exist. This avoids overwritting directly referenced assemblies
						// by indirectly referenced stale copies of the same assembly. See bug #655566.
						bool copyIfNewer = file != projectReference.Reference;
						list.Add (file, copyIfNewer);
						if (File.Exists (file + ".config"))
							list.Add (file + ".config", copyIfNewer);
						string mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (file);
						if (File.Exists (mdbFile))
							list.Add (mdbFile, copyIfNewer);
					}
				}
				else if (projectReference.ReferenceType == ReferenceType.Custom) {
					foreach (string refFile in projectReference.GetReferencedFileNames (configuration))
						list.Add (refFile);
				}
			}
		}
开发者ID:John-Colvin,项目名称:monodevelop,代码行数:59,代码来源:DotNetProject.cs

示例2: PopulateSupportFileList

		/// <summary>
		/// Gets a list of files required to use the project output
		/// </summary>
		/// <param name='list'>
		/// List where to add the support files.
		/// </param>
		/// <param name='configuration'>
		/// Build configuration for which get the list
		/// </param>
		/// <remarks>
		/// Returns a list of all files that are required to use the project output binary, for example: data files with
		/// the Copy to Output option, debug information files, generated resource files, etc.
		/// </remarks>
		protected virtual void PopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
		{
			foreach (ProjectFile pf in Files) {
				if (pf.CopyToOutputDirectory == FileCopyMode.None)
					continue;
				list.Add (pf.FilePath, pf.CopyToOutputDirectory == FileCopyMode.PreserveNewest, pf.ProjectVirtualPath);
			}
		}
开发者ID:okrmartin,项目名称:monodevelop,代码行数:21,代码来源:Project.cs

示例3: OnPopulateSupportFileList

		protected override void OnPopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
		{
			base.OnPopulateSupportFileList (list, configuration);

			//HACK: workaround for MD not local-copying package references
			foreach (MonoDevelop.Projects.ProjectReference projectReference in Project.References) {
				if (projectReference.Package != null && projectReference.Package.Name == "system.web.mvc") {
					if (projectReference.ReferenceType == ReferenceType.Package)
						foreach (SystemAssembly assem in projectReference.Package.Assemblies)
							list.Add (assem.Location);
					break;
				}
			}
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:14,代码来源:AspNetAppProjectFlavor.cs

示例4: PopulateSupportFileList

        protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector configuration)
        {
            base.PopulateSupportFileList(list, configuration);

            // Automatically copy referenced dll/so's to the target dir
            DProjectConfiguration prjCfg;
            foreach(var prj in DependingProjects)
                if((prjCfg=prj.GetConfiguration(configuration) as DProjectConfiguration) != null &&
                  prjCfg.CompileTarget == DCompileTarget.SharedLibrary)
            {
                list.Add(prj.GetOutputFileName(configuration));
            }
        }
开发者ID:shumtn,项目名称:Mono-D,代码行数:13,代码来源:DProject.cs

示例5: PopulateSupportFileList

		void PopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration, int referenceDistance)
		{
			if (referenceDistance < 2)
				base.PopulateSupportFileList (list, configuration);

			//rename the app.config file
			FileCopySet.Item appConfig = list.Remove ("app.config");
			if (appConfig == null)
				appConfig = list.Remove ("App.config");
			if (appConfig != null) {
				string output = Path.GetFileName (GetOutputFileName (configuration));
				list.Add (appConfig.Src, appConfig.CopyOnlyIfNewer, output + ".config");
			}
			
			//collect all the "local copy" references and their attendant files
			foreach (ProjectReference projectReference in References) {
				if (!projectReference.LocalCopy || ParentSolution == null)
					continue;

				if (projectReference.ReferenceType == ReferenceType.Project) {
					DotNetProject p = ParentSolution.FindProjectByName (projectReference.Reference) as DotNetProject;

					if (p == null) {
						LoggingService.LogWarning ("Project '{0}' referenced from '{1}' could not be found", projectReference.Reference, this.Name);
						continue;
					}

					string refOutput = p.GetOutputFileName (configuration);
					if (string.IsNullOrEmpty (refOutput)) {
						LoggingService.LogWarning ("Project '{0}' referenced from '{1}' has an empty output filename", p.Name, this.Name);
						continue;
					}

					list.Add (refOutput);

					//VS COMPAT: recursively copy references's "local copy" files
					//but only copy the "copy to output" files from the immediate references
					p.PopulateSupportFileList (list, configuration, referenceDistance + 1);

					DotNetProjectConfiguration refConfig = p.GetConfiguration (configuration) as DotNetProjectConfiguration;

					if (refConfig != null && refConfig.DebugMode) {
						string mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (refOutput);
						if (File.Exists (mdbFile)) {
							list.Add (mdbFile);
						}
					}
				}
				else if (projectReference.ReferenceType == ReferenceType.Assembly) {
					// VS COMPAT: Copy the assembly, but also all other assemblies referenced by it
					// that are located in the same folder
					foreach (string file in GetAssemblyRefsRec (projectReference.Reference, new HashSet<string> ())) {
						list.Add (file);
						if (File.Exists (file + ".config"))
							list.Add (file + ".config");
						string mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (file);
						if (File.Exists (mdbFile))
							list.Add (mdbFile);
					}
				}
				else if (projectReference.ReferenceType == ReferenceType.Custom) {
					foreach (string refFile in projectReference.GetReferencedFileNames (configuration))
						list.Add (refFile);
				}
			}
		}
开发者ID:Ein,项目名称:monodevelop,代码行数:66,代码来源:DotNetProject.cs

示例6: PopulateSupportFileList

        protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector solutionConfiguration)
        {
            System.Diagnostics.Debug.WriteLine("MonoGamePlatform=" +this.MonoGamePlatform);
            base.PopulateSupportFileList (list, solutionConfiguration);
            //HACK: workaround for MD not local-copying package references
            foreach (var projectReference in References)
            {
                if (projectReference.Reference.Contains("MonoGame.Framework"))
                {
                    // because of a weird bug in the way monodevelop resolves the assemblies
                    // we do it manually. We combine the monogame-<MonoGamePlatform>
                    // to resolve the internal packages.
                    foreach(var p in this.AssemblyContext.GetPackages(this.TargetFramework))
                    {
                        if (p.Name == string.Format("monogame-{0}", this.MonoGamePlatform.ToLower()))
                        {
                            foreach(var assem in p.Assemblies) {
                                list.Add(assem.Location);
                                var cfg = (MonoGameProjectConfiguration)solutionConfiguration.GetConfiguration(this);
                                if (cfg.DebugMode)
                                {
                                    var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(assem.Location);
                                    if (System.IO.File.Exists(mdbFile))
                                        list.Add(mdbFile);
                                }
                                var assemDir = System.IO.Path.GetDirectoryName (assem.Location);
                                // opentk needs a config file on linux and mac, so we just copy it over anyway
                                if (assem.Location.ToLower().Contains("opentk")) {
                                    if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "OpenTK.dll.config"))) {
                                        list.Add(System.IO.Path.Combine(assemDir, "OpenTK.dll.config"));
                                    }
                                }
                                // we are a Tao.SDL project we need the sdl support libraries as well
                                if (assem.Location.ToLower().Contains("tao.sdl")) {
                                    if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
                                        if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "sdl.dll"))) {
                                            list.Add(System.IO.Path.Combine(assemDir, "sdl.dll"));
                                        }
                                        if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "sdl_mixer.dll"))) {
                                            list.Add(System.IO.Path.Combine(assemDir, "sdl_mixer.dll"));
                                        }
                                    }
                                    if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "Tao.Sdl.dll.config"))) {
                                        list.Add(System.IO.Path.Combine(assemDir, "Tao.Sdl.dll.config"));
                                    }
                                }

                            }
                        }
                    }
                    break;
                }
            }
        }
开发者ID:dellis1972,项目名称:MonoGameMonoDevelopAddin,代码行数:54,代码来源:MonoGameProject.cs

示例7: PopulateSupportFileList

 protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector solutionConfiguration)
 {
     base.PopulateSupportFileList(list, solutionConfiguration);
     //HACK: workaround for MD not local-copying package references
     foreach (var projectReference in References)
     {
         if (projectReference.Package != null && projectReference.Package.Name == "monogame")
         {
             if (projectReference.ReferenceType == ReferenceType.Gac)
             {
                 foreach (var assem in projectReference.Package.Assemblies)
                 {
                     list.Add(assem.Location);
                     var cfg = (MonoGameProjectConfiguration)solutionConfiguration.GetConfiguration(this);
                     if (cfg.DebugMode)
                     {
                         var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(assem.Location);
                         if (System.IO.File.Exists(mdbFile))
                             list.Add(mdbFile);
                     }
                 }
             }
             break;
         }
     }
 }
开发者ID:Boerlam001,项目名称:MonoGame,代码行数:26,代码来源:MonoGameProject.cs

示例8: PopulateSupportFileList

        protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector configuration)
        {
            base.PopulateSupportFileList (list, configuration);
            foreach(var projectReference in References){
                if (projectReference != null && projectReference.Package.Name == "monogame") {
                    if (projectReference.ReferenceType == ReferenceType.Gac) {
                        foreach (var assem in projectReference.Package.Assemblies) {
                            list.Add (assem.Location);
                            var cfg = (MonoGameProjectConfiguration)configuration.GetConfiguration (this);
                            if (cfg.DebugMode) {
                                var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (assem.Location);
                                if (System.IO.File.Equals(mdbFile)){
                                    list.Add(mdbFile);
                                }
                            }
                        }
                    }
                    break;
                }

            }
        }
开发者ID:nanexcool,项目名称:Monogame_templates,代码行数:22,代码来源:MonoGameProject.cs


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