SIL.FieldWorks.Common.Framework.DetailControls.Slice.Slice.GetAtomicContext C# (CSharp) Méthode

GetAtomicContext() private méthode

private GetAtomicContext ( int &hvoOwner, int &flid ) : bool
hvoOwner int
flid int
Résultat bool
		public bool GetAtomicContext(out int hvoOwner, out int flid)
		{
			CheckDisposed();

			// Compiler requires values to be set, but these are meaningless.
			hvoOwner = 0;
			flid = 0;
			if (m_key == null)
				return false;

			for (int inode = m_key.Length; --inode >= 0; )
			{
				object objNode = m_key[inode];
				if (objNode is XmlNode)
				{
					var node = (XmlNode)objNode;
					if (node.Name == "atomic")
					{
						// got it!
						// The next thing we push into key right after the "atomic" node is always the
						// HVO of the particular item we're editing.
						var hvoItem = (int)(m_key[inode + 1]);
						string attrName = node.Attributes["field"].Value;
						FdoCache cache = ContainingDataTree.Cache;
						flid = cache.DomainDataByFlid.MetaDataCache.GetFieldId2(
							cache.ServiceLocator.GetInstance<ICmObjectRepository>().GetObject(hvoItem).Owner.ClassID,
							attrName,
							true);
						return true;
					}
				}
			}
			return false;
		}