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


C# Project类代码示例

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


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

示例1: CreateFolders

        public void CreateFolders(Project currentProject, string schedule, string projectName, string relativePath)
        {
            //Create a File under Properties Folder which will contain information about all WebJobs
            //https://github.com/ligershark/webjobsvs/issues/6

            // Check if the WebApp is C# or VB
            string dir = GetProjectDirectory(currentProject);
            var propertiesFolderName = "Properties";
            if (currentProject.CodeModel.Language == CodeModelLanguageConstants.vsCMLanguageVB)
            {
                propertiesFolderName = "My Project";
            }

            DirectoryInfo info = new DirectoryInfo(Path.Combine(dir, propertiesFolderName));

            string readmeFile = Path.Combine(info.FullName, "WebJobs.xml");

            // Copy File if it does not exit
            if (!File.Exists(readmeFile))
                AddReadMe(readmeFile);

            //Add a WebJob info to it
            XDocument doc = XDocument.Load(readmeFile);
            XElement root = new XElement("WebJob");
            root.Add(new XAttribute("Project", projectName));
            root.Add(new XAttribute("RelativePath", relativePath));
            root.Add(new XAttribute("Schedule", schedule));
            doc.Element("WebJobs").Add(root);
            doc.Save(readmeFile);
            currentProject.ProjectItems.AddFromFile(readmeFile);
        }
开发者ID:modulexcite,项目名称:webjobsvs,代码行数:31,代码来源:WebJobCreator.cs

示例2: CompileProject

 public static void CompileProject(Project project)
 {
     if (project != null && !string.IsNullOrEmpty(project.FullName))
     {
         Task.Run(() => Compile(project));
     }
 }
开发者ID:kami-jami,项目名称:WebEssentials2012,代码行数:7,代码来源:LessProjectCompiler.cs

示例3: AddProject

 public void AddProject(Project project)
 {
     if (ProjectAdded != null)
     {
         ProjectAdded(this, new ProjectEventArgs(project));
     }
 }
开发者ID:OsirisTerje,项目名称:sonarlint-vs,代码行数:7,代码来源:MockSolutionManager.cs

示例4: TestUndoRedoCommand

        public void TestUndoRedoCommand()
        {
            // Arrange
            var project = new Project();
            var context = new BlockCommandContext(project);
            ProjectBlockCollection blocks = project.Blocks;
            Block block = blocks[0];
            using (block.AcquireBlockLock(RequestLock.Write))
            {
                block.SetText("abcd");
            }
            int blockVersion = block.Version;
            BlockKey blockKey = block.BlockKey;

            var command = new InsertTextCommand(new BlockPosition(blockKey, 2), "YES");
            project.Commands.Do(command, context);
            project.Commands.Undo(context);

            // Act
            project.Commands.Redo(context);

            // Assert
            Assert.AreEqual(1, blocks.Count);
            Assert.AreEqual(
                new BlockPosition(blocks[0], 5), project.Commands.LastPosition);

            const int index = 0;
            Assert.AreEqual("abYEScd", blocks[index].Text);
            Assert.AreEqual(blockVersion + 3, blocks[index].Version);
        }
开发者ID:dmoonfire,项目名称:author-intrusion-cil,代码行数:30,代码来源:InsertTextBlockCommandTests.cs

