Ejemplo n.º 1
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            ScriptRunParams runParams = (ScriptRunParams)this.ScriptHelper.VARS[
                                                                    "SetAsXmlInputToXsltScript"];

            RunXslt(files[0].FullName, runParams.Files[0].FullName, folder.FullPath + "\\output.xml");
        }
 public override void Run(KExplorerNode folder, FileInfo[] files)
 {
     if (files != null && files.Length > 0)
     {
         Clipboard.SetDataObject(files[0].FullName);
     }
 }
Ejemplo n.º 3
0
        public override void Run(KExplorerNode folder, FileInfo[] files )
        {
            KExplorerNode parentNode = (KExplorerNode)folder.Parent;
            if ( parentNode == null )
            {
                MessageBox.Show( "Kexplorer won't delete at root, or root."
                    ,"Kexplorer Caution"
                    ,MessageBoxButtons.OK );
                return;
            }
            if ( files == null )
            {
                this.DeleteFolder( folder );

                this.ScriptHelper.RefreshFolder( parentNode, false );

            }
            else
            {
                // The user consciously selected files in the righthand side, and
                // selected delete.. Should we Confirm?????
                // Probably.

                this.DeleteFiles( files );
                this.ScriptHelper.RefreshFolder( folder, false );
            }
        }
Ejemplo n.º 4
0
        public override void Run(KExplorerNode folder)
        {
            KExplorerNode parentNode = (KExplorerNode)folder.Parent;
            if ( parentNode == null )
            {
                MessageBox.Show( "Can't backup drives", "Error: Backup Folder", MessageBoxButtons.OK );
                return;
            }

            string backupFolderName = QuickDialog.DoQuickDialog( "Backup Copy of Folder"
                                                            , "Enter name of new backup folder"
                                                        , folder.DirInfo.Name + ".bak");

            if ( backupFolderName !=  null )
            {
                if ( backupFolderName.Length == 0 )
                {
                    MessageBox.Show( "Name can't be empty.", "Error: Backup Folder", MessageBoxButtons.OK );

                }
                else
                {

                    DirectoryInfo backupFolder = parentNode.DirInfo.CreateSubdirectory( backupFolderName );

                    this.TransferFilesAndFolders( folder.DirInfo, backupFolder );

                    this.ScriptHelper.RefreshFolder( parentNode, true );

                }
            }
        }
Ejemplo n.º 5
0
        public override void Run(KExplorerNode folder)
        {
            KExplorerNode parentNode = (KExplorerNode)folder.Parent;

            if (parentNode == null)
            {
                MessageBox.Show("Can't backup drives", "Error: Backup Folder", MessageBoxButtons.OK);
                return;
            }

            string backupFolderName = QuickDialog.DoQuickDialog("Backup Copy of Folder"
                                                                , "Enter name of new backup folder"
                                                                , folder.DirInfo.Name + ".bak");

            if (backupFolderName != null)
            {
                if (backupFolderName.Length == 0)
                {
                    MessageBox.Show("Name can't be empty.", "Error: Backup Folder", MessageBoxButtons.OK);
                }
                else
                {
                    DirectoryInfo backupFolder = parentNode.DirInfo.CreateSubdirectory(backupFolderName);


                    this.TransferFilesAndFolders(folder.DirInfo, backupFolder);


                    this.ScriptHelper.RefreshFolder(parentNode, true);
                }
            }
        }
Ejemplo n.º 6
0
        public override void Run(KExplorerNode folder)
        {
            string newDir = QuickDialog.DoQuickDialog("Make Directory", "Sub-folder of: " + folder.DirInfo.Name
                                                      , "");

            if (newDir != null)
            {
                if (newDir.Length == 0)
                {
                    newDir = QuickDialog.DoQuickDialog("Make Directory"
                                                       , "Folder can't be empty. Use Cancel to abort"
                                                       , "");
                }
                if (newDir != null && newDir.Length > 0)
                {
                    // Go ahead and make the directory.

                    try
                    {
                        folder.DirInfo.CreateSubdirectory(newDir);
                    }
                    catch (Exception e)
                    {
                        System.Windows.Forms.MessageBox.Show("Exception: " + e.Message
                                                             , "Make Direory error"
                                                             , MessageBoxButtons.OK);
                    }

                    this.ScriptHelper.RefreshFolder(folder, true);
                }
            }
        }
