예제 #1
0
		public void InitDefault ()
		{
			m_MyInt			= 69;
			m_MyString		= "This is a test string";
			m_MyXmlString	= new XmlString ("Native XML string object");
			m_MyFloat		= 3.14f;

			m_MyXmlDateTime				= new XmlDateTime (DateTime.Now);
			m_MyXmlColor				= new XmlColor	(Color.BurlyWood);
			m_MyXmlSizeF2d				= new XmlSizeF2d (452.62f, 895.7989f);
			m_MyXmlItemKeyAndValue		= new XmlItemKeyAndValue ("KeyNameToUse", m_MyXmlColor);
			m_MyXmlTranslatorElement	= new XmlTranslatorElement ("MyInternalName", 0);
			m_MyXmlTranslatorElement.AddOrUpdate (Language.English, "My translated text", "The last modifiying person", DateTime.Now);
			m_MyXmlTranslatorElement.AddOrUpdate (Language.German, "My translated text in German", "The last modifiying person", DateTime.Now);

			m_MyXmlPen			= new XmlPen (Color.Violet, 20);

			m_MyArrayList		= new ArrayList ();
			m_MyArrayList.Add (this.MyInt);
			m_MyArrayList.Add (this.MyFloat);
			m_MyArrayList.Add (this.MyString);
			m_MyArrayList.Add (this.MyXmlString);
			
			m_MyXmlList			= new XmlList ();
			m_MyXmlList.Add (this.MyInt);
			m_MyXmlList.Add (this.MyFloat);
			m_MyXmlList.Add (this.MyString);
			m_MyXmlList.Add (this.MyXmlString);

			m_MyXmlHashtable	= new XmlHashtable ();
			m_MyXmlHashtable.Add ("HashElement1", m_MyInt);
			m_MyXmlHashtable.Add ("HashElement2", m_MyString);
			m_MyXmlHashtable.Add ("HashElement3", m_MyXmlString);
			m_MyXmlHashtable.Add ("HashElement4", m_MyFloat);
			m_MyXmlHashtable.Add ("HashElement5", m_MyXmlList);
		}
예제 #2
0
        /// <summary>
        /// Add or update a word translation in a specific language
        /// </summary>
        /// <param name="destinationLanguage">Destination language</param>
        /// <param name="translatedText">Word translated into destination language</param>
        /// <param name="lastModifyingPerson">Just keep a trace of person who have modified this translation</param>
        /// <param name="lastModificationTime">Keep last modification time</param>
        /// <returns>Return true if an element have been updated, false otherwise</returns>
        public bool AddOrUpdate(Language destinationLanguage, string translatedText, string lastModifyingPerson, DateTime lastModificationTime)
        {
            bool TranslationUpdated = false;

            if (m_LocalizedStrings != null)
            {
                // Add or update
                for (int i = 0; i < m_LocalizedStrings.Count; i++)
                {
                    XmlTranslatorLocalizedElement CurrentElement = (XmlTranslatorLocalizedElement)m_LocalizedStrings.Items[i];
                    if (CurrentElement.LanguageUsed.Language == destinationLanguage)
                    {
                        // Update element
                        CurrentElement.TranslatedString    = new XmlString(translatedText);
                        CurrentElement.LastModifyingPerson = new XmlString(lastModifyingPerson);
                        CurrentElement.LastModified        = new XmlDateTime(lastModificationTime);
                        TranslationUpdated = true;
                        break;
                    }
                }
            }
            else
            {
                // Create list
                m_LocalizedStrings = new XmlList();
            }

            if (!TranslationUpdated)
            {
                // Add new translation
                XmlTranslatorLocalizedElement NewElement = new XmlTranslatorLocalizedElement(destinationLanguage, translatedText, lastModifyingPerson, lastModificationTime);
                m_LocalizedStrings.Add(NewElement);
            }

            return(TranslationUpdated);
        }
예제 #3
0
 public XmlConfigurationNode(string nodeName)
 {
     m_NodeName = nodeName;
     m_SubNodes = new XmlList();
 }
예제 #4
0
 public XmlConfigurationNode()
 {
     m_NodeName = String.Empty;
     m_SubNodes = new XmlList();
 }
예제 #5
0
		/// <summary>
		/// Add or update a word translation in a specific language
		/// </summary>
		/// <param name="destinationLanguage">Destination language</param>
		/// <param name="translatedText">Word translated into destination language</param>
		/// <param name="lastModifyingPerson">Just keep a trace of person who have modified this translation</param>
		/// <param name="lastModificationTime">Keep last modification time</param>
		/// <returns>Return true if an element have been updated, false otherwise</returns>
		public bool AddOrUpdate (Language destinationLanguage, string translatedText, string lastModifyingPerson, DateTime lastModificationTime)
		{
			bool	TranslationUpdated = false;

			if (m_LocalizedStrings	!= null)
			{
				// Add or update
				for (int i = 0; i < m_LocalizedStrings.Count; i++)
				{
					XmlTranslatorLocalizedElement CurrentElement = (XmlTranslatorLocalizedElement)m_LocalizedStrings.Items[i];
					if (CurrentElement.LanguageUsed.Language == destinationLanguage)
					{
						// Update element
						CurrentElement.TranslatedString		= new XmlString (translatedText);
						CurrentElement.LastModifyingPerson	= new XmlString (lastModifyingPerson);
						CurrentElement.LastModified			= new XmlDateTime(lastModificationTime);
						TranslationUpdated					= true;
						break;
					}
				}
			}
			else
			{
				// Create list
				m_LocalizedStrings	= new XmlList ();
			}

			if (!TranslationUpdated)
			{
				// Add new translation
				XmlTranslatorLocalizedElement NewElement = new XmlTranslatorLocalizedElement (destinationLanguage, translatedText, lastModifyingPerson, lastModificationTime);
				m_LocalizedStrings.Add (NewElement);
			}

			return TranslationUpdated;
		}
예제 #6
0
		public XmlTranslatorElement(string internalName, int filePosition)
		{
			m_FilePosition		= filePosition;
			m_InternalName		= internalName;
			m_LocalizedStrings	= new XmlList ();
		}
예제 #7
0
		public XmlTranslatorElement()
		{
			//m_FilePosition		= 0;
			m_InternalName		= string.Empty;
			m_LocalizedStrings	= new XmlList ();
		}
예제 #8
0
		public XmlConfigurationNode(string nodeName)
		{
			m_NodeName	= nodeName;
			m_SubNodes	= new XmlList ();
		}
예제 #9
0
		public XmlConfigurationNode()
		{
			m_NodeName	= String.Empty;
			m_SubNodes	= new XmlList ();
		}
예제 #10
0
 public XmlTranslatorElement(string internalName, int filePosition)
 {
     m_FilePosition     = filePosition;
     m_InternalName     = internalName;
     m_LocalizedStrings = new XmlList();
 }
예제 #11
0
 public XmlTranslatorElement()
 {
     //m_FilePosition		= 0;
     m_InternalName     = string.Empty;
     m_LocalizedStrings = new XmlList();
 }