示例#1
0
        private static string GetCTA_URI(ListItemIcon icon, string ctaURI)
        {
            if (String.IsNullOrWhiteSpace(ctaURI))
            {
                switch (icon)
                {
                case ListItemIcon.Start:
                    ctaURI = URI_CTA_START;
                    break;

                case ListItemIcon.Sync:
                    ctaURI = URI_CTA_SYNC;
                    break;

                case ListItemIcon.Hello:
                    ctaURI = URI_CTA_HELLO;
                    break;

                case ListItemIcon.Office:
                    ctaURI = URI_CTA_OFFICE;
                    break;

                default:
                    break;
                }
            }

            return(ctaURI);
        }
示例#2
0
        public static ListItem CreateListItem(int order, ListItemIcon icon, double width, string headline, string lede, string _ctaURI = "", string _ctaText = "", string _ctaTelemetryId = "", string _iconPath = "")
        {
            // create the item
            ListItem item = new ListItem();

            // set basic properties
            item.Order     = order;
            item.Icon      = icon;
            item.IconWidth = width;
            item.Headline  = headline;
            item.Lede      = lede;
            item.CTAUri    = GetCTA_URI(icon, _ctaURI);
            item.CTAText   = _ctaText;
            // set calculated properties
            item.IconPath = GetIconPath(icon, _iconPath);
            // commented out until Tel.Svc is added
            //item.TelemetryId = GetTelemetryId(icon, _ctaTelemetryId);

            return(item);
        }
示例#3
0
        public NormalListItem(string name, ListItemGroup group, ListItemIcon icon) : this(name, group, null)
        {
            GeometryGroup iconVector;
            switch (icon)
            {
                case ListItemIcon.Queue:
                    iconVector = (GeometryGroup)Application.Current.Resources["VectorQueue"];
                    break;
                case ListItemIcon.Charts:
                    iconVector = (GeometryGroup)Application.Current.Resources["VectorCharts"];
                    break;
                case ListItemIcon.History:
                    iconVector = (GeometryGroup)Application.Current.Resources["VectorHistory"];
                    break;
                case ListItemIcon.Favorites:
                    iconVector = (GeometryGroup)Application.Current.Resources["VectorFavorite"];
                    break;
                default:
                    throw new ArgumentOutOfRangeException("icon");
            }

            Initalize(name, group, iconVector);
        }
示例#4
0
        public static string GetIconPath(ListItemIcon icon, string iconPath)
        {
            if (String.IsNullOrWhiteSpace(iconPath))
            {
                switch (icon)
                {
                case ListItemIcon.Jot:
                    iconPath = ICON_JOT_URI;
                    break;

                case ListItemIcon.Write:
                    iconPath = ICON_WRITE_URI;
                    break;

                case ListItemIcon.Pressure:
                    iconPath = ICON_PRESSURE_URI;
                    break;

                case ListItemIcon.Palm:
                    iconPath = ICON_PALM_URI;
                    break;

                case ListItemIcon.Design:
                    iconPath = ICON_DESIGN_URI;
                    break;

                case ListItemIcon.Performance:
                    iconPath = ICON_PERFORMANCE_URI;
                    break;

                case ListItemIcon.Laptop:
                    iconPath = ICON_LAPTOP_URI;
                    break;

                case ListItemIcon.ScreenSize:
                    iconPath = ICON_SCREENSIZE_URI;
                    break;

                case ListItemIcon.Display:
                    iconPath = ICON_DISPLAY_URI;
                    break;

                case ListItemIcon.Sound:
                    iconPath = ICON_AUDIO_URI;
                    break;

                case ListItemIcon.Lightweight:
                    iconPath = ICON_LIGHTWEIGHT_URI;
                    break;

                case ListItemIcon.Battery:
                    iconPath = ICON_BATTERY_URI;
                    break;

                case ListItemIcon.Creative:
                    iconPath = ICON_CREATIVE_URI;
                    break;

                case ListItemIcon.Connection:
                    iconPath = ICON_CONNECTION_URI;
                    break;

                case ListItemIcon.Versatile:
                    iconPath = ICON_VERSATILE_URI;
                    break;

                case ListItemIcon.Wifi:
                    iconPath = ICON_WIFI_URI
                    ;
                    break;

                case ListItemIcon.Pen:
                    iconPath = ICON_PEN_URI;
                    break;

                case ListItemIcon.Start:
                    iconPath = ICON_START_URI;
                    break;

                case ListItemIcon.Sync:
                    iconPath = ICON_SYNC_URI;
                    break;

                case ListItemIcon.Hello:
                    iconPath = ICON_HELLO_URI;
                    break;

                case ListItemIcon.Office:
                    iconPath = ICON_OFFICE_URI;
                    break;

                case ListItemIcon.Dimensions:
                    iconPath = ICON_DIMENSIONS_URI;
                    break;

                case ListItemIcon.Weight:
                    iconPath = ICON_WEIGHT_URI;
                    break;

                case ListItemIcon.Speaker:
                    iconPath = ICON_SPEAKER_URI;
                    break;

                case ListItemIcon.Frequency:
                    iconPath = ICON_FREQUENCY_URI;
                    break;

                case ListItemIcon.Compatibility:
                    iconPath = ICON_COMPATIBILITY_URI;
                    break;

                case ListItemIcon.TouchControls:
                    iconPath = ICON_TOUCHCONTROLS_URI;
                    break;

                case ListItemIcon.BatteryLife:
                    iconPath = ICON_BATTERYLIFE_URI;
                    break;

                case ListItemIcon.NoiseCancellation:
                    iconPath = ICON_NOISECANCELLATION_URI;
                    break;

                case ListItemIcon.Inputs:
                    iconPath = ICON_INPUTS_URI;
                    break;

                case ListItemIcon.HeadPhones:
                    iconPath = ICON_HEADPHONES_URI;
                    break;

                case ListItemIcon.USB:
                    iconPath = ICON_USB_URI;
                    break;

                case ListItemIcon.Stereo:
                    iconPath = ICON_STEREO_URI;
                    break;

                case ListItemIcon.Case:
                    iconPath = ICON_CASE_URI;
                    break;

                case ListItemIcon.Docs:
                    iconPath = ICON_DOCS_URI;
                    break;

                default:
                    break;
                }
            }

            return(iconPath);
        }