Exemplo n.º 1
0
        void Wrapper_SearchStartedEvent(object sender, PortingKitWrapper.SearchStartedEventArgs e)
        {
            ClearItemList();
            string type = "";
            switch (e.SearchParams.Type)
            {
                case PortingKitWrapper.SearchType.AllComponents:
                    type = Strings.ALL + " types";
                    break;
                case PortingKitWrapper.SearchType.Libraries:
                    type = "Libraries";
                    break;
                case PortingKitWrapper.SearchType.LibraryCategories:
                    type = "Library Categories";
                    break;
                case PortingKitWrapper.SearchType.Features:
                    type = "Features";
                    break;
                case PortingKitWrapper.SearchType.Files:
                    type = "Files";
                    break;
                case PortingKitWrapper.SearchType.TextInFiles:
                    type = "Text in files";
                    break;
                default:
                    break;
            }

            string where = "";
            switch (e.SearchParams.Where)
            {
                case PortingKitWrapper.SearchWhere.All:
                    where = "Porting Kit Database and opened Solution";
                    break;
                case PortingKitWrapper.SearchWhere.PKDatabase:
                    where = "Porting Kit Database";
                    break;
                case PortingKitWrapper.SearchWhere.Solution:
                    where = "Opened Solution";
                    break;
                default:
                    break;
            }

            AddTextInList(Strings.FindAll + " \"" + e.SearchParams.What + "\" " + Strings.IN + " " + type + " " + Strings.IN + " " + where);
        }
Exemplo n.º 2
0
        void Wrapper_ElementFindedEvent(object sender, PortingKitWrapper.ElementFindedEventArgs e)
        {
            Collection<ComponentNode> nodes = new Collection<ComponentNode>();
            if (e.ComponentDescriptor.Component != null)
            {
                componentList.Add(e.ComponentDescriptor.Component);
            }
            foreach (ComponentWrapper component in componentList)
  	        {
                nodes.Add(new ComponentNode(component, null));
	        }
            _treeView.SetModel(InventoryBrowserModel.GetModel(nodes), false);
            //if (e.ComponentDescriptor.Component != null)
            //{
            //    ListViewItem it = new ListViewItem(GetComponentName(e.ComponentDescriptor));
            //    it.Tag = e.ComponentDescriptor;
            //    switch (e.ComponentDescriptor.Component.ComponentType)
            //    {
            //        case ComponentTypeWrapper.Library:
            //            it.ImageIndex = (int)MFTreeNodeBase.ImageKeysEnum.Library;
            //            break;
            //        case ComponentTypeWrapper.Feature:
            //            it.ImageIndex = (int)MFTreeNodeBase.ImageKeysEnum.Feature;
            //            break;
            //        case ComponentTypeWrapper.MFAssembly:
            //            break;
            //        case ComponentTypeWrapper.MFSolution:
            //            it.ImageIndex = (int)MFTreeNodeBase.ImageKeysEnum.Solution;
            //            break;
            //        case ComponentTypeWrapper.Processor:
            //            it.ImageIndex = (int)MFTreeNodeBase.ImageKeysEnum.Processor;
            //            break;
            //        case ComponentTypeWrapper.OperatingSystem:
            //            break;
            //        case ComponentTypeWrapper.BuildTool:
            //            break;
            //        case ComponentTypeWrapper.ISA:
            //            it.ImageIndex = (int)MFTreeNodeBase.ImageKeysEnum.ISA;
            //            break;
            //        case ComponentTypeWrapper.BuildParameter:
            //            break;
            //        case ComponentTypeWrapper.LibraryCategory:
            //            it.ImageIndex = (int)MFTreeNodeBase.ImageKeysEnum.LibraryCategory;
            //            break;
            //        case ComponentTypeWrapper.Unknown:
            //            break;
            //        default:
            //            break;
            //    }
            //    AddItemInList(it);
            //}
            //else if (e.ComponentDescriptor.File != null)
            //{
            
            //    ListViewItem it = null;

            //    if (e.ComponentDescriptor.Line == null)
            //        it = new ListViewItem(GetComponentName(e.ComponentDescriptor));
            //    else
            //    {
            //        //it = new ListViewItem(GetComponentName(e.ComponentDescriptor) + ":      " + e.ComponentDescriptor.Line.Text.Trim());
            //        it = new ListViewItem(GetComponentName(e.ComponentDescriptor) + ":      ");
            //        it.SubItems.Add(e.ComponentDescriptor.Line.Text.Trim());
            //    }

            //    it.Tag = e.ComponentDescriptor;
            //    it.ImageIndex = (int)MFSourceFileTreeNode.FileName2ImageKey(e.ComponentDescriptor.File.File);
            //    AddItemInList(it);
            //}
        }