Ejemplo n.º 7
0
        public override void Run(KExplorerNode folder)
        {
            StringCollection paths = new StringCollection();

            paths.Add( folder.DirInfo.FullName );
            Clipboard.SetFileDropList(paths);
        }
Ejemplo n.º 8
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            ScriptRunParams runParams = (ScriptRunParams)this.ScriptHelper.VARS[
                "BEYONDCOMPARELEFT"];


            if (runParams != null)
            {
                if (files != null && runParams.Files != null)
                {
                    this.ScriptHelper.RunProgram(
                        @"BC2.exe"
                        , "\"" + runParams.Files[0].FullName + "\"" +
                        " " + "\"" + files[0].FullName + "\""
                        , folder, false);
                }
                else
                {
                    this.ScriptHelper.RunProgram(
                        @"BC2.exe"
                        , "\"" + runParams.FolderNode.DirInfo.FullName + "\""
                        + " " + "\"" + folder.DirInfo.FullName + "\""
                        , folder, false);
                }
            }
        }
Ejemplo n.º 9
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            ScriptRunParams runParams = (ScriptRunParams)this.ScriptHelper.VARS[
                                                                    "BEYONDCOMPARELEFT"];

            if ( runParams != null )
            {
                if ( files != null && runParams.Files != null )
                {
                    this.ScriptHelper.RunProgram(
                        @"BC2.exe"
                        , "\"" +   runParams.Files[0].FullName + "\"" +
                        " " + "\"" +   files[0].FullName + "\""
                        , folder,false);
                }
                else
                {
                    this.ScriptHelper.RunProgram(
                        @"BC2.exe"
                        , "\"" + runParams.FolderNode.DirInfo.FullName + "\""
                         + " " + "\"" + folder.DirInfo.FullName + "\""
                        , folder,false);
                }
            }
        }
Ejemplo n.º 10
0
 public override void Run(KExplorerNode folder, FileInfo[] files)
 {
     if (files != null && files.Length > 0)
     {
         Clipboard.SetDataObject(files[0].Name);
     }
 }
Ejemplo n.º 11
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            KExplorerNode parentNode = (KExplorerNode)folder.Parent;

            if (parentNode == null)
            {
                MessageBox.Show("Kexplorer won't delete at root, or root."
                                , "Kexplorer Caution"
                                , MessageBoxButtons.OK);
                return;
            }
            if (files == null)
            {
                this.DeleteFolder(folder);

                this.ScriptHelper.RefreshFolder(parentNode, false);
            }
            else
            {
                // The user consciously selected files in the righthand side, and
                // selected delete.. Should we Confirm?????
                // Probably.

                this.DeleteFiles(files);
                this.ScriptHelper.RefreshFolder(folder, false);
            }
        }
Ejemplo n.º 12
0
        public override void Run(KExplorerNode folder)
        {
            string newDir = QuickDialog.DoQuickDialog( "Make Directory", "Sub-folder of: " + folder.DirInfo.Name
                                                            ,"");

            if ( newDir != null )
            {
                if ( newDir.Length == 0 )
                {
                    newDir = QuickDialog.DoQuickDialog( "Make Directory"
                                            ,"Folder can't be empty. Use Cancel to abort"
                                            ,"");
                }
                if ( newDir != null && newDir.Length > 0 )
                {
                    // Go ahead and make the directory.

                    try
                    {

                        folder.DirInfo.CreateSubdirectory( newDir );
                    }
                    catch (Exception e )
                    {
                        System.Windows.Forms.MessageBox.Show( "Exception: " + e.Message
                                                        , "Make Direory error"
                                                        , MessageBoxButtons.OK);
                    }

                    this.ScriptHelper.RefreshFolder( folder, true );
                }

            }
        }
Ejemplo n.º 13
0
        public override void Run(KExplorerNode folder)
        {
            StringCollection paths = new StringCollection();

            paths.Add(folder.DirInfo.FullName);
            Clipboard.SetFileDropList(paths);
        }
