Esempio n. 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="obj"></param>
 /// <param name="tag"></param>
 /// <param name="_rgch"></param>
 /// <param name="cchMax"></param>
 /// <param name="_cch"></param>
 public void UnicodePropRgch(int obj, int tag, ArrayPtr _rgch, int cchMax, out int _cch)
 {
     VerifyUpdate(obj, tag);
     m_sda.UnicodePropRgch(obj, tag, _rgch, cchMax, out _cch);
 }
Esempio n. 3
0
 /// <summary>
 /// Read a Unicode string property. See ${get_UnicodeProp} for a BSTR result.
 /// @error E_FAIL if buffer too small.
 /// pcch 0, S_FALSE if property not found (or S_OK from some implementations).
 ///</summary>
 /// <param name='obj'> </param>
 /// <param name='tag'> </param>
 /// <param name='_rgch'>Buffer for result. Pass NULL to inquire length. </param>
 /// <param name='cchMax'>Buffer length for result. Pass 0 to inquire length. </param>
 /// <param name='_cch'> </param>
 public virtual void UnicodePropRgch(int obj, int tag, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ArrayPtrMarshaler), SizeParamIndex = 3)] ArrayPtr /*OLECHAR[]*/ _rgch, int cchMax, out int _cch)
 {
     m_baseSda.UnicodePropRgch(obj, tag, _rgch, cchMax, out _cch);
 }