示例#1
0
        public MSBuildImport AddNewImport(string name, string condition = null, MSBuildImport beforeImport = null)
        {
            AssertCanModify();
            var import = new MSBuildImport();

            import.Project   = name;
            import.Condition = condition;

            int insertIndex = -1;

            if (beforeImport != null)
            {
                insertIndex = ChildNodes.IndexOf(beforeImport);
            }

            if (insertIndex != -1)
            {
                ChildNodes = ChildNodes.Insert(insertIndex, import);
            }
            else
            {
                ChildNodes = ChildNodes.Add(import);
            }

            import.ResetIndent(false);
            NotifyChanged();
            return(import);
        }
		public MSBuildImport AddNewImport (string name, string condition = null, MSBuildImport beforeImport = null)
		{
			AssertCanModify ();
			var import = new MSBuildImport ();
			import.Project = name;
			import.Condition = condition;

			int insertIndex = -1;
			if (beforeImport != null)
				insertIndex = ChildNodes.IndexOf (beforeImport);

			if (insertIndex != -1)
				ChildNodes = ChildNodes.Insert (insertIndex, import);
			else
				ChildNodes = ChildNodes.Add (import);

			import.ResetIndent (false);
			NotifyChanged ();
			return import;
		}
示例#3
0
        public MSBuildImport AddNewImport(string name, string condition = null, MSBuildObject beforeObject = null)
        {
            AssertCanModify();
            var import = new MSBuildImport {
                Project   = name,
                Condition = condition
            };

            int index = -1;

            if (beforeObject != null)
            {
                index = ChildNodes.IndexOf(beforeObject);
            }
            else
            {
                index = ChildNodes.FindLastIndex(ob => ob is MSBuildImport);
                if (index != -1)
                {
                    index++;
                }
            }

            import.ParentNode = this;

            if (index != -1)
            {
                ChildNodes = ChildNodes.Insert(index, import);
            }
            else
            {
                ChildNodes = ChildNodes.Add(import);
            }

            import.ResetIndent(false);
            NotifyChanged();
            return(import);
        }
		public MSBuildImport AddNewImport (string name, string condition = null, MSBuildObject beforeObject = null)
		{
			AssertCanModify ();
			var import = new MSBuildImport {
				Project = name,
				Condition = condition
			};

			int index = -1;
			if (beforeObject != null)
				index = ChildNodes.IndexOf (beforeObject);
			else {
				index = ChildNodes.FindLastIndex (ob => ob is MSBuildImport);
				if (index != -1)
					index++;
			}

			import.ParentNode = this;

			if (index != -1)
				ChildNodes = ChildNodes.Insert (index, import);
			else
				ChildNodes = ChildNodes.Add (import);

			import.ResetIndent (false);
			NotifyChanged ();
			return import;
		}