示例5: SetGenerateTypeOptions

 public void SetGenerateTypeOptions(
     Accessibility accessibility = Accessibility.NotApplicable,
     TypeKind typeKind = TypeKind.Class,
     string typeName = null,
     Project project = null,
     bool isNewFile = false,
     string newFileName = null,
     IList<string> folders = null,
     string fullFilePath = null,
     Document existingDocument = null,
     bool areFoldersValidIdentifiers = true,
     string defaultNamespace = null,
     bool isCancelled = false)
 {
     Accessibility = accessibility;
     TypeKind = typeKind;
     TypeName = typeName;
     Project = project;
     IsNewFile = isNewFile;
     NewFileName = newFileName;
     Folders = folders;
     FullFilePath = fullFilePath;
     ExistingDocument = existingDocument;
     AreFoldersValidIdentifiers = areFoldersValidIdentifiers;
     DefaultNamespace = defaultNamespace;
     IsCancelled = isCancelled;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:27,代码来源:TestGenerateTypeOptionsService.cs

示例6: Main

    public static void Main(string[] args)
    {
        try
        {
            Project project =
                new Project("My Product",

                    new Dir(@"%ProgramFiles%\My Company\My Product",
                        new File(@"AppFiles\MyApp.exe",
                            new FileShortcut("MyApp", @"%Desktop%") { Advertise = true }),
                        new ExeFileShortcut("Uninstall MyApp", "[System64Folder]msiexec.exe", "/x [ProductCode]")),

                    new Dir(@"%ProgramMenu%\My Company\My Product",
                        new ExeFileShortcut("Uninstall MyApp", "[System64Folder]msiexec.exe", "/x [ProductCode]")));

            project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b");
            project.UI = WUI.WixUI_ProgressOnly;
            project.OutFileName = "setup";

            Compiler.BuildMsi(project);
        }
        catch (System.Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
开发者ID:Eun,项目名称:WixSharp,代码行数:26,代码来源:setup.cs

示例7: CreateItem

        public async Task<ICallHierarchyMemberItem> CreateItem(ISymbol symbol,
            Project project, IEnumerable<Location> callsites, CancellationToken cancellationToken)
        {
            if (symbol.Kind == SymbolKind.Method ||
                symbol.Kind == SymbolKind.Property ||
                symbol.Kind == SymbolKind.Event ||
                symbol.Kind == SymbolKind.Field)
            {
                symbol = GetTargetSymbol(symbol);

                var finders = await CreateFinders(symbol, project, cancellationToken).ConfigureAwait(false);

                ICallHierarchyMemberItem item = new CallHierarchyItem(symbol,
                    project.Id,
                    finders,
                    () => symbol.GetGlyph().GetImageSource(GlyphService),
                    this,
                    callsites,
                    project.Solution.Workspace);

                return item;
            }

            return null;
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:25,代码来源:CallHierarchyProvider.cs

示例8: ProjectRemoved

 private void ProjectRemoved(Project project)
 {
     if (project.Name == ProjectHelpers.SolutionItemsFolder)
     {
         DeleteSolutionSettings();
     }
 }
开发者ID:hravnx,项目名称:WebEssentials2013,代码行数:7,代码来源:ProjectSettings.cs

示例9: AddStorageContexts

        // Generates all of the Web Forms Pages (Default Insert, Edit, Delete),
        private void AddStorageContexts(
            Project project,
            string selectionRelativePath,
            string dbContextNamespace,
            string dbContextTypeName,
            CodeType modelType,
            bool useMasterPage,
            string masterPage = null,
            bool overwriteViews = true
        )
        {
            if (modelType == null)
            {
                throw new ArgumentNullException("modelType");
            }

            var webForms = new[] { "StorageContext", "StorageContext.KeyHelpers" };

            // Now add each view
            foreach (string webForm in webForms)
            {
                AddStorageContextTemplates(
                    selectionRelativePath: selectionRelativePath,
                    modelType: modelType,
                    dbContextNamespace: dbContextNamespace,
                    dbContextTypeName: dbContextTypeName,
                    webFormsName: webForm,
                    overwrite: overwriteViews);
            }
        }
开发者ID:debbievermaak,项目名称:azure-scaffolder,代码行数:31,代码来源:RazorScaffolder.StorageContext.cs

示例10: Deserialize

        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var project = new Project();

                project.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                project.Description = dictionary.GetValue<string>(RedmineKeys.DESCRIPTION);
                project.HomePage = dictionary.GetValue<string>(RedmineKeys.HOMEPAGE);
                project.Name = dictionary.GetValue<string>(RedmineKeys.NAME);
                project.Identifier = dictionary.GetValue<string>(RedmineKeys.IDENTIFIER);
                project.Status = dictionary.GetValue<ProjectStatus>(RedmineKeys.STATUS);
                project.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON);
                project.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON);
                project.Trackers = dictionary.GetValueAsCollection<ProjectTracker>(RedmineKeys.TRACKERS);
                project.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS);
                project.IsPublic = dictionary.GetValue<bool>(RedmineKeys.IS_PUBLIC);
                project.Parent = dictionary.GetValueAsIdentifiableName(RedmineKeys.PARENT);
                project.IssueCategories = dictionary.GetValueAsCollection<ProjectIssueCategory>(RedmineKeys.ISSUE_CATEGORIES);
                project.EnabledModules = dictionary.GetValueAsCollection<ProjectEnabledModule>(RedmineKeys.ENABLED_MODULES);
                return project;
            }

            return null;
        }
开发者ID:Enhakiel,项目名称:redmine-net-api,代码行数:25,代码来源:ProjectConverter.cs

示例11: UpdateForProject

 private void UpdateForProject(Project project)
 {
     if (lastStatuses.ContainsKey(project.Url) && lastCompletedStatuses.ContainsKey(project.Url))
     {
         if (lastStatuses[project.Url].IsInProgress)
         {
             if (project.StatusValue == BuildStatusEnum.Successful)
             {
                 if (BuildStatusUtils.IsErrorBuild(lastCompletedStatuses[project.Url]))
                 {
                     FixedProjects.Add(project);
                 }
                 else
                 {
                     SucceedingProjects.Add(project);
                 }
             }
             else if (TreatAsFailure(project.Status))
             {
                 if (TreatAsFailure(lastCompletedStatuses[project.Url]))
                 {
                     StillFailingProjects.Add(project);
                 }
                 else
                 {
                     FailingProjects.Add(project);
                 }
             }
         }
     }
 }
开发者ID:ViniciusConsultor,项目名称:hudson-tray-tracker,代码行数:31,代码来源:AllServersStatus.cs

示例12: CheckSanity

 public override void CheckSanity(Project project, Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
 {
     if (_Position == 0)
     {
         serializer.Warn("The capitalize command requires the first argument to be a non-zero integer.", this);
     }
 }
开发者ID:alfar,项目名称:WordBuilder,代码行数:7,代码来源:CapitalizeCommand.cs

示例13: FindNavigableDeclaredSymbolInfosAsync

        private static async Task<ImmutableArray<INavigateToSearchResult>> FindNavigableDeclaredSymbolInfosAsync(
            Project project, Document searchDocument, string pattern, CancellationToken cancellationToken)
        {
            var containsDots = pattern.IndexOf('.') >= 0;
            using (var patternMatcher = new PatternMatcher(pattern, allowFuzzyMatching: true))
            {
                var result = ArrayBuilder<INavigateToSearchResult>.GetInstance();
                foreach (var document in project.Documents)
                {
                    if (searchDocument != null && document != searchDocument)
                    {
                        continue;
                    }

                    cancellationToken.ThrowIfCancellationRequested();
                    var declarationInfo = await document.GetSyntaxTreeIndexAsync(cancellationToken).ConfigureAwait(false);

                    foreach (var declaredSymbolInfo in declarationInfo.DeclaredSymbolInfos)
                    {
                        cancellationToken.ThrowIfCancellationRequested();
                        var patternMatches = patternMatcher.GetMatches(
                            GetSearchName(declaredSymbolInfo),
                            declaredSymbolInfo.FullyQualifiedContainerName,
                            includeMatchSpans: true);

                        if (!patternMatches.IsEmpty)
                        {
                            result.Add(ConvertResult(containsDots, declaredSymbolInfo, document, patternMatches));
                        }
                    }
                }

                return result.ToImmutableAndFree();
            }
        }
开发者ID:TyOverby,项目名称:roslyn,代码行数:35,代码来源:AbstractNavigateToSearchService.InProcess.cs

示例14: Initialize

		public void Initialize(
			Project project,
			ProjectFolder projectFolder)
		{
			_project = project;
			_projectFolder = projectFolder;
		}
开发者ID:iraychen,项目名称:ZetaResourceEditor,代码行数:7,代码来源:CreateNewFilesForm.cs

示例15: MetadataDbProvider

 /// <summary>
 /// Constructor for the class for Epi 2000 projects
 /// </summary>
 /// <param name="proj">Project the metadata belongs to</param>
 public MetadataDbProvider(Project proj)
 {
     IDbDriverFactory dbFactory = DbDriverFactoryCreator.GetDbDriverFactory(Configuration.AccessDriver);
     OleDbConnectionStringBuilder cnnStrBuilder = new OleDbConnectionStringBuilder();
     cnnStrBuilder.DataSource = proj.FilePath;
     this.db = dbFactory.CreateDatabaseObject(cnnStrBuilder);
 }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:11,代码来源:MetadataDbProvider.cs


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