示例#1
0
 private bool LoopCheck(TreeItemBase item, object source)
 {
     if (item == null)
     {
         return(false);
     }
     if (item.Source != null && item.Source == source)
     {
         return(true);
     }
     return(LoopCheck(item.Parent, source));
 }
示例#2
0
        private static void GetAllControllerInfo(TreeItemBase itemBase, ref List <ControllerInfo> controllerInfos)
        {
            var controllerInfo = itemBase as ControllerInfo;

            if (controllerInfo != null)
            {
                controllerInfos.Add(controllerInfo);
            }
            foreach (var item in itemBase.Items)
            {
                GetAllControllerInfo(item, ref controllerInfos);
            }
        }
示例#3
0
        void DetailItemNodeControl_DrawText(object sender, DrawEventArgs e)
        {
            if (e.TextColor != SystemColors.ControlText)
            {
                return;
            }

            TreeItemBase tib = ((TreeItemBase)e.Node.Tag);

            if (tib.GetItemAt(0).GetStrongestFilterStatus() < FilterStatus.DontCare)
            {
                e.TextColor = Color.LightGray;
            }
        }
示例#4
0
        public static void LoadProjectItems(TreeItemBase treeItem)
        {
            var dirPath  = GetDirPath(treeItem.FullPath);
            var tlcFiles = Directory.EnumerateFiles(dirPath, "*" + ControllerInfo.EXTENSION, SearchOption.TopDirectoryOnly);

            foreach (var filePath in tlcFiles)
            {
                treeItem.LoadController(Path.GetFileName(filePath), Path.GetDirectoryName(filePath));
            }
            var folders = Directory.EnumerateDirectories(dirPath);

            foreach (var folderPath in folders)
            {
                var folderInfo = treeItem.LoadFolder(Path.GetFileName(folderPath), Path.GetDirectoryName(folderPath));
                LoadProjectItems(folderInfo);
            }
        }
示例#5
0
        private static ControllerXmlInfo FindControllerXmlInfo(TreeItemBase parent, string cid)
        {
            var controllerInfo = parent as ControllerInfo;

            if ((controllerInfo != null) && (controllerInfo.ItemXmlInfo.CID == cid))
            {
                return(controllerInfo.ItemXmlInfo);
            }
            foreach (var item in parent.Items)
            {
                var citem = FindControllerXmlInfo(item, cid);
                if (citem != null)
                {
                    return(citem);
                }
            }
            return(null);
        }
 private void AssociatedObject_MouseMove(object sender, MouseEventArgs e)
 {
     if ((e.LeftButton == MouseButtonState.Pressed) && _isDrag)
     {
         var currentPosition = e.GetPosition(AssociatedObject);
         if ((Math.Abs(currentPosition.X - _lastMouseDown.X) > 10.0) || (Math.Abs(currentPosition.Y - _lastMouseDown.Y) > 10.0))
         {
             if (AssociatedObject.SelectedItem != null)
             {
                 _draggedItem = (TreeItemBase)AssociatedObject.SelectedItem;
                 if (!(_draggedItem is ProjectInfo))
                 {
                     DragDrop.DoDragDrop(AssociatedObject, _draggedItem, DragDropEffects.Move);
                 }
             }
         }
     }
     else
     {
         _isDrag = false;
     }
 }
        private void DetailNodeControl_DrawText(object sender, DrawEventArgs e)
        {
            if (e.TextColor != SystemColors.ControlText)
            {
                return;
            }

            TreeItemBase tib    = ((TreeItemBase)e.Node.Tag);
            ChangeType   change = tib.GetItemAt(_assemblyIndex).Change;

            if (ChangeTypeUtil.HasBreaking(change))
            {
                e.TextColor = Color.Red;
            }
            else if (change == ChangeType.Added)
            {
                e.TextColor = Color.Green;
            }
            else if (tib.GetItemAt(0).GetStrongestFilterStatus() < FilterStatus.DontCare)
            {
                e.TextColor = Color.LightGray;
            }
        }
示例#8
0
 public ControllerInfo(TreeItemBase parent, string fileName, string location)
     : base(parent, fileName, location)
 {
     LoadItemXml <ControllerXmlInfo>(FullPath);
 }
示例#9
0
 public FolderInfo(TreeItemBase parent, string fileName, string location)
     : base(parent, fileName, location)
 {
 }
示例#10
0
 public static void SaveAll(TreeItemBase itemBase)
 {
     Project.SaveAll(itemBase);
 }
示例#11
0
        public static void GetAllController(ref List <ControllerInfo> controllerInfos, TreeItemBase treeItemBase)
        {
            var controllerInfo = treeItemBase as ControllerInfo;

            if (controllerInfo != null)
            {
                controllerInfos.Add(controllerInfo);
            }
            foreach (var treeItem in treeItemBase.Items)
            {
                GetAllController(ref controllerInfos, treeItem);
            }
        }