Ejemplo n.º 14
0
        public override void Run(KExplorerNode folder)
        {
            ScriptRunParams runParams = (ScriptRunParams)
                                        this.ScriptHelper.VARS["COPYFILES"];

            if (runParams != null && runParams.FtpNode != null)
            {
                this.DownloadFtpFiles(folder, runParams.FtpNode, runParams.FtpFiles);
            }
            else if (runParams != null)
            {
                KExplorerNode parentNode = (KExplorerNode)runParams.FolderNode.Parent;

                if (parentNode != null)
                {
                    if (runParams.Files == null && parentNode.DirInfo.FullName.Equals(folder.DirInfo.FullName))
                    {
                        MessageBox.Show(
                            "Can't paste over top.  Use 'Backup Copy Here' option."
                            , "Past Error"
                            , MessageBoxButtons.OK);
                        return;
                    }
                }
                this.CopyFiles(folder, runParams.FolderNode, runParams.Files);
            }
            else
            {
                runParams = (ScriptRunParams)this.ScriptHelper.VARS["CUTFILES"];
                if (runParams != null && runParams.FtpNode != null)
                {
                    MessageBox.Show("Cut not supported from FTP", "Kexplorer");
                    return;
                    // this.DownloadFtpFiles(folder, runParams.FtpNode, runParams.FtpFiles, true);
                }
                else if (runParams != null)
                {
                    KExplorerNode parentNode = (KExplorerNode)runParams.FolderNode.Parent;

                    if (parentNode != null)
                    {
                        if (runParams.Files == null && parentNode.DirInfo.FullName.Equals(folder.DirInfo.FullName))
                        {
                            MessageBox.Show(
                                "Can't paste over top.  Use 'Backup Copy Here' option."
                                , "Past Error"
                                , MessageBoxButtons.OK);
                            return;
                        }
                    }

                    this.MoveFiles(folder, runParams.FolderNode, runParams.Files);

                    this.Active = false;
                }
            }

            this.ScriptHelper.RefreshFolder(folder, false);
        }
Ejemplo n.º 15
0
        public override void Run(KExplorerNode folder)
        {
            BackgroundRun runner = new BackgroundRun(folder.DirInfo);

            runner.WasKilled = new KillCallback(this.Killed);

            this.runners.Add(runner);
        }
        public override void Run(KExplorerNode folder)
        {
            string temp = folder.DirInfo.FullName;

            string tssName = "\"" + @"\\tsclient\\" + temp.Replace(":","") + "\"";

            Clipboard.SetDataObject( tssName, true );
        }
Ejemplo n.º 17
0
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            string targetFile = folder.DirInfo.FullName
                                + "\\"
                                + file[0].Name + ".bak";

            file[0].CopyTo(targetFile, true);;
        }
Ejemplo n.º 18
0
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            string targetFile = folder.DirInfo.FullName
                + "\\"
                + file[0].Name + ".bak";

            file[0].CopyTo( targetFile, true  );;
        }
Ejemplo n.º 19
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            //<Launcher ext="jpg" command="rundll32.exe" preOption= C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen" />

            this.ScriptHelper.RunProgram( "rundll32.exe"
                //,"c:\\WINDOWS\\System32\\shimgvw.dll,ImageView_Fullscreen " + files[0].FullName
                , "shimgvw.dll,ImageView_Fullscreen " + files[0].FullName
                    , folder, false );
        }
Ejemplo n.º 20
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            foreach (FileInfo file in files)
            {
                file.Attributes = FileAttributes.Normal;
            }

            this.ScriptHelper.RefreshFolder(folder, false);
        }
Ejemplo n.º 21
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            ScriptRunParams runParams = (ScriptRunParams)this.ScriptHelper.VARS[
                "SetAsXmlInputToXsltScript"];



            RunXslt(files[0].FullName, runParams.Files[0].FullName, folder.FullPath + "\\output.xml");
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Set the copied file(s).  If there were CUT files, reset them.
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="files"></param>
 public override void Run(KExplorerNode folder, FileInfo[] files)
 {
     StringCollection paths = new StringCollection();
     foreach (var file in files)
     {
         paths.Add(file.FullName);
     }
     Clipboard.SetFileDropList(paths);
 }
