Beispiel #1
0
        /// <summary>
        /// Sets the title string to an appropriate default when nothing is specified in the xml configuration for the view
        /// </summary>
        protected virtual void SetInfoBarText()
        {
            if (m_informationBar == null)
            {
                return;
            }
            string className = StringTable.Table.GetString("No Record", "Misc");

            if (Clerk.CurrentObject != null)
            {
                using (var uiObj = CmObjectUi.MakeUi(Clerk.CurrentObject))
                    className = uiObj.DisplayNameOfClass;
            }
            else
            {
                string emptyTitleId = XmlUtils.GetAttributeValue(m_configurationParameters, "emptyTitleId");
                if (!String.IsNullOrEmpty(emptyTitleId))
                {
                    string titleStr;
                    XmlViewsUtils.TryFindString("EmptyTitles", emptyTitleId, out titleStr);
                    if (titleStr != "*" + emptyTitleId + "*")
                    {
                        className = titleStr;
                    }
                    Clerk.UpdateStatusBarRecordNumber(titleStr);
                }
            }
            // This code:  ((IPaneBar)m_informationBar).Text = className;
            // causes about 47 of the following exceptions when executed in Flex.
            // First-chance exception at 0x4ed9b280 in Flex.exe: 0xC0000005: Access violation writing location 0x00f90004.
            // The following code doesn't cause the exception, but neither one actually sets the Text to className,
            // so something needs to be changed somewhere. It doesn't enter "override string Text" in PaneBar.cs
            ((IPaneBar)m_informationBar).Text = className;
        }
Beispiel #2
0
        protected virtual void SetInfoBarText()
        {
            if (m_informationBar == null)
            {
                return;
            }
            string className = StringTbl.GetString("No Record", "Misc");

            if (Clerk.CurrentObject != null)
            {
                string typeName = Clerk.CurrentObject.GetType().Name;
                if (Clerk.CurrentObject is ICmPossibility)
                {
                    var possibility = Clerk.CurrentObject as ICmPossibility;
                    className = possibility.ItemTypeName(StringTbl);
                }
                else
                {
                    className = StringTbl.GetString(typeName, "ClassNames");
                }
                if (className == "*" + typeName + "*")
                {
                    className = typeName;
                }
            }
            else
            {
                string emptyTitleId = XmlUtils.GetAttributeValue(m_configurationParameters, "emptyTitleId");
                if (!String.IsNullOrEmpty(emptyTitleId))
                {
                    string titleStr;
                    XmlViewsUtils.TryFindString(StringTbl, "EmptyTitles", emptyTitleId, out titleStr);
                    if (titleStr != "*" + emptyTitleId + "*")
                    {
                        className = titleStr;
                    }
                    Clerk.UpdateStatusBarRecordNumber(titleStr);
                }
            }
            // This code:  ((IPaneBar)m_informationBar).Text = className;
            // causes about 47 of the following exceptions when executed in Flex.
            // First-chance exception at 0x4ed9b280 in Flex.exe: 0xC0000005: Access violation writing location 0x00f90004.
            // The following code doesn't cause the exception, but neither one actually sets the Text to className,
            // so something needs to be changed somewhere. It doesn't enter "override string Text" in PaneBar.cs
            (m_informationBar as IPaneBar).Text = className;
        }