예제 #1
0
        private static SelectionType TranslateSelectionType(MissionTreeSelection treeSelection)
        {
            List <MissionAsset> items = treeSelection.properties;

            MissionTreeView.ItemType itemType = treeSelection.itemType;

            if (items == null || items.Count == 0)
            {
                return(SelectionType.None);
            }

            SelectionType retn = items.Count > 1 ? SelectionType.Multiple : SelectionType.None;

            switch (itemType)
            {
            case MissionTreeView.ItemType.Faction:
                return(retn | SelectionType.Faction);

            case MissionTreeView.ItemType.FlightGroup:
                return(retn | SelectionType.FlightGroup);

            case MissionTreeView.ItemType.Entity:
                return(retn | SelectionType.Entity);

            case MissionTreeView.ItemType.Root:
                return(SelectionType.None);

            default:
                throw new ArgumentOutOfRangeException(nameof(itemType), itemType, null);
            }
        }
예제 #2
0
 public MissionTreeSelection(MissionTreeView.ItemType itemType, List <MissionAsset> properties)
 {
     this.itemType   = itemType;
     this.properties = properties;
 }