Ejemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// Open
        ///
        /// <summary>
        /// Opens the first item of the specified collection.
        /// </summary>
        ///
        /// <param name="src">Facade object.</param>
        /// <param name="files">File collection.</param>
        ///
        /* ----------------------------------------------------------------- */
        public static void Open(this MainFacade src, IEnumerable <string> files)
        {
            var path = src.GetFirst(files);

            if (path.HasValue())
            {
                src.Open(path);
            }
        }
Ejemplo n.º 2
0
        /* ----------------------------------------------------------------- */
        ///
        /// Setup
        ///
        /// <summary>
        /// Invokes some actions through the specified arguments.
        /// </summary>
        ///
        /// <param name="src">Facade object.</param>
        /// <param name="args">User arguments.</param>
        ///
        /* ----------------------------------------------------------------- */
        public static void Setup(this MainFacade src, IEnumerable <string> args)
        {
            foreach (var ps in src.Settings.GetSplashProcesses())
            {
                ps.Kill();
            }
            var path = src.GetFirst(args);

            if (path.HasValue())
            {
                src.Open(path);
            }
            src.Backup.Cleanup();
        }
Ejemplo n.º 3
0
 /* ----------------------------------------------------------------- */
 ///
 /// OpenLink
 ///
 /// <summary>
 /// Opens a PDF document with the specified link.
 /// </summary>
 ///
 /// <param name="src">Facade object.</param>
 /// <param name="link">Information for the link.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void OpenLink(this MainFacade src, Information link)
 {
     try { src.Open(Shortcut.Resolve(link?.FullName)?.Target); }
     catch (Exception err)
     {
         var cancel = err is OperationCanceledException ||
                      err is TwiceException;
         if (!cancel)
         {
             src.Bindable.IO.TryDelete(link?.FullName);
         }
         throw;
     }
 }