Ejemplo n.º 1
0
 public IDocumentReader Read()
 {
     if (m_reader == null)
     {
         try
         {
             m_reader = new DocumentReader();
             m_impl.Read(m_reader);
         }
         catch (Workshare.Exception.WsException e)
         {
             Workshare.Interop.Logging.Logger.LogError(e);
             throw new Workshare.Exception.WsException("The file '" + FileName + "' could not be read. It may be in one of the unsupported Microsoft Office 6/95 file formats.", e);
         }
     }
     return m_reader;
 }
Ejemplo n.º 2
0
        internal static bool MatchValue(DocumentReader.StringTriplet fromDoc, string propname, string proptype, string propvalue)
        {
            if (fromDoc.Third.ToLowerInvariant() != proptype.ToLowerInvariant())
                return false;

            if (fromDoc.First.ToLowerInvariant() != propname.ToLowerInvariant())
                return false;

            try
            {
                switch (proptype.ToLowerInvariant())
                {
                    case "long":
                        return Convert.ToInt64(fromDoc.Second, CultureInfo.InvariantCulture) == Convert.ToInt64(propvalue, CultureInfo.InvariantCulture);
                    default:
                        return fromDoc.Second.ToLowerInvariant() == propvalue.ToLowerInvariant();
                }
            }
            catch(Exception ex)
            {
				Logger.LogError(string.Format(CultureInfo.InvariantCulture, "Couldn't compare the value of property {0}", propname));
				Logger.LogError(ex);
                return false;
            }
        }