예제 #1
0
        public bool IsPropertyWriteable(PropertyKey key)
        {
            if (m_IPropertyStoreCapabilities == null)
            {
                m_IPropertyStoreCapabilities = (PropertyStoreInterop.IPropertyStoreCapabilities)m_IPropertyStore;
            }

            Int32 hResult = m_IPropertyStoreCapabilities.IsPropertyWritable(ref key);

            if (hResult == 0)
            {
                return(true);
            }
            if (hResult > 0)
            {
                return(false);
            }
            Marshal.ThrowExceptionForHR(hResult);
            return(false);   // This should not occur
        }
예제 #2
0
        private void Dispose(bool disposing)
        {
            if (m_IPropertyStore != null)
            {
                if (!disposing)
                {
                    Debug.Fail("Failed to dispose PropertyStore");
                }

                Marshal.FinalReleaseComObject(m_IPropertyStore);
                m_IPropertyStore = null;
            }

            if (m_IPropertyStoreCapabilities != null)
            {
                Marshal.FinalReleaseComObject(m_IPropertyStoreCapabilities);
                m_IPropertyStoreCapabilities = null;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }