Exemplo n.º 1
0
        /// <summary>
        /// Adds a new address to the project items.
        /// </summary>
        private void AddNewProjectItem(Type projectItemType)
        {
            this.CreateProjectIfNone();

            DirectoryItemView directoryItemView = this.SelectedProjectItem as DirectoryItemView ?? this.ProjectRoot.FirstOrDefault();

            switch (projectItemType)
            {
            case Type _ when projectItemType == typeof(PointerItem):
                directoryItemView?.AddChild(new PointerItem());
                break;

            case Type _ when projectItemType == typeof(ScriptItem):
                directoryItemView?.AddChild(new ScriptItem());
                break;

            case Type _ when projectItemType == typeof(InstructionItem):
                directoryItemView?.AddChild(new InstructionItem());
                break;

            default:
                Logger.Log(LogLevel.Error, "Unknown project item type - " + projectItemType.ToString());
                break;
            }
        }
Exemplo n.º 2
0
        public void AddProjectItems(params ProjectItem[] projectItems)
        {
            if (projectItems == null)
            {
                return;
            }

            DirectoryItemView directoryItemView = this.SelectedProjectItem as DirectoryItemView ?? this.ProjectRoot?.FirstOrDefault();

            foreach (ProjectItem projectItem in projectItems)
            {
                directoryItemView?.AddChild(projectItem);
            }
        }