Example #1
0
        public void UnicodeProp()
        {
            CheckDisposed();
            string strNew = m_ISilDataAccess.get_UnicodeProp(1119, 2229);

            Assert.IsNull(strNew);
            Assert.IsFalse(m_ISilDataAccess.IsDirty());

            string str = "UnicodeTest";

            m_ISilDataAccess.SetUnicode(1119, 2229, str, str.Length);
            strNew = m_ISilDataAccess.get_UnicodeProp(1119, 2229);
            Assert.AreEqual(str, strNew);
            Assert.IsTrue(m_ISilDataAccess.IsDirty());

            str = "SecondUnicodeTest";
            m_ISilDataAccess.SetUnicode(1119, 2229, str, str.Length);
            strNew = m_ISilDataAccess.get_UnicodeProp(1119, 2229);
            Assert.AreEqual(str, strNew);
            Assert.IsTrue(m_ISilDataAccess.IsDirty());

            str = "ThirdUnicodeTest";
            m_ISilDataAccess.set_UnicodeProp(1119, 2229, str);
            int cch;

            using (ArrayPtr arrayPtr = MarshalEx.StringToNative(100, true))
            {
                m_ISilDataAccess.UnicodePropRgch(1119, 2229, arrayPtr, 100, out cch);
                strNew = MarshalEx.NativeToString(arrayPtr, cch, true);
                Assert.AreEqual(str, strNew);
                Assert.AreEqual(str.Length, cch);
                Assert.IsTrue(m_ISilDataAccess.IsDirty());

                m_ISilDataAccess.UnicodePropRgch(1119, 2229, ArrayPtr.Null, 0, out cch);
                Assert.AreEqual(str.Length, cch);

                CheckProp(1119, 2229, str, CellarModuleDefns.kcptUnicode);
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="hvo"></param>
 /// <param name="tag"></param>
 /// <param name="_rgch"></param>
 /// <param name="cch"></param>
 public void SetUnicode(int hvo, int tag, string _rgch, int cch)
 {
     VerifyUpdate(hvo, tag);
     m_sda.SetUnicode(hvo, tag, _rgch, cch);
 }
Example #3
0
 /// <summary>
 /// Change a Unicode property of an object.
 /// The caller should also call PropChanged to notify interested parties,
 /// except where the change is being made to a newly created object.
 ///</summary>
 /// <param name='hvo'> </param>
 /// <param name='tag'> </param>
 /// <param name='_rgch'> </param>
 /// <param name='cch'> </param>
 public virtual void SetUnicode(int hvo, int tag, string _rgch, int cch)
 {
     m_baseSda.SetUnicode(hvo, tag, _rgch, cch);
 }