Hi,
I created my own pane and everything works except that don’t shows the display status icon.
Here is my code:
int li_pos = 0;
int count = 10;
BrowserPanes bps = avcl_docm.BrowserPanes;
System.Drawing.Icon icon = IconReader.GetFileIcon(avs_fileName, IconReader.IconSize.Small, false);
stdole.IPictureDisp m_IPictureDisp = AxHostConverter.ImageToPictureDisp(icon.ToBitmap());
Inventor.ClientNodeResource m_topNodeClientResource = bps.ClientNodeResources.Add("testRsc", count, m_IPictureDisp);
stdole.IPictureDisp[] m_IPictureDispStatus =
{
AxHostConverter.ImageToPictureDisp( Properties.Resources.NewlyAddedStatus),
AxHostConverter.ImageToPictureDisp( Properties.Resources.CheckOutStatus),
AxHostConverter.ImageToPictureDisp( Properties.Resources.CheckInStatus)
};
string[] ls_toolTipStatus = {"Newly added file", "Checked out", "Checked-in"};
Inventor.ClientNodeResource[] m_statusClientNodeResource =
{
bps.ClientNodeResources.Add("testStatus0", 0, m_IPictureDispStatus[0]),
bps.ClientNodeResources.Add("testStatus1", 1, m_IPictureDispStatus[1]),
bps.ClientNodeResources.Add("testStatus2", 2, m_IPictureDispStatus[2]),
};
c_Document lcl_docm = new c_Document(AddinGlobal.CodValtId, AddinGlobal.SessionKey, AddinGlobal.CodAplcConcId, AddinGlobal.CodLicnUtlzId, AddinGlobal.CodUtlzId, avs_codDocmId);
DataSet ds_docm = lcl_docm.m_GetDocumentRelationships();
li_pos = 2;
if (!string.IsNullOrEmpty(m_IsFileNameCheckout(avs_fileName)))
li_pos = 1;
//Add Top Node
count = count + 1;
Inventor.ClientBrowserNodeDefinition m_topNodeDefinition = bps.CreateBrowserNodeDefinition(
avcl_docm.DisplayName,
200 + count,
m_topNodeClientResource,
avcl_docm.FullDocumentName,
m_topNodeClientResource,
m_statusClientNodeResource[li_pos],
ls_toolTipStatus[li_pos]);
Inventor.BrowserPane m_customBrowserPane = bps.AddTreeBrowserPane("My Test", "testBrowser", (Inventor.BrowserNodeDefinition)m_topNodeDefinition);
Inventor.ClientNodeResource m_childNodeClientResource = null;
Inventor.ClientBrowserNodeDefinition m_childNodeDefinition = null;
Inventor.BrowserNode m_childNode = null;
foreach (Inventor.DocumentDescriptor refDocument in avcl_docm.ReferencedDocumentDescriptors)
{
if (m_AlreadyInRelationships(ds_docm, c_File.m_GetFileName(refDocument.FullDocumentName)) == false)
li_pos = 0;
else if (!string.IsNullOrEmpty(m_IsFileNameCheckout(refDocument.FullDocumentName)))
li_pos = 1;
else
li_pos = 2;
count = count + 1;
icon = IconReader.GetFileIcon(refDocument.FullDocumentName, IconReader.IconSize.Small, false);
m_IPictureDisp = AxHostConverter.ImageToPictureDisp(icon.ToBitmap());
m_childNodeClientResource = bps.ClientNodeResources.Add("testRsc" + count.ToString(), count, m_IPictureDisp);
//Add 1 Child Nodes.
m_childNodeDefinition = (Inventor.ClientBrowserNodeDefinition)bps.CreateBrowserNodeDefinition(
refDocument.DisplayName,
200 + count,
m_childNodeClientResource,
refDocument.FullDocumentName,
m_childNodeClientResource,
m_statusClientNodeResource[li_pos],
ls_toolTipStatus[li_pos]);
m_childNode = m_customBrowserPane.TopNode.AddChild((Inventor.BrowserNodeDefinition)m_childNodeDefinition);
}
m_customBrowserPane.Activate();
What could be?
Thanks & Regards,
Rui