예제 #1
0
        public static string GetIconPath(string iconName, bool enabled)
        {
            string fileName    = IconNameMapper.GetIconFileName(iconName) + ".png";
            string exePath     = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string projectPath = Directory.GetParent(exePath).Parent.Parent.FullName;
            string iconPath;

            if (!enabled)
            {
                iconPath = System.IO.Path.Combine(projectPath, "WPF", "Icons", "disabled", fileName);
            }
            else
            {
                iconPath = System.IO.Path.Combine(projectPath, "WPF", "Icons", fileName);
            }

            return(iconPath);
        }
예제 #2
0
        public void Setup()
        {
            if (genericMenuItemController.Icon != null && genericMenuItemController.Icon.Length > 0)
            {
                string iconFileName = IconNameMapper.GetIconFileName(genericMenuItemController.Icon);
                if (iconFileName != null)
                {
                    toolbarButtonItemImplementation.SetIcon(iconFileName, !genericMenuItemController.Disabled);
                }
                else
                {
                    toolbarButtonItemImplementation.SetCaption(genericMenuItemController.Caption);
                }
            }
            else
            {
                toolbarButtonItemImplementation.SetCaption(genericMenuItemController.Caption);
            }

            toolbarButtonItemImplementation.Disabled = genericMenuItemController.Disabled;
        }
예제 #3
0
        public void Setup()
        {
            if (((GnosisGenericMenu)genericMenuItemController.ControlImplementation).GnosisIcon != null &&
                ((GnosisGenericMenu)genericMenuItemController.ControlImplementation).GnosisIcon.Length > 0)
            {
                string iconFileName = IconNameMapper.GetIconFileName(((GnosisGenericMenu)genericMenuItemController.ControlImplementation).GnosisIcon);
                if (iconFileName != null)
                {
                    toolbarButtonItemImplementation.GnosisIcon = iconFileName;//, !genericMenuItemController.Disabled);
                }
                else
                {
                    toolbarButtonItemImplementation.Caption = ((GnosisGenericMenu)genericMenuItemController.ControlImplementation).Caption;
                }
            }
            else
            {
                toolbarButtonItemImplementation.Caption = ((GnosisGenericMenu)genericMenuItemController.ControlImplementation).Caption;
            }

            // toolbarButtonItemImplementation.Disabled = ((GnosisGenericMenu)genericMenuItemController.ControlImplementation).Disabled;
        }