예제 #1
0
        public void AddUsings(params string[] usings)
        {
            AddUsingAction action = new AddUsingAction(
                this,
                usings);
            this.ActionManager.RecordAction(action);

            //			UsingBlock b = UsingSection;
            //
            //			List<string> toAdd;
            //			if (b == null)
            //			{
            //				toAdd = new List<string>(usings);
            //			}
            //			else
            //			{
            //				toAdd = new List<string>();
            //				foreach (string u in usings)
            //				{
            //					if (!b.Exists(u))
            //					{
            //						toAdd.Add(u);
            //					}
            //				}
            //			}
            //
            //			if (this.Root != null)
            //			{
            //				using (Transaction t = Transaction.Create(this.Root))
            //				{
            //					if (b == null)
            //					{
            //						b = new UsingBlock();
            //						this.AddToBeginning(b);
            //					}
            //					foreach (string s in toAdd)
            //					{
            //						b.Add(s);
            //					}
            //				}
            //			}
            //			else
            //			{
            //				using (Redrawer r = new Redrawer(this.Root))
            //				{
            //					if (b == null)
            //					{
            //						b = new UsingBlock();
            //						this.Children.Prepend(b);
            //					}
            //					foreach (string s in usings)
            //					{
            //						b.Add(s);
            //					}
            //				}
            //			}
        }
예제 #2
0
 public void AddUsing(UsingDirective usingDirective)
 {
     AddUsingAction action = new AddUsingAction(this, usingDirective);
     this.ActionManager.RecordAction(action);
 }