public FileManagerHelperModel(FileManagerItem fileManagerItem, DocumentsApp app, string sourceName)
        {
            long itemId = long.Parse(fileManagerItem.Id);
                Item item = app.Data.FindItemById(itemId);

                Name = fileManagerItem.Name;
                ModifiedText = String.Format("Modified {0}", GetModifiedInfoString(fileManagerItem.LastWriteTime));
                OwnerText = (item.Owner.Id == app.User.CurrentUser.Id) ? "Me" : item.Owner.Name;
                SizeText = item.IsFolder ? "" : CommonUtils.GetSizeString(fileManagerItem.Length);

                ThumbImageStyle = String.Format("background-image:url({0})", ToAbsoluteUrl(fileManagerItem.ThumbnailUrl));

                IconImageSrc = ToAbsoluteUrl(app.Image.GetFooterItemIconVirtPath(item));
                IconImageAlt = "Item type here";
                IconImageStyle = String.IsNullOrEmpty(IconImageSrc) ? "display: none;" : "";
                IconImageDetailsSrc = ToAbsoluteUrl(app.Image.GetDetailsViewItemIcon(item) ?? fileManagerItem.ThumbnailUrl);

                ImageHolderHRef = "javascript:;";
                ImageHolderOnDown = "App.onItemLinkMouseDown(event)";

                if (item.IsFolder)
                     ImageHolderOnClick = "App.onFolderItemLinkClick(event)";
                else
                {
                     ImageHolderOnClick = "App.onFileItemLinkClick(event)";
                     if (app.Document.IsDocumentEditingAllowed(item))
                          ImageHolderTarget = "_blank";

                     string href = app.Document.GetDocumentEditorRequestUrl(fileManagerItem.FullName, sourceName);
                     ImageHolderHRef = href; //.HtmlEncode(href);
                }

                FooterClass = "itemFooter";
                User user = app.Document.GetDocumentLockOwner(item);
                if (user != null)
                {
                     ItemLockStyle = "display: block;";
                     if (user.Id == app.User.CurrentUser.Id)
                     {
                          ItemLockSrc = ToAbsoluteUrl(app.Image.EditIconVirtPath);
                          ItemLockAlt = "Opened by Me";
                     }
                     else
                     {
                          ItemLockSrc = app.Image.LockIconVirtPath;
                          ItemLockAlt = String.Format("Locked by {0}", user.Name);

                     }
                     FooterClass += " itemLocked";
                }
        }
Esempio n. 2
0
 public AvatarService(DocumentsApp app)
     : base(app)
 {
 }
Esempio n. 3
0
 public ThumbnailService(DocumentsApp app)
     : base(app)
 {
     ImageExtensions = new string[] { ".png", ".gif", ".jpg", ".jpeg", ".ico", ".bmp" };
 }
Esempio n. 4
0
 public ImageService(DocumentsApp app)
     : base(app)
 {
     ThumbnailUpdatingEnabled = false;
         AvatarService = new AvatarService(app);
         ThumbnailService = new ThumbnailService(app);
 }
Esempio n. 5
0
 public GeneralFileSystemProvider(DocumentsApp app, string rootFolder)
     : base(rootFolder)
 {
     DocumentsApp = app;
         FolderLastWriteTimeCache = new Dictionary<long, DateTime>();
         FileSizeCache = new Dictionary<long, long>();
         RefreshFolderCache();
 }
Esempio n. 6
0
 public FileSystemService(DocumentsApp app)
     : base(app)
 {
 }
Esempio n. 7
0
 public FilteredFileSystemProvider(DocumentsApp app, string rootFolder)
     : base(rootFolder)
 {
     DocumentsApp = app;
         FileSizeCache = new Dictionary<long, long>();
 }
Esempio n. 8
0
 static DocumentsApp GetInstance()
 {
     if (DemoUtils.IsSiteMode)
              return DemoUtils.GetSiteModeAppInstance();
         else
         {
              if (instance == null)
              {
                   instance = new DocumentsApp();
                   instance.Initialize();
              }
              return instance;
         }
 }
Esempio n. 9
0
 public ServiceBase(DocumentsApp app)
 {
     DocumentsApp = app;
 }
Esempio n. 10
0
 protected static FileSystemProviderBase CreateFileSystemProvider(DocumentsApp app, string selectedFilter)
 {
     if (selectedFilter != "All")
     {
         FilteredFileSystemProvider queryProvider = new FilteredFileSystemProvider(app, "")
         {
             FileQuery = app.FileSystem.GetFilesFromSource(selectedFilter)
         };
         return queryProvider;
     }
     return new GeneralFileSystemProvider(app, "Files");
 }
Esempio n. 11
0
 public UserService(DocumentsApp app)
     : base(app)
 {
     ActivityRegistry = new ConcurrentDictionary<string, DateTime>();
 }