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); }
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); }