Exemple #1
0
        private void HistoryList_Opened(object sender, EventArgs e)
        {
            ObservableList <object> newContext = new ObservableList <object>();

            foreach (HistoryStep step in m_History.Step)
            {
                // translate the entries
                string cat = L3.Cargo.Common.Resources.ResourceManager.GetString(step.category.Replace(" ", ""), CultureResources.getCultureSetting());
                if (cat == null)
                {
                    // if there is no resource string for the key just use the key
                    cat = step.category;
                }
                string desc = L3.Cargo.Common.Resources.ResourceManager.GetString(step.description.Replace(" ", ""), CultureResources.getCultureSetting());
                if (desc == null)
                {
                    if (step.description.StartsWith("Step"))
                    {
                        desc  = L3.Cargo.Common.Resources.Step + " ";
                        desc += step.description.Substring(desc.Length);
                    }
                    else if (step.description.StartsWith("Range:"))
                    {
                        desc  = L3.Cargo.Common.Resources.Range_Colon + " ";
                        desc += step.description.Substring(desc.Length);
                    }
                    else
                    {
                        // if there is no resource string for the key just use the key
                        desc = step.description;
                    }
                }

                var entry = new { number = step.number, category = cat, description = desc };
                newContext.Add(entry);
            }
            History_ListView.DataContext   = newContext;
            History_ListView.SelectedIndex = (m_History.Step.Count - 1);

            History_ListView.InvalidateVisual();
        }
Exemple #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            AttachmentType attachmentType = (AttachmentType)value;
            string         translated     = L3.Cargo.Common.Resources.ResourceManager.GetString(attachmentType.ToString(), CultureResources.getCultureSetting());

            if (String.IsNullOrEmpty(translated))
            {
                // there is no translation for the type
                translated = attachmentType.ToString();
            }
            return(translated);
        }
Exemple #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            WorkstationDecision decision = (WorkstationDecision)value;
            string translated            = L3.Cargo.Common.Resources.ResourceManager.GetString(decision.ToString(), CultureResources.getCultureSetting());

            if (String.IsNullOrEmpty(translated))
            {
                return(decision.ToString());
            }
            else
            {
                return(translated);
            }
        }