예제 #1
0
 internal Database(NotesAccessor accessor, Domino.NotesDatabase notesDb)
 {
     if (!notesDb.IsOpen)
     {
         notesDb.Open();
     }
     this._accessor   = accessor;
     this._notesDb    = notesDb;
     this._title      = notesDb.Title;
     this._server     = notesDb.Server;
     this._sourceType = (NotesDbType)(int)notesDb.type;
     this._targetType = MappingInfo.GetTagetDbType(this._sourceType);
     this._fileName   = notesDb.FileName;
     this._notesUrl   = notesDb.NotesURL;
     this._replicaId  = notesDb.ReplicaID;
     this._sourcePath = notesDb.FilePath;
 }
예제 #2
0
        /// <summary>
        /// NotesDateBaseの変換先のSPListタイプを取得する
        /// </summary>
        /// <param name="dbType"></param>
        /// <returns></returns>
        public static SPListType GetTagetDbType(NotesDbType dbType)
        {
            string typeName = dbType.ToString();
            var    result   = DbTypeMap.Where(row => row.NotesDbType == typeName);

            if (result.Count() == 0)
            {
                result = DbTypeMap.Where(row => row.NotesDbType == "DEFAULT");
            }
            SPListType type = SPListType.InvalidType;

            if (result.Count() > 0 && result.First().CanConvert)
            {
                if (Enum.TryParse(result.First().SPListType, out type))
                {
                    return(type);
                }
            }
            return(SPListType.InvalidType);
        }