private static void TestOceanikServerInsertWordIn(string url, string word) { using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { Console.WriteLine("TestOceanikServerInsertWordIn(" + url + "," + word + ")"); SPList spList = oceanikServerObject.TranslationList; Console.WriteLine("TATA1"); /*int i = 0; * foreach (SPListItem spListItem in spList.Items) * { * if ((bool)(spListItem["isCustomize"])) * { * Console.WriteLine(i + " @@ " + spListItem["EN"]); * } * //Console.WriteLine(i + " @ " + spListItem["EN"]); * i++; * }*/ SPListItem v = spList.Items.Add(); /*Console.WriteLine("TATA2"); * v["EN"] = "Hi";*/ Console.WriteLine("TATAHI"); v["FR"] = "Bonjour"; Console.WriteLine("TATAFR"); v.Update(); Console.WriteLine("TATA"); //v.Delete(); } }
/// <summary> /// Tests the oceanik server default lang. /// </summary> /// <param name="url">The URL.</param> /// <returns></returns> private static int TestOceanikServerDefaultLang(string url) { using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { Console.WriteLine("TestOceanikServerDefaultLang(" + url + ")"); return(oceanikServerObject.DefaultLang); } }
/// <summary> /// Tests the oceanik server word in. /// </summary> /// <param name="url">The URL.</param> /// <param name="word">The word.</param> /// <returns></returns> private static bool TestOceanikServerWordIn(string url, string word) { using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { Console.WriteLine("TestOceanikServerWordIn(" + url + "," + word + ")"); return(oceanikServerObject.MatchWord(word)); } }
/// <summary> /// Tests the oceanik server object multi lang. /// </summary> /// <param name="url">The URL.</param> /// <returns></returns> private static bool TestOceanikServerObjectMultiLang(string url) { using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { Console.WriteLine("TestOceanikServerObjectMultiLang(" + url + ")"); return(oceanikServerObject.IsMultiLang); } }
/// <summary> /// Tests the oceanik server connection. /// </summary> /// <param name="url">The url.</param> private static bool TestOceanikServerConnection(string url) { using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { Console.WriteLine("TestOceanikServerConnection(" + url + ")"); return(oceanikServerObject.IsConnected()); } }
/// <summary> /// Determines whether [is supported lang] [the specified URL]. /// </summary> /// <param name="url">The URL.</param> /// <param name="lang">The lang.</param> /// <returns> /// <c>true</c> if [is supported lang] [the specified URL]; otherwise, <c>false</c>. /// </returns> private static bool IsSupportedLang(string url, string lang) { using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { Console.WriteLine("IsSupportedLang(" + url + "," + lang + ")"); Console.WriteLine("language " + lang + "is supported " + oceanikServerObject.LangList.Contains(LangCode(LangIndex(lang)))); return(oceanikServerObject.LangList.Contains(LangCode(LangIndex(lang)))); } }
/// <summary> /// Determines whether [is supported language] [the specified language code]. /// </summary> /// <param name="languageCode">The language code.</param> /// <returns> /// <c>true</c> if [is supported language] [the specified language code]; otherwise, <c>false</c>. /// </returns> public static bool IsSupportedLanguage(string languageCode) { bool boo = false; using (OceanikServerObject oceanikServerObject = new OceanikServerObject( webApplicationUrl.Replace("/SitePages/Home.aspx", ""))) { boo = oceanikServerObject.IsLangPresent(languageCode); } return(boo); }
/// <summary> /// Tests the oceanik server enter words in. /// </summary> /// <param name="url">The URL.</param> /// <param name="myLangs">My langs.</param> /// <param name="myWords">My words.</param> private static void TestOceanikServerEnterWordsIn(string url, List <string> myLangs, List <string> myWords) { //bool boo = true; using (OceanikServerObject oceanikServerObject = new OceanikServerObject(url)) { oceanikServerObject.InsertWordList(myLangs, myWords); /*int i = 0; * SPListItem spListItem = oceanikServerObject.TranslationList.Items.Add(); * foreach (string word in myWords) * { * boo = boo && oceanikServerObject.MatchWord(word); * Console.WriteLine("TestOceanikServerEnterWordsIn(" + word + ") " + boo); * spListItem[myLangs.ElementAt(i)] = word; * Console.WriteLine(myLangs.ElementAt(i) + " Adding " + word); * i++; * } * spListItem.Update();*/ } }