Esempio n. 1
0
        private string GetSaveLabelText(MultipleLanguageLabel label)
        {
            string saveLabel = "";

            for( int i = 0; i < label.NumberLanguages; i++ )
            {
                if( i == 0 )
                    saveLabel = label.GetLabel(0);

                else
                {
                    bool labelSameAsFirst = label.GetLabel(i).Equals(label.GetLabel(0));
                    saveLabel = String.Format("{0}{1}{2}",saveLabel,DataDictionaryElements.DICT_LABEL_LANGUAGE_SEPARATOR,labelSameAsFirst ? "" : label.GetLabel(i));
                }
            }

            return saveLabel;
        }
Esempio n. 2
0
        private string GetSaveLabelText(MultipleLanguageLabel label)
        {
            string saveLabel = "";

            for (int i = 0; i < label.NumberLanguages; i++)
            {
                if (i == 0)
                {
                    saveLabel = label.GetLabel(0);
                }

                else
                {
                    bool labelSameAsFirst = label.GetLabel(i).Equals(label.GetLabel(0));
                    saveLabel = String.Format("{0}{1}{2}", saveLabel, DataDictionaryElements.DICT_LABEL_LANGUAGE_SEPARATOR, labelSameAsFirst ? "" : label.GetLabel(i));
                }
            }

            return(saveLabel);
        }
Esempio n. 3
0
        private static void ParseLabel(MultipleLanguageLabel label, string value)
        {
            int languageIndex = 0;
            int pipePos;

            while ((pipePos = value.IndexOf(DataDictionaryElements.DICT_LABEL_LANGUAGE_SEPARATOR)) >= 0)
            {
                label.SetLabel(value.Substring(0, pipePos), languageIndex);
                value = value.Substring(pipePos + 1);
                languageIndex++;
            }

            label.SetLabel(value, languageIndex);

            // any blank labels should take the value from the first label
            for (int i = 1; i <= languageIndex; i++)
            {
                if (String.IsNullOrEmpty(label.GetLabel(i)))
                {
                    label.SetLabel(label.GetLabel(0), i);
                }
            }
        }
Esempio n. 4
0
        private static void ParseLabel(MultipleLanguageLabel label,string value)
        {
            int languageIndex = 0;
            int pipePos;

            while( ( pipePos = value.IndexOf(DataDictionaryElements.DICT_LABEL_LANGUAGE_SEPARATOR) ) >= 0 )
            {
                label.SetLabel(value.Substring(0,pipePos),languageIndex);
                value = value.Substring(pipePos + 1);
                languageIndex++;
            }

            label.SetLabel(value,languageIndex);

            // any blank labels should take the value from the first label
            for( int i = 1; i <= languageIndex; i++ )
            {
                if( String.IsNullOrEmpty(label.GetLabel(i)) )
                    label.SetLabel(label.GetLabel(0),i);
            }
        }