public static bool RegisterFileExtension(string extension, FileType type)
 {
     lock (DictLock)
     {
         if (FileTypeDictionary.ContainsKey(extension))
         {
             return(false);
         }
         FileTypeDictionary.Add(extension, type);
         return(true);
     }
 }
        private void loadOperationFileType_Completed(object sender, EventArgs e)
        {
            FileTypeList.Clear();
            FileTypeDictionary.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (Web.Model.filetype filetype in loadOperation.Entities)
            {
                FileTypeEntity lFileTypeEntity = new FileTypeEntity();
                lFileTypeEntity.FileType = filetype;
                lFileTypeEntity.Update();
                FileTypeList.Add(lFileTypeEntity);
                FileTypeDictionary.Add(lFileTypeEntity.FileTypeId, lFileTypeEntity);
            }

            DocumentViewModel.FileTypeEntityDictionary = FileTypeDictionary;
            DocumentViewModel.FileTypeEntityList       = FileTypeList;

            LoadOperation <DocumentManager.Web.Model.user> loadOperationUser =
                documentManagerContext.Load <DocumentManager.Web.Model.user>(documentManagerContext.GetUserQuery());

            loadOperationUser.Completed += loadOperationUser_Completed;
        }