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


C# ProjectItem.get_FileNames方法代码示例

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


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

示例1: AddDbContextTemplates

        // <summary>
        //     Adds the DbContext templates for the given EDMX project item if the templates are
        //     installed and can be used, otherwise does nothing.
        // </summary>
        // <param name="edmxItem">The project item representing the EDMX model.</param>
        // <param name="useLegacyTemplate">A value indicating whether to use the legacy version of the template.</param>
        public void AddDbContextTemplates(ProjectItem edmxItem, bool useLegacyTemplate = true)
        {
            Debug.Assert(edmxItem != null, "edmxItem is null.");

            var templatePath = FindDbContextTemplate(edmxItem.ContainingProject, useLegacyTemplate);

            if (templatePath != null)
            {
                try
                {
                    var edmxFilePath = edmxItem.get_FileNames(1);
                    var edmxFileName = Path.GetFileNameWithoutExtension(edmxFilePath);
                    AddArtifactGeneratorWizard.EdmxUri = Utils.FileName2Uri(edmxFilePath);

                    if (!(edmxItem.ProjectItems ?? edmxItem.Collection).OfType<ProjectItem>().Any(
                        i => string.Equals(i.Name, edmxFileName + ".tt", StringComparison.OrdinalIgnoreCase)))
                    {
                        AddAndNestCodeGenTemplates(
                            edmxItem,
                            () => edmxItem.Collection.AddFromTemplate(templatePath, edmxFileName));
                    }
                }
                finally
                {
                    AddArtifactGeneratorWizard.EdmxUri = null;
                }
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:34,代码来源:DbContextCodeGenerator.cs

示例2: VSProjectItemManager

        internal VSProjectItemManager(DTE2 dte, ProjectItem projectItem, string fileNamePrefix)
        {
            this.dte = dte;
            this.projectItem = projectItem;

            this.filesAdded = new Dictionary<string, object>();
            this.filesCreated = new List<string>();

            if (this.projectItem != null)
            {
                if (string.IsNullOrEmpty(fileNamePrefix))
                {
                    fileNamePrefix = this.GetFileNamePrefix(projectItem.Name);
                }

                if (projectItem.FileCount > 0)
                {
                    try
                    {
                        this.fullFileNamePrefix = Path.GetDirectoryName(projectItem.get_FileNames(0)) + @"\" + fileNamePrefix;
                    }
                    catch (System.ArgumentException)
                    {
                        //vs.Php raise exception
                    }

                }
            }
        }
开发者ID:Malediction,项目名称:Spartan,代码行数:29,代码来源:VSProjectItemManager.cs

示例3: OnItemRemoved

			public void OnItemRemoved(ProjectItem item)
			{
				P4Operations.EditFile(m_plugin.OutputPane, item.ContainingProject.FullName);

				for (int i = 0; i < item.FileCount; i++)
				{
					string name = item.get_FileNames((short)i);
					P4Operations.DeleteFile(m_plugin.OutputPane, name);
				}
			}
开发者ID:transformersprimeabcxyz,项目名称:_To-Do-unreal-3D-niftyplugins-ben-marsh,代码行数:10,代码来源:AutoAddDelete.cs

示例4: RenameItem

        private void RenameItem(ProjectItem item, string newFileName)
        {
            var templateFile = item.get_FileNames(1);

            var newFile = Path.Combine(Path.GetDirectoryName(templateFile), newFileName);
            File.Copy(templateFile, newFile);
            item.Collection.AddFromFile(newFile);

            item.Remove();
            File.Delete(templateFile);
        }
开发者ID:569550384,项目名称:Rafy,代码行数:11,代码来源:DomainLibraryProjectWizard.cs

示例5: CreateFileCodeMerger

        /// <summary>
        /// Creates the file code merger.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        public IFileCodeMerger CreateFileCodeMerger(ProjectItem item)
        {
            if (item == null)
                throw new ArgumentNullException("item");

            IFileCodeMerger fileCodeMerger;
            string activeFileName = DTE.ActiveDocument.ProjectItem.get_FileNames(1);
            bool useDocumentMerger = GetTextDocument() != null;

            if (useDocumentMerger || item.get_FileNames(1) == activeFileName)
                fileCodeMerger = new LuaFileCodeMerger(item);
            else
                fileCodeMerger = new LuaExternalFileCodeMerger(item);

            return fileCodeMerger;
        }
开发者ID:jda808,项目名称:NPL,代码行数:21,代码来源:LuaCodeDomProvider.cs

示例6: VisitFile

		protected FileComponent VisitFile( ProjectItem item )
		{
			FileComponent file = null;

			if( Filter( item ) )
			{
				m_app.StatusBar.Text = "building stats for " + item.Name;

				file = new FileComponent( item.get_FileNames(0), item.Name );

				Walker walker = new Walker();
				walker.WalkFile( file, item );
			}

			return file;
		}
开发者ID:Robby777,项目名称:ambientsmell,代码行数:16,代码来源:FileScanner.cs

示例7: ProjectItemFinishedGenerating

        public override void ProjectItemFinishedGenerating(ProjectItem projectItem)
        {
            if (!projectItem.Name.Contains(".g.cs"))
            {
                _entityRepoFile = projectItem;
            }
            else
            {
                //把生成文件变为实体文件的子文件。
                if (_entityRepoFile != null)
                {
                    projectItem.Remove();
                    _entityRepoFile.ProjectItems.AddFromFile(projectItem.get_FileNames(1));
                }
            }

            base.ProjectItemFinishedGenerating(projectItem);
        }
开发者ID:569550384,项目名称:Rafy,代码行数:18,代码来源:DomainEntityRepositoryItemWizard.cs

示例8: OnItemAdded

            public void OnItemAdded(ProjectItem item)
            {
                P4Operations.EditFile(m_plugin.OutputPane, item.ContainingProject.FullName);

                if (item.ProjectItems != null)
                {
                    for (int i = 0; i < item.FileCount; i++)
                    {
                        string name = item.get_FileNames((short)i);
                        P4Operations.AddFile(m_plugin.OutputPane, name);
                    }
                }
                else
                {
                    if(System.IO.File.Exists(item.Name))
                        P4Operations.AddFile(m_plugin.OutputPane, item.Name);
                }
            }
开发者ID:Nexuapex,项目名称:niftyplugins,代码行数:18,代码来源:AutoAddDelete.cs

示例9: DoLaunchUpdateModelFromDatabaseWizard

        private static void DoLaunchUpdateModelFromDatabaseWizard(ProjectItem projectItem)
        {
            var uri = Utils.FileName2Uri(projectItem.get_FileNames(1));
            ModelManager modelManager = PackageManager.Package.ModelManager;
            var efArtifactSet = modelManager.GetArtifactSet(uri);

            Debug.Assert(efArtifactSet != null, "Could not find artifact for the following file:" + uri.AbsolutePath);

            if (efArtifactSet != null)
            {
                var entityDesignArtifact = efArtifactSet.GetEntityDesignArtifact();

                Debug.Assert(
                    entityDesignArtifact != null,
                    "In LaunchUpdateModelWizardPage: DoLaunchUpdateModelFromDatabaseWizard, entityDesignArtifact is null");

                if (entityDesignArtifact != null)
                {
                    UpdateFromDatabaseEngine.UpdateModelFromDatabase(entityDesignArtifact);
                }
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:22,代码来源:LaunchUpdateModelWizardPage.cs

示例10: ProjectItemFinishedGenerating

        public override void ProjectItemFinishedGenerating(ProjectItem projectItem)
        {
            if (!projectItem.Name.Contains(".g.cs"))
            {
                _entityFile = projectItem;

                //给父实体添加列表属性。
                if (_isChild)
                {
                    WriteChildrenProperty(projectItem);
                }
            }
            else
            {
                //把生成文件变为实体文件的子文件。
                if (_entityFile != null)
                {
                    projectItem.Remove();
                    _entityFile.ProjectItems.AddFromFile(projectItem.get_FileNames(1));
                }
            }

            base.ProjectItemFinishedGenerating(projectItem);
        }
开发者ID:569550384,项目名称:Rafy,代码行数:24,代码来源:DomainEntityItemWizard.cs

示例11: TestReplaceMethod

 /// <summary>
 /// Invokes replace method on the provided objects
 /// </summary>
 /// <param name="codeFile">Code file to test</param>
 /// <param name="resFile">Resource file to use</param>
 /// <param name="hcs">Hardcoded string to use</param>
 /// <param name="expected">Expected test string</param>
 internal static void TestReplaceMethod(ProjectItem codeFile, string resourceFileName, BaseHardCodedString hcs, string expected, string resourceName)
 {
     string fileName = codeFile.get_FileNames(1);
     bool readOnly = false;
     try
     {
         readOnly = CommonMethods.ToggleReadOnly(fileName, false);
         ExtractToResourceActionSite refactorSite = new ExtractToResourceActionSite(hcs);
         ResourceFileCollection resources = new ResourceFileCollection(codeFile.ContainingProject,
             new FilterMethod(refactorSite.ActionObject.IsValidResourceFile));
         ResourceFile resFile = resources[resourceFileName];
         refactorSite.ExtractStringToResource(resFile, resourceName);
         TextDocument doc = ((EnvDTE.TextDocument)codeFile.Document.Object(null));
         EditPoint ep = doc.StartPoint.CreateEditPoint();
         string line = ep.GetLines(hcs.StartingLine + 1, hcs.StartingLine + 2);
         Assert.AreEqual(expected, line, "New line does not match the expected output");
     }
     finally
     {
         if (readOnly) CommonMethods.ToggleReadOnly(fileName, true);
     }
 }
开发者ID:joshrobb,项目名称:resourcerefactor2010,代码行数:29,代码来源:ExtractResourceActionTests.cs

示例12: IsModelFile

 public static bool IsModelFile(ProjectItem projectItem)
 {
     var fullName = projectItem.get_FileNames(1);
     return IsModelFile(fullName);
 }
开发者ID:jradxl,项目名称:nHydrate-Designer-Only,代码行数:5,代码来源:GeneratorHelper.cs

示例13: GetFilePathRelative

		/// <summary>
		/// Returns the item file name relative to the containing solution.
		/// </summary>
		public static string GetFilePathRelative(ProjectItem item)
		{
			Guard.ArgumentNotNull(item, "item");
			return GetFilePathRelative(item.DTE, item.get_FileNames(1));
		}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:8,代码来源:DteHelper2.cs

示例14: BuildCacheSub

        private void BuildCacheSub(ProjectItem projectItem)
        {
            try
            {
                var k = projectItem.get_FileNames(1);
                if (!_projectItemCache.ContainsKey(k))
                    _projectItemCache.Add(k, projectItem);
                else
                    System.Diagnostics.Debug.Write(string.Empty);

                foreach (ProjectItem pItem in projectItem.ProjectItems)
                {
                    BuildCacheSub(pItem);
                }

            }
            catch (Exception ex)
            {
                throw;
            }
        }
开发者ID:jradxl,项目名称:nHydrate-Designer-Only,代码行数:21,代码来源:EnvDTEHelper.cs

示例15: GetFileListFromProjectTree

 private ArrayList GetFileListFromProjectTree(ProjectItem item)
 {
     ArrayList filesList = new ArrayList();
     if (item == null) return filesList;
     if (item.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFile)
     {
         for (short i = 1; i <= item.FileCount; i++)
         {
             string filename = item.get_FileNames(i);
             filesList.Add(filename);
         }
     }
     else if (item.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFolder)
     {
         foreach (ProjectItem childItem in item.ProjectItems)
         {
             filesList.AddRange(GetFileListFromProjectTree(childItem));
         }
     }
     return filesList;
 }
开发者ID:siwiwit,项目名称:andromda,代码行数:21,代码来源:MDASolutionManager.cs


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