private void RefreshResult(Result result, string smallImage, string largeImage, string text, string[] subTexts) { // Update the result. int newSmallIndex = AddResultImage(smallImage); int newLargeIndex = AddResultImage(largeImage); result.SmallImageIndex = newSmallIndex; result.LargeImageIndex = newLargeIndex; result.Text = text; result.SubTexts.Reset(subTexts); // Update the image. ResultDataItem rdi = new ResultDataItem(); rdi.ItemId = result.ID; rdi.Mask = (uint)ResultDataItemMask.Image; rdi.Image = -1; IResultData resultData = Snapin.ResultViewConsole as IResultData; resultData.SetItem(ref rdi); // Redraw. resultData.UpdateItem(result.ID); }
private void SetResultImage(Result result, string smallImage, string largeImage) { int newSmallIndex = AddResultImage(smallImage); int newLargeIndex = AddResultImage(largeImage); if (newSmallIndex == result.SmallImageIndex && newLargeIndex == result.LargeImageIndex) { return; // No change. } result.SmallImageIndex = newSmallIndex; result.LargeImageIndex = newLargeIndex; // Update the image. ResultDataItem rdi = new ResultDataItem(); rdi.ItemId = result.ID; rdi.Mask = (uint)ResultDataItemMask.Image; rdi.Image = -1; IResultData resultData = Snapin.ResultViewConsole as IResultData; resultData.SetItem(ref rdi); // Redraw. resultData.UpdateItem(result.ID); }
}// AddMenuItems internal override void MenuCommand(int iCommandID, Object oResultItem) { if (iCommandID == COMMANDS.ADD_GACASSEMBLY) { // Pop up a file dialog so the user can find an assembly OpenFileDialog fd = new OpenFileDialog(); fd.Title = CResourceStore.GetString("CSharedAssemblies:AddAssemFDTitle"); fd.Filter = CResourceStore.GetString("AssemFDMask"); fd.Multiselect = true; System.Windows.Forms.DialogResult dr = fd.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.OK) { for (int i = 0; i < fd.FileNames.Length; i++) { if (!AddAssemToFusion(fd.FileNames[i])) { // If we can't add assemblies due to an access denied, then // just stop trying with our list of assemblies break; } } } // Find the assembly we just added in order to select it int nCount = getNumRows(); for (int i = 0; i < nCount; i++) { if (TurnCodebaseToFilename(GetAssemInfo(i).Codebase).ToLower(CultureInfo.InvariantCulture).Equals(fd.FileNames[0].ToLower(CultureInfo.InvariantCulture))) { IResultData ResultData = (IResultData)CNodeManager.CConsole; RESULTDATAITEM rdi = new RESULTDATAITEM(); rdi.mask = RDI.STATE; rdi.nCol = 0; rdi.nIndex = i; rdi.nState = LVIS.SELECTED; ResultData.SetItem(ref rdi); break; } } } else if (iCommandID == COMMANDS.SHOW_LISTVIEW) { m_oResults = this; RefreshResultView(); m_fShowHTMLPage = false; } else if (iCommandID == COMMANDS.SHOW_TASKPAD) { m_oResults = m_taskPad; m_fShowHTMLPage = true; // The HTML pages comes displayed with this checkbox marked. Make // sure we update the xml setting CConfigStore.SetSetting("ShowHTMLForSharedAssem", "yes"); RefreshResultView(); } else if (iCommandID == COMMANDS.REFRESH_DISPLAY) { RefreshResultView(); } }// MenuCommand