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


C# Project.Load方法代码示例

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


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

示例1: Main

        static int Main() {
                Planner.Application app;
                Project project;
                List  tasks, resources;

		// GtkSharp.Libplanner.ObjectManager.Initialize ();

		Gtk.Application.Init ();

                app = new Planner.Application();
                project = new Project (app);

		//project.Loaded += Project_Loaded;
		
                project.Load ("../../examples/project-x.mrproject");

                tasks = project.AllTasks;
                resources = project.Resources;

		foreach (Task task in project.AllTasks) {
		    Console.WriteLine ("Task name: "+ task.Name);
		}
		
                foreach (Resource resource in project.Resources) {
                  Console.WriteLine ("Resource name: "+ resource.Name);
                }
                
                return 0;
        }
开发者ID:Zaba999,项目名称:planner,代码行数:29,代码来源:Example10.cs

示例2: LoadFrom

        public static Project LoadFrom(FeatureItem FeatureItem)
        {
            if (FeatureItem.Project == null) return null;

            var Result = new Project { DTEProject = FeatureItem.Project };

            Result.Load();

            return Result;
        }
开发者ID:rossbeehler,项目名称:raconteur,代码行数:10,代码来源:Project.cs

示例3: Main

        static void Main()
        {
            _projectPath = CommandLineUtilities.GetArgument("path", (string)null) ?? CommandLineUtilities.GetArgument(0, (string)null);
            _schema = ConvertUtilities.Nullify(CommandLineUtilities.GetArgument("schema", (string)null) ?? CommandLineUtilities.GetArgument(1, (string)null), true);
            _changeTargetDirectory = CommandLineUtilities.GetArgument("changeTargetDirectory", true);
            _disableNonPersistenceProducers = CommandLineUtilities.GetArgument("disableNonPersistenceProducers", true);

            // Load the model
            Project project = new Project();
            project.Entities.ListChanged += Entities_ListChanged; // Change schema as soon as the entity is loaded
            project.Load(_projectPath, ProjectLoadOptions.Default);

            // Update producer target directory
            if (!string.IsNullOrEmpty(_schema) && _changeTargetDirectory)
            {
                foreach (var producer in project.Producers)
                {
                    var sqlServerProducer = producer.Instance as SqlServerProducer;
                    if (sqlServerProducer != null)
                    {
                        sqlServerProducer.Production += SqlServerProducer_Production;
                    }

                    var databaseProducer = producer.Instance as DatabaseProducer;
                    if (databaseProducer != null)
                    {
                        databaseProducer.Production += DatabaseProducer_Production;
                    }
                }
            }

            // Generate code
            project.Producing += OnProjectProduction;
            ProductionOptions productionOptions = BuildProductionOptions(project);
            project.Produce(productionOptions);
            Console.WriteLine();
        }
开发者ID:modulexcite,项目名称:CodeFluent-Entities,代码行数:37,代码来源:Program.cs

示例4: InitializeProject

	public void InitializeProject()
	{
		if (string.IsNullOrEmpty(this.ProjectFile))
			return;
			
		_projectDirectory = Path.GetDirectoryName(Path.GetFullPath(_projectFile));
		if (!Directory.Exists(_projectDirectory))
			Directory.CreateDirectory(_projectDirectory);
			
		Engine.GlobalEngine.BinPath = ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version20);
		_project = new Project();
		if (!File.Exists(_projectFile))
		{
			// create project file
			Guid g = Guid.NewGuid();
			string projectName = Path.GetFileNameWithoutExtension(_projectFile);
			
			StringBuilder buffer = new StringBuilder();
			buffer.Append(File.ReadAllText(Path.Combine(_internalPath, @"Project\classlibrary.csproj")));
			buffer.Replace("$safeprojectname$", projectName);
			buffer.Replace("$guid1$", g.ToString());
			File.WriteAllText(_projectFile, buffer.ToString());
			
			string propertiesDirectory = Path.Combine(_projectDirectory, "Properties");
			if (!Directory.Exists(propertiesDirectory))
				Directory.CreateDirectory(propertiesDirectory);
			
			string infoFile = Path.Combine(propertiesDirectory, "AssemblyInfo.cs");
			if (!File.Exists(infoFile))
			{
				buffer.Length = 0;
				buffer.Append(File.ReadAllText(Path.Combine(_internalPath, @"Project\assemblyinfo.cs")));
				buffer.Replace("$projectname$", projectName);
				buffer.Replace("$guid1$", g.ToString());
				File.WriteAllText(infoFile, buffer.ToString());
			}		
		}
		// loading project file
		_project.Load(_projectFile);
		// add default references
	}
开发者ID:cnporras,项目名称:wilsonormapper,代码行数:41,代码来源:project.utility.cs

示例5: BuildCompileAndSaveProject

        private bool BuildCompileAndSaveProject(string projectFilePath,string outputPath,EnvironmentSettingsManager environmentManager, int stepNumber)
        {
            Project project;
            DeploymentPackage package;
            bool result = false;

            #region 4. Build

            LogHelper.LogMessage(String.Format("\n{0}.1 Beginning Build",stepNumber));
            LogHelper.LogMessage("   -- Loading project file: " + projectFilePath);
            project = new Project();
            project.Load(projectFilePath);

            LogHelper.LogMessage("   -- Building Project");
            result = K2Helper.CompileK2Project(project);

            if (!result)
                throw new Exception("The Project did not Compile successfully.\n");

            #endregion

            #region 5. Deployment Package Creation

            LogHelper.LogMessage(String.Format("\n{0}.2 Creating the Deployment Package",stepNumber));
            package = K2Helper.CreateDeploymentPackage(
                project, environmentManager, DeployLabel, DeployDescription, testOnly);

            #endregion

            #region 6. Save Deployment Package

            LogHelper.LogMessage(String.Format("\n{0}.3. Saving Deployment Package to '" + OutputPath + "'",stepNumber));
            FileHelper fileHelper = new FileHelper();
            fileHelper.DeleteDirectory(outputPath);

            package.Save(outputPath, "K2DeploymentPackage");
            LogHelper.LogMessage("   -- Package Saved");

            #endregion

            return result;
        }
开发者ID:jonnoking,项目名称:K2PowershellLibaries,代码行数:42,代码来源:K2Build.cs

示例6: OpenProject

 public async Task OpenProject(string fileName)
 {
     var p = new Project(fileName);
     await p.Load();
     CurrentProject = p;
 }
开发者ID:xoxota99,项目名称:NodeMachine,代码行数:6,代码来源:ProjectManager.cs


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