Example #1
0
 public virtual IVsaItem CreateItem
     (String name, VsaItemType itemType, VsaItemFlag itemFlag)
 {
     lock (this)
     {
         CheckForClosed();
         if (engine.IsRunning)
         {
             throw new VsaException(VsaError.EngineRunning);
         }
         if (itemType != VsaItemType.Code)
         {
             // We only support code items in this implementation.
             throw new VsaException(VsaError.ItemTypeNotSupported);
         }
         if (itemFlag == VsaItemFlag.Class)
         {
             // We don't support class flags.
             throw new VsaException(VsaError.ItemFlagNotSupported);
         }
         VsaItem.ValidateName(engine, name);
         VsaItem item = new VsaCodeItem(engine, name, itemFlag);
         itemList.Add(item);
         return(item);
     }
 }