Ejemplo n.º 23
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            foreach ( FileInfo file in files )
            {
                file.Attributes = FileAttributes.Normal;
            }

            this.ScriptHelper.RefreshFolder( folder, false );
        }
Ejemplo n.º 24
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            //<Launcher ext="jpg" command="rundll32.exe" preOption= C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen" />

            this.ScriptHelper.RunProgram("rundll32.exe"
                                         //,"c:\\WINDOWS\\System32\\shimgvw.dll,ImageView_Fullscreen " + files[0].FullName
                                         , "shimgvw.dll,ImageView_Fullscreen " + files[0].FullName
                                         , folder, false);
        }
Ejemplo n.º 25
0
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            //  C:\Program Files\7-Zip\7z.exe" preOption = "x"
            this.ScriptHelper.RunProgram(@"7zFM.exe"
                                         , " " + "\"" + file[0].FullName + "\" -o\"" + folder.DirInfo.FullName + "\""
                                         , folder, false);

            this.ScriptHelper.RefreshFolder(folder, false);
        }
 public override void Run(KExplorerNode folder, FileInfo[] file)
 {
     this.ScriptHelper.VARS["BEYONDCOMPARELEFT"] = new ScriptRunParams( folder, file );
     IScript beyondCompare = this.ScriptHelper.FindScript("Beyond Compare");
     if ( beyondCompare != null )
     {
         beyondCompare.Active = true;
     }
 }
 public override void Run(KExplorerNode folder, FileInfo[] file)
 {
     this.ScriptHelper.VARS["SetAsXmlInputToXsltScript"] = new ScriptRunParams( folder, file );
     IScript XSLTRun = this.ScriptHelper.FindScript(XSLTRunScript.XSLT_RUN_SCRIPT_NAME);
     if ( XSLTRun != null )
     {
         XSLTRun.Active = true;
     }
 }
Ejemplo n.º 28
0
        private void CopyFiles(KExplorerNode destNode
                               , KExplorerNode sourceNode
                               , FileInfo[] files)
        {
            bool askOnce = false;

            if (files != null)
            {
                foreach (FileInfo file in files)
                {
                    Console.WriteLine("Would be copying...");
                    Console.WriteLine(file.FullName);
                    string temp = "TO: " + destNode.DirInfo.FullName + "\\" + file.Name;
                    Console.WriteLine(temp);
                    if (File.Exists(destNode.DirInfo.FullName + "\\"
                                    + file.Name))
                    {
                        if (!askOnce)
                        {
                            DialogResult result = MessageBox.Show("File: " + file.Name + " already exists. Overwrite?"
                                                                  , "Overwrite File"
                                                                  , MessageBoxButtons.YesNoCancel
                                                                  , MessageBoxIcon.Exclamation
                                                                  , MessageBoxDefaultButton.Button3);

                            if (result == DialogResult.Cancel)
                            {
                                return;
                            }

                            if (result == DialogResult.Yes)
                            {
                                askOnce = true;
                            }

                            if (result == DialogResult.No)
                            {
                                continue;
                            }
                        }

                        File.Delete(destNode.DirInfo.FullName + "\\"
                                    + file.Name);
                    }


                    File.Copy(file.FullName
                              , destNode.DirInfo.FullName + "\\"
                              + file.Name);
                }
            }
            else
            {
                this.copyOverFolderDialogOnce = false;
                this.DuplicateFolder(sourceNode.DirInfo, destNode.DirInfo);
            }
        }
Ejemplo n.º 29
0
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            //  C:\Program Files\7-Zip\7z.exe" preOption = "x"
            this.ScriptHelper.RunProgram( @"7z.exe"
                , "x " + "\"" +file[0].FullName + "\" -o\"" + folder.DirInfo.FullName + "\""
                , folder,false );

            this.ScriptHelper.RefreshFolder( folder, false );
        }
Ejemplo n.º 30
0
 /// <summary>
 /// Set the copied file(s).  If there were CUT files, reset them.
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="files"></param>
 public override void Run(KExplorerNode folder, FileInfo[] files)
 {
     this.ScriptHelper.VARS["CUTFILES"] = new ScriptRunParams( folder, files );
     this.ScriptHelper.VARS["COPYFILES"] = null;
     IScript paste = this.ScriptHelper.FindScript(PasteScript.LONG_NAME);
     if ( paste != null )
     {
         paste.Active = true;
     }
 }
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            this.ScriptHelper.VARS["BEYONDCOMPARELEFT"] = new ScriptRunParams(folder, file);
            IScript beyondCompare = this.ScriptHelper.FindScript("Beyond Compare");

            if (beyondCompare != null)
            {
                beyondCompare.Active = true;
            }
        }
Ejemplo n.º 32
0
 public override void Run(KExplorerNode folder)
 {
     if ( folder.Parent == null )
     {
         MessageBox.Show("Unable to copy drives.", "Copy Error"
                         , MessageBoxButtons.OK );
         return;
     }
     this.Run( folder, null );
 }
Ejemplo n.º 33
0
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            this.ScriptHelper.VARS["SetAsXmlInputToXsltScript"] = new ScriptRunParams(folder, file);
            IScript XSLTRun = this.ScriptHelper.FindScript(XSLTRunScript.XSLT_RUN_SCRIPT_NAME);

            if (XSLTRun != null)
            {
                XSLTRun.Active = true;
            }
        }
Ejemplo n.º 34
0
 public override void Run(KExplorerNode folder)
 {
     if (folder.Parent == null)
     {
         MessageBox.Show("Unable to copy drives.", "Copy Error"
                         , MessageBoxButtons.OK);
         return;
     }
     this.Run(folder, null);
 }
Ejemplo n.º 35
0
        /// <summary>
        /// Set the copied file(s).  If there were CUT files, reset them.
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="files"></param>
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            StringCollection paths = new StringCollection();

            foreach (var file in files)
            {
                paths.Add(file.FullName);
            }
            Clipboard.SetFileDropList(paths);
        }
        public override void Run(KExplorerNode folder)
        {
            this.ScriptHelper.VARS["NEXTUNZIPLOCATION"] = folder;

            IScript unzipTo = this.ScriptHelper.FindScript(ZipUnzipToFileScript.ZIP_UNZIP_TO_LONG_NAME);
            if ( unzipTo != null )
            {
                unzipTo.Active = true;
            }
        }
Ejemplo n.º 37
0
        private void MoveFiles(KExplorerNode destNode
                               , KExplorerNode sourceNode
                               , FileInfo[] files)
        {
            bool askOnce = false;

            if (files != null)
            {
                foreach (FileInfo file in files)
                {
                    string targetFile = destNode.DirInfo.FullName + "\\"
                                        + file.Name;
                    if (File.Exists(targetFile))
                    {
                        if (!askOnce)
                        {
                            DialogResult result = MessageBox.Show("File: " + file.Name + " already exists. Overwrite?"
                                                                  , "Overwrite File"
                                                                  , MessageBoxButtons.YesNoCancel
                                                                  , MessageBoxIcon.Exclamation
                                                                  , MessageBoxDefaultButton.Button3);

                            if (result == DialogResult.Cancel)
                            {
                                return;
                            }

                            if (result == DialogResult.Yes)
                            {
                                askOnce = true;
                            }

                            if (result == DialogResult.No)
                            {
                                continue;
                            }
                        }
                        File.SetAttributes(targetFile, FileAttributes.Normal);
                        File.Delete(targetFile);
                    }
                    System.IO.File.Move(file.FullName
                                        , targetFile);
                }
            }
            else
            {
                KExplorerNode parent = (KExplorerNode)sourceNode.Parent;
                string        x      = destNode.FullPath + "\\" + sourceNode.DirInfo.Name;
                sourceNode.DirInfo.MoveTo(x);

                this.ScriptHelper.RefreshFolder(parent, true);
                this.ScriptHelper.RefreshFolder(destNode, true);
            }
        }
Ejemplo n.º 38
0
        /// <summary>
        /// Set the copied file(s).  If there were CUT files, reset them.
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="files"></param>
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            this.ScriptHelper.VARS["CUTFILES"]  = new ScriptRunParams(folder, files);
            this.ScriptHelper.VARS["COPYFILES"] = null;
            IScript paste = this.ScriptHelper.FindScript(PasteScript.LONG_NAME);

            if (paste != null)
            {
                paste.Active = true;
            }
        }
Ejemplo n.º 39
0
        public override void Run(KExplorerNode folder)
        {
            this.ScriptHelper.VARS["NEXTUNZIPLOCATION"] = folder;


            IScript unzipTo = this.ScriptHelper.FindScript(ZipUnzipToFileScript.ZIP_UNZIP_TO_LONG_NAME);

            if (unzipTo != null)
            {
                unzipTo.Active = true;
            }
        }
Ejemplo n.º 40
0
        public override void Run(KExplorerNode folder)
        {
            StreamWriter combine;
            FileInfo fInfo = new FileInfo( folder.DirInfo.FullName + "\\newfile.txt" );
            if (!fInfo.Exists )
            {
                combine=File.CreateText(folder.DirInfo.FullName + "\\newfile.txt" );
                combine.Close();
            }

            this.ScriptHelper.RunProgram("TextPad.exe","-q" + fInfo.FullName, folder,false );
        }
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            string temp = files[0].FullName;

            string tssName = "\""
                              + @"\\tsclient\\"
                            + temp.Replace(":","") + "\"";

            if ( files != null && files.Length > 0 )
            {
                Clipboard.SetDataObject(tssName );
            }
        }
Ejemplo n.º 42
0
        public override void Run(KExplorerNode folder)
        {
            StreamWriter combine;
            FileInfo     fInfo = new FileInfo(folder.DirInfo.FullName + "\\newfile.txt");

            if (!fInfo.Exists)
            {
                combine = File.CreateText(folder.DirInfo.FullName + "\\newfile.txt");
                combine.Close();
            }

            this.ScriptHelper.RunProgram("TextPad.exe", "-q" + fInfo.FullName, folder, false);
        }
Ejemplo n.º 43
0
        /// <summary>
        /// Just work for the first file.
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="files"></param>
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            if (files != null && files.Length > 0)
            {
                FileInfo file = files[0];
                string   info = "File:           " + file.Name + "\r"
                                + "Size:           " + file.Length + "\r"
                                + "Last updated:   " + file.LastWriteTime.ToString();


                MessageBox.Show(info, "File Info", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Set the copied file(s).  If there were CUT files, reset them.
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="files"></param>
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            if (files.Length > 0)
            {
                StreamReader reader = files[0].OpenText();

                string x = reader.ReadToEnd();


                reader.Close();

                Clipboard.SetText(x);
            }
        }
Ejemplo n.º 45
0
        /// <summary>
        /// Set the copied file(s).  If there were CUT files, reset them.
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="files"></param>
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            if (files.Length > 0)
            {

                StreamReader reader = files[0].OpenText();

                string x = reader.ReadToEnd();

                reader.Close();

                Clipboard.SetText(x);
            }
        }
Ejemplo n.º 46
0
        // Unzip to the specified folder....
        //

        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            KExplorerNode destNode = (KExplorerNode)this.ScriptHelper.VARS["NEXTUNZIPLOCATION"];

            if (destNode != null)
            {
                //  C:\Program Files\7-Zip\7z.exe" preOption = "x"
                this.ScriptHelper.RunProgram(@"C:\Program Files\7-Zip\7z.exe"
                                             , "x " + "\"" + file[0].FullName + "\" -o\"" + destNode.FullPath + "\""
                                             , destNode, false);

                this.ScriptHelper.RefreshFolder(folder, false);
            }
        }
Ejemplo n.º 47
0
        // Unzip to the specified folder....
        //
        public override void Run(KExplorerNode folder, FileInfo[] file)
        {
            KExplorerNode destNode = (KExplorerNode)this.ScriptHelper.VARS["NEXTUNZIPLOCATION"];

            if ( destNode != null )
            {

                //  C:\Program Files\7-Zip\7z.exe" preOption = "x"
                this.ScriptHelper.RunProgram( @"C:\Program Files\7-Zip\7z.exe"
                    , "x " + "\"" +file[0].FullName + "\" -o\"" + destNode.FullPath + "\""
                    , destNode,false );

                this.ScriptHelper.RefreshFolder( folder, false );
            }
        }
Ejemplo n.º 48
0
        public override void Run(KExplorerNode folder)
        {
            string newName = QuickDialog.DoQuickDialog("Rename Folder", "New Name", folder.DirInfo.Name);

            if (newName != null && newName.Length > 0)
            {
                if (!newName.Equals(folder.DirInfo.Name))
                {
                    string x = folder.DirInfo.Parent.FullName + "\\" + newName;
                    folder.DirInfo.MoveTo(x);


                    this.ScriptHelper.RefreshFolder(folder, true);
                }
            }
        }
Ejemplo n.º 49
0
        public override void Run(KExplorerNode folder)
        {
            KExplorerConsole console = new KExplorerConsole(KMultiForm.Instance());

            TabPage x = new TabPage("Konsole->" );

            console.Dock = System.Windows.Forms.DockStyle.Fill;

            x.Controls.Add( console );

            KMultiForm.Instance().MainTabControl.TabPages.Add( x );

            KMultiForm.Instance().MainTabControl.SelectedTab = x;

            console.Initialize(folder.FullPath);
        }
Ejemplo n.º 50
0
        public void RunProgram(string exe, string options, KExplorerNode atFolderNode, bool waitForExit, bool asAdmin)
        {
            string otherExe = exe.Substring(exe.LastIndexOf("\\") + 1);
            //First we'll see of the exe is in the scripthelperxml program locations.
            XmlNode node = this.scriptHelperDoc.SelectSingleNode("//ProgramAlias[@exe='" + otherExe.ToLower() + "']");
            string  foundexe;

            if (node != null)
            {
                foundexe = node.InnerText;
            }
            else
            {
                foundexe = exe;
            }

            Process cmd = new Process();

            cmd.StartInfo.FileName = foundexe;



            if (options != null)
            {
                cmd.StartInfo.Arguments = options;
                if (asAdmin && !IsAdministrator())
                {
                    cmd.StartInfo.Verb = "runas";
                }
            }

            KExplorerNode kNode = atFolderNode;

            if (kNode != null)
            {
                cmd.StartInfo.WorkingDirectory = kNode.DirInfo.FullName;
            }



            cmd.Start();

            if (waitForExit)
            {
                cmd.WaitForExit();
            }
        }
Ejemplo n.º 51
0
        public override void Run(KExplorerNode folder)
        {
            string newName = QuickDialog.DoQuickDialog( "Rename Folder", "New Name", folder.DirInfo.Name );

            if ( newName != null && newName.Length > 0 )
            {
                if (!newName.Equals(folder.DirInfo.Name ))
                {

                    string x = folder.DirInfo.Parent.FullName + "\\" + newName;
                    folder.DirInfo.MoveTo(x);

                    this.ScriptHelper.RefreshFolder( folder, true );

                }
            }
        }
Ejemplo n.º 52
0
        public override void Run(KExplorerNode folder)
        {
            string newZipName = QuickDialog.DoQuickDialog( "Create Zip"
                , "Zip Name"
                , "..\\"+folder.Text );

            if ( newZipName != null && newZipName.Length > 0 )
            {
                if ( !newZipName.ToLower().EndsWith(".zip"))
                {
                    newZipName = newZipName + ".zip";

                }

                this.ScriptHelper.RunProgram( @"7z.exe"
                    , "a -tzip " + "\"" +newZipName + "\" -r \"" + folder.DirInfo.FullName + "\""
                    , folder );
            }
        }
Ejemplo n.º 53
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            if (files == null || files.Length > 1)
            {
                return;
            }
            string newName = QuickDialog.DoQuickDialog("Rename Folder", "New Name", files[0].Name);

            if (newName != null && newName.Length > 0)
            {
                if (!newName.Equals(files[0].Name))
                {
                    string x = files[0].DirectoryName + "\\" + newName;
                    files[0].MoveTo(x);


                    this.ScriptHelper.RefreshFolder(folder, false);
                }
            }
        }
Ejemplo n.º 54
0
        public override void Run(KExplorerNode folder, FileInfo[] xfiles)
        {
            foreach (var xfile in xfiles)
            {
                ProcessStartInfo info = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    WorkingDirectory = folder.DirInfo.FullName,
                    FileName =xfile.FullName
                };

                if (!IsAdministrator())
                {
                    info.Verb = "runas";
                }

                var p = Process.Start(info);

            }
        }
Ejemplo n.º 55
0
        public override void Run(KExplorerNode folder)
        {
            string newZipName = QuickDialog.DoQuickDialog("Create Zip"
                                                          , "Zip Name"
                                                          , "..\\" + folder.Text);


            if (newZipName != null && newZipName.Length > 0)
            {
                if (!newZipName.ToLower().EndsWith(".zip"))
                {
                    newZipName = newZipName + ".zip";
                }


                this.ScriptHelper.RunProgram(@"7z.exe"
                                             , "a -tzip " + "\"" + newZipName + "\" -r \"" + folder.DirInfo.FullName + "\""
                                             , folder);
            }
        }
Ejemplo n.º 56
0
        public override void Run(KExplorerNode folder, FileInfo[] xfiles)
        {
            foreach (var xfile in xfiles)
            {
                ProcessStartInfo info = new ProcessStartInfo
                {
                    UseShellExecute  = true,
                    WorkingDirectory = folder.DirInfo.FullName,
                    FileName         = xfile.FullName
                };

                if (!IsAdministrator())
                {
                    info.Verb = "runas";
                }


                var p = Process.Start(info);
            }
        }
Ejemplo n.º 57
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            bool error = false;
            foreach ( FileInfo fInfo in files )
            {

                if ( fInfo.Extension.ToLower().Equals( "xslt" ) )
                {
                    System.Xml.Xsl.XslTransform transform = new XslTransform();

                    try
                    {
                        transform.Load( fInfo.FullName );
                    }
                    catch ( Exception e )
                    {
                        MessageBox.Show( "Error: " + e.Message, "Xslt Error File: " + fInfo.Name );
                        error = true;
                    }

                }
                else
                {
                    try
                    {
                        XmlDocument doc = new XmlDocument();
                        doc.Load( fInfo.FullName );
                    }
                    catch (Exception e )
                    {
                        MessageBox.Show( "Error: " + e.Message, "Xml Error File: " + fInfo.Name, MessageBoxButtons.OK, MessageBoxIcon.Error );
                        error = true;
                    }
                }
            }

            if ( !error )
            {
                MessageBox.Show( "All good!", "XML/XSL Checker", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 58
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            if ( files == null || files.Length > 1 )
            {
                return;
            }
            string newName = QuickDialog.DoQuickDialog( "Rename Folder", "New Name", files[0].Name );

            if ( newName != null && newName.Length > 0 )
            {
                if (!newName.Equals(files[0].Name ))
                {

                    string x = files[0].DirectoryName + "\\" + newName;
                    files[0].MoveTo(x);

                    this.ScriptHelper.RefreshFolder( folder, false );

                }
            }
        }
Ejemplo n.º 59
0
        public override void Run(KExplorerNode folder, FileInfo[] files)
        {
            string newZipName = QuickDialog.DoQuickDialog( "Create Zip"
                , "Zip Name"
                , "..\\"+folder.Text );

            if ( newZipName != null && newZipName.Length > 0 )
            {
                if ( !newZipName.ToLower().EndsWith(".zip"))
                {
                    newZipName = newZipName + ".zip";

                }

                string listfile = Application.StartupPath + "\\zipfilelist.lst";

                this.BuildListFile( listfile , files );

                this.ScriptHelper.RunProgram( @"7z.exe"
                    , "a -tzip " + "\"" +newZipName + "\" @\"" + listfile + "\""
                    , folder );
            }
        }
Ejemplo n.º 60
0
 public override void Run(KExplorerNode folder)
 {
     this.Run( folder, null );
 }