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


C# Core.Project类代码示例

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


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

示例1: ProjectSettingsLoader

        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectSettingsLoader" />
        /// class for the given <see cref="Project" />.
        /// </summary>
        /// <param name="project">The <see cref="Project" /> that should be configured.</param>
        internal ProjectSettingsLoader(Project project) {
            _project = project;

            // setup namespace manager
            _nsMgr = new XmlNamespaceManager(new NameTable());
            _nsMgr.AddNamespace("nant", _nsMgr.DefaultNamespace);
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:12,代码来源:ProjectSettingsLoader.cs

示例2: ExpressionEvalBase

        public ExpressionEvalBase(Project project)
        {
            if (project == null)
                throw new ArgumentNullException("project");

            _project = project;
        }
开发者ID:anthonyheckmann,项目名称:NAnt-cvsclone,代码行数:7,代码来源:ExpressionEvalBase.cs

示例3: Test_FilesInResources

        public void Test_FilesInResources() {
            string buildFile = Path.Combine (_tempFolder, "default.build");

            foreach (string resName in Assembly.GetExecutingAssembly().GetManifestResourceNames()) {
                if (!resName.StartsWith("XML_.Build.Files")) {
                    continue;
                }

                using (FileStream fs = File.Open (buildFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Read)) {
                    byte[] buffer = new byte[8192];

                    Stream rs = Assembly.GetExecutingAssembly().GetManifestResourceStream(resName);
                    while (true) {
                        int bytesRead = rs.Read(buffer, 0, buffer.Length);
                        if (bytesRead == 0) {
                            break;
                        }
                        fs.Write(buffer, 0, bytesRead);
                    }
                }

                bool expectSuccess = (resName.IndexOf(".Valid.") > 0);

                try {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(buildFile);
                    Project p = new Project(doc, Level.Info, 0);
                    string output = BuildTestBase.ExecuteProject(p);
                    Assert.IsTrue (expectSuccess, "#1: " + resName + " " + output);
                } catch (Exception ex) {
                    Assert.IsFalse (expectSuccess, "#2: " +resName + " " + ex.ToString());
                }
            }
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:34,代码来源:BuildFilesInResourcesTest.cs

示例4: ExpressionEvaluator

 /// <summary>
 /// Initializes a new instance of the <see cref="ExpressionEvaluator"/> class.
 /// </summary>
 /// <param name="project">The project.</param>
 /// <param name="properties">The projects properties.</param>
 /// <param name="state">The state.</param>
 /// <param name="visiting">The visiting.</param>
 public ExpressionEvaluator(Project project, PropertyDictionary properties, Hashtable state, Stack visiting)
     : base(project)
 {
     _properties = properties;
     _state = state;
     _visiting = visiting;
 }
开发者ID:nantos,项目名称:nant,代码行数:14,代码来源:ExpressionEvaluator.cs

示例5: SetUp

        protected override void SetUp() {
            base.SetUp();
            _buildFileName = Path.Combine(TempDirName, "test.build");
            TempFile.CreateWithContents(FormatBuildFile("", ""), _buildFileName);

            _project = new Project(_buildFileName, Level.Info, 0);
            _project.Properties["prop1"] = "asdf";
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:8,代码来源:ExpressionEvaluatorTest.cs

示例6: DummyCircularReferenceTask

		public DummyCircularReferenceTask(string references, string buildFileXml)
		{
			m_References = references;
			XmlDocument doc = new XmlDocument();
			doc.LoadXml(buildFileXml);
			Project = new Project(doc, Level.Info, 1);
			Project.Execute(); // this loads targets
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:8,代码来源:CircularReferencesTaskTests.cs

示例7: AsyncProject

 public AsyncProject(String logSrcName, Project proj, String target, ManualCloseLogEventQueue q)
 {
     _logSrcName = logSrcName;
     _project = proj;
     _target = target;
     _thread = null;
     _logEventQueue = q;
 }
开发者ID:anelson,项目名称:multitask,代码行数:8,代码来源:AsyncProject.cs

示例8: UseDefaultNamespace

 internal static void UseDefaultNamespace(XmlDocument document, Project project)
 {
     string xmlCopy = document.OuterXml;
     xmlCopy = xmlCopy.Replace("xmlns=\"", "disabledxmlns=\"");
     string docStart = "<" + document.DocumentElement.Name;
     string newDocStart = docStart + " " + GetNamespaceDeclaration(project.Document);
     xmlCopy = xmlCopy.Replace(docStart, newDocStart);
     document.LoadXml(xmlCopy);
 }
开发者ID:rmboggs,项目名称:NAntScript,代码行数:9,代码来源:TdcTask.cs

示例9: Install

        /// <summary>
        /// Replaces existing build event handlers with a handler that enqueues
        /// build events into this queue
        /// </summary>
        /// <param name="proj"></param>
        public void Install(Project proj, String hideTarget)
        {
            _hideTarget = hideTarget;

            BuildListenerCollection coll = new BuildListenerCollection();
            coll.Add(this);

            proj.DetachBuildListeners();
            proj.AttachBuildListeners(coll);
        }
开发者ID:anelson,项目名称:multitask,代码行数:15,代码来源:LogEventQueueBase.cs

示例10: AddOrOverwriteProperty

        /// <summary>
        /// Sets a property to a value for a given NAnt project.  If the property
        /// already exists on the project, the old value will be overwritten with
        /// the new value.
        /// </summary>
        /// <param name="proj">The project on which to set the property.</param>
        /// <param name="prop">The name of the property to set.</param>
        /// <param name="val">The value to set the property to.</param>
        public static void AddOrOverwriteProperty(Project proj, string prop, string val)
        {
            #region Preconditions
            if (proj == null) throw new ArgumentNullException("proj");
            if (prop == null) throw new ArgumentNullException("prop");
            if (val == null)  throw new ArgumentNullException("val");
            #endregion

            if (proj.Properties.Contains(prop))
				proj.Properties.Remove(prop);
			proj.Properties.Add(prop, val);
        }
开发者ID:Orvid,项目名称:NAntUniversalTasks,代码行数:20,代码来源:NAntUtility.cs

示例11: TryExpandingProperty

 private static void TryExpandingProperty(Project project, IBuildProperty property)
 {
     try
     {
         property.DefaultExpandedValue =
             property.ExpandedValue =
             project.ExpandProperties(property.Value, new Location("Buildfile"));
     }
     catch (BuildException)
     {
         // TODO: Do something with the error message
     }
 }
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:13,代码来源:NAntBuildScript.cs

示例12: Test_Initialization_DOMBuildFile

        public void Test_Initialization_DOMBuildFile() {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(FormatBuildFile("", ""));
            Project p = new Project(doc, Level.Error, 0);

            Assert.IsNotNull(p.Properties["nant.version"], "Property not defined.");
            Assert.IsNull(p.Properties["nant.project.buildfile"], "location of buildfile should not exist!");
            Assert.IsNotNull(p.Properties["nant.project.basedir"], "nant.project.basedir should not be null");
            Assert.AreEqual(TempDirName, p.Properties["nant.project.basedir"]);
            Assert.AreEqual("test", p.Properties["nant.project.default"]);

            CheckCommon(p);

            Assert.AreEqual("The value is " + Boolean.TrueString + ".", p.ExpandProperties("The value is ${task::exists('fail')}.", null));
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:15,代码来源:ProjectTest.cs

示例13: RunProject

        internal void RunProject(String threadName, Project proj, String targetName)
        {
            ManualCloseLogEventQueue q = new ManualCloseLogEventQueue(threadName);
            AsyncProject ap = new AsyncProject(threadName, proj, targetName, q);

            _logEventQueueList.Add(q);
            _asyncProjects.Add(ap);

            ap.Start();

            InstallNewAutoCloseEventListener();

            if (_serialize) {
                ap.WaitForFinish();
            }
        }
开发者ID:anelson,项目名称:multitask,代码行数:16,代码来源:MultiTasks.cs

示例14: Test_Initialization_FSBuildFile

        public void Test_Initialization_FSBuildFile() {
            // create the build file in the temp folder
            TempFile.CreateWithContents(FormatBuildFile("", ""), _buildFileName);

            Project p = new Project(_buildFileName, Level.Error, 0);

            Assert.IsNotNull(p.Properties["nant.version"], "Property ('nant.version') not defined.");
            Assert.IsNotNull(p.Properties["nant.location"], "Property ('nant.location') not defined.");

            Assert.AreEqual(new Uri(_buildFileName), p.Properties["nant.project.buildfile"]);
            Assert.AreEqual(TempDirName, p.Properties["nant.project.basedir"]);
            Assert.AreEqual("test", p.Properties["nant.project.default"]);

            CheckCommon(p);

            Assert.AreEqual("The value is " + Boolean.TrueString + ".", p.ExpandProperties("The value is ${task::exists('fail')}.", null));
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:17,代码来源:ProjectTest.cs

示例15: TimeSpanFunctions

 public TimeSpanFunctions(Project project, PropertyDictionary properties)
     : base(project, properties)
 {
 }
开发者ID:smaclell,项目名称:NAnt,代码行数:4,代码来源:TimeSpanFunctions.cs


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