コード例 #1
0
 public void Undelete(BusinessDocument doc)
 {
     if (doc.GetType() != m_SupportedType)
       {
     throw new DocumentNotSupportedException();
       }
       DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)];
       if (value1 == null)
       {
     throw new DocumentNotInContainerException();
       }
       if (value1.State != DocumentState.Deleted)
       {
     throw new DocumentInvalidStateException();
       }
       value1.State = value1.PrevState;
       doc.SetDocumentState(value1.State);
 }
コード例 #2
0
 public int Add(BusinessDocument doc, DocumentState iniState)
 {
     if (doc.GetType() != m_SupportedType)
       {
     throw new DocumentNotSupportedException();
       }
       DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)];
       if (value1 != null)
       {
     if (value1.State == DocumentState.Deleted)
     {
       throw new DocumentInvalidStateException();
     }
     throw new ContainerPKViolationException();
       }
       int num1 = m_AllContainer.Add(doc);
       m_IndexList.Add(GetHash(doc), new DocumentIndexValue(num1, iniState, DocumentState.Unknown));
       doc.SetDocumentState(iniState);
       return num1;
 }