示例#1
0
 /// <summary>
 /// Construct with the drive letter and a pointer to the main form
 /// </summary>
 /// <param name="newDriveLetter"></param>
 /// <param name="form1"></param>
 public FtpLoaderWorkUnit( KexplorerFtpNode newCreatedDriveNode, FtpSite site, ISimpleKexplorerGUI form1, IWorkGUIFlagger flagger )
 {
     this.createdNode = newCreatedDriveNode;
     this.site = site;
     this.form = form1;
     this.guiFlagger = flagger;
 }
示例#2
0
 //-----------------------------------------------------------------------------//
 /// <summary>
 /// Constructor with a node that is a folder.
 /// </summary>
 /// <param name="newFolderNode"></param>
 /// <param name="newForm"></param>
 public FtpFolderWorkUnit(KexplorerFtpNode newFolderNode, ISimpleKexplorerGUI newForm, IWorkGUIFlagger flagger)
 {
     this.folderNode = newFolderNode;
     this.site       = newFolderNode.Site;
     this.form       = newForm;
     this.guiFlagger = flagger;
 }
示例#3
0
        /// <summary>
        /// Read the tree state of the GUI to figure out what is loaded, where it pointed, whats
        /// the name of the tab.
        /// </summary>
        /// <param name="kexplorerTab"></param>
        private void Initialize(ISimpleKexplorerGUI kexplorerTab)
        {
            if (kexplorerTab.TreeView1.Nodes[0] is KexplorerFtpNode)
            {
                var site = (KexplorerFtpNode)kexplorerTab.TreeView1.Nodes[0];
                this.ftpSite = site.Site;
            }
            else
            {
                KExplorerNode selectedNode = (KExplorerNode)kexplorerTab.TreeView1.SelectedNode;

                if (selectedNode != null)
                {
                    this.currentFolder = selectedNode.DirInfo.FullName;
                }
                else
                {
                    this.currentFolder = "";
                }

                ArrayList tdrives = new ArrayList();

                foreach (KExplorerNode node in kexplorerTab.TreeView1.Nodes)
                {
                    tdrives.Add(node.Text);
                }

                this.drives = (string[])tdrives.ToArray(typeof(string));
            }
        }
示例#4
0
 /// <summary>
 /// Construct with the drive letter and a pointer to the main form
 /// </summary>
 /// <param name="newDriveLetter"></param>
 /// <param name="form1"></param>
 public FtpLoaderWorkUnit(KexplorerFtpNode newCreatedDriveNode, FtpSite site, ISimpleKexplorerGUI form1, IWorkGUIFlagger flagger)
 {
     this.createdNode = newCreatedDriveNode;
     this.site        = site;
     this.form        = form1;
     this.guiFlagger  = flagger;
 }
示例#5
0
        public void Initialize(ISimpleKexplorerGUI newForm, FtpSite ftpSite)
        {
            this.isFtpSite = true;
            this.form      = newForm;

            this.pipeline = new Pipeline(this.form);
            this.pipeline.StartWork();

            this.drivePipelines = new Hashtable();

            Pipeline drivePipeline = new Pipeline(this.form);

            this.drivePipelines[ftpSite.host] = drivePipeline;
            drivePipeline.StartWork();

            KexplorerFtpNode createdNode = new KexplorerFtpNode(ftpSite);

            this.form.TreeView1.Nodes.Add(createdNode);

            drivePipeline.AddJob(new FtpLoaderWorkUnit(createdNode, ftpSite, this.form, this));

            this.form.TreeView1.ContextMenu.Popup += new EventHandler(this.ContextMenu_Popup);

            this.form.TreeView1.AfterExpand += new TreeViewEventHandler(TreeView1_AfterExpand);


            this.form.TreeView1.KeyDown += new KeyEventHandler(TreeView1_KeyDown);


            this.form.TreeView1.AfterSelect += new TreeViewEventHandler(TreeView1_AfterFtpSelect);


            this.InitializeScriptManager();
        }
 /// <summary>
 /// Construct with the drive letter and a pointer to the main form
 /// </summary>
 /// <param name="newDriveLetter"></param>
 /// <param name="form1"></param>
 public DriveLoaderWorkUnit( KExplorerNode newCreatedDriveNode, string newDriveLetter, ISimpleKexplorerGUI form1, IWorkGUIFlagger flagger )
 {
     this.createdNode = newCreatedDriveNode;
     this.driveLetter = newDriveLetter;
     this.form = form1;
     this.guiFlagger = flagger;
 }
示例#7
0
		public ServiceMgrWorkUnit( ISimpleKexplorerGUI newMainForm, IServiceGUI newServiceGUI)
		{
			
			this.mainform = newMainForm;
			this.serviceGUI = newServiceGUI;

		}
示例#8
0
 //-----------------------------------------------------------------------------//
 /// <summary>
 /// Constructor with a node that is a folder.
 /// </summary>
 /// <param name="newFolderNode"></param>
 /// <param name="newForm"></param>
 public FtpFolderWorkUnit( KexplorerFtpNode newFolderNode, ISimpleKexplorerGUI newForm, IWorkGUIFlagger flagger )
 {
     this.folderNode = newFolderNode;
     this.site = newFolderNode.Site;
     this.form = newForm;
     this.guiFlagger = flagger;
 }
示例#9
0
        public FolderFinderWorkUnit(string newPathToLookFor, KExplorerNode[] newStartNodes, ISimpleKexplorerGUI newForm, IKExplorerControl newFlagger)
        {
            this.pathToLookFor = newPathToLookFor;

            this.startNodes = newStartNodes;

            this.form = newForm;

            this.controller = newFlagger;
        }
示例#10
0
        public FolderFinderWorkUnit( string newPathToLookFor,KExplorerNode[] newStartNodes, ISimpleKexplorerGUI newForm, IKExplorerControl newFlagger  )
        {
            this.pathToLookFor = newPathToLookFor;

            this.startNodes = newStartNodes;

            this.form = newForm;

            this.controller = newFlagger;
        }
示例#11
0
        public TreeViewPersistState(ISimpleKexplorerGUI kexplorerPanel, string newTabName, bool newIsSelected)
        {
            this.tabName = newTabName;

            this.isSelected = newIsSelected;

            if (kexplorerPanel is KexplorerPanel)
            {
                this.Initialize(kexplorerPanel);
            }
            else if (kexplorerPanel is ServicesPanel)
            {
                this.InitializeServicePanel((ServicesPanel)kexplorerPanel);
            }
        }
示例#12
0
        public ScriptHelper(IScriptMgr mgr
                            , IKExplorerControl controller
                            , ISimpleKexplorerGUI newMainGUI
                            , IWorkGUIFlagger newMainGUIFlagger)
        {
            this.scriptMgr      = mgr;
            this.mainController = controller;
            this.mainGUI        = newMainGUI;
            this.mainGUIFlagger = newMainGUIFlagger;


            if (scriptHelperDoc == null)
            {
                this.InitScriptHelperDoc();
            }
        }
示例#13
0
        public ScriptHelper( IScriptMgr mgr
			, IKExplorerControl  controller 
			, ISimpleKexplorerGUI newMainGUI
			, IWorkGUIFlagger newMainGUIFlagger )
        {
            this.scriptMgr = mgr;
            this.mainController = controller;
            this.mainGUI = newMainGUI;
            this.mainGUIFlagger = newMainGUIFlagger;

            if ( scriptHelperDoc == null )
            {
                this.InitScriptHelperDoc();

            }
        }
示例#14
0
        public TreeViewPersistState( ISimpleKexplorerGUI kexplorerPanel, string newTabName, bool newIsSelected )
        {
            this.tabName = newTabName;

            this.isSelected = newIsSelected;

            if ( kexplorerPanel is KexplorerPanel )
            {
                this.Initialize( kexplorerPanel );
            }
            else if ( kexplorerPanel is ServicesPanel )
            {

                this.InitializeServicePanel( (ServicesPanel)kexplorerPanel );
            }
        }
示例#15
0
        /// <summary>
        /// Write the current view DefaultView.xml
        /// </summary>
        private void SaveView()
        {
            ArrayList tabPersists = new ArrayList();

            foreach (TabPage page in this.tabControl1.TabPages)
            {
                ISimpleKexplorerGUI panel = null;
                foreach (Control control in page.Controls)
                {
                    if (control is KexplorerPanel || control is ServicesPanel)
                    {
                        panel = (ISimpleKexplorerGUI)control;
                        break;
                    }
                }
                if (panel != null)
                {
                    bool isSelected = this.tabControl1.SelectedTab == page;
                    tabPersists.Add(new TreeViewPersistState(panel, page.Text, isSelected));
                }
            }

            XmlDocument stateDoc = new XmlDocument();

            StringBuilder output = new StringBuilder();

            output.Append("<KexplorerState>\n");

            foreach (TreeViewPersistState tabState  in tabPersists)
            {
                tabState.WriteXmlOutput(output);
            }

            output.Append("</KexplorerState>\n");

            stateDoc.LoadXml(output.ToString());

            stateDoc.Save(Application.StartupPath + "\\KexplorerStateSave.xml");
        }
示例#16
0
 public ServiceMgrWorkUnit(ISimpleKexplorerGUI newMainForm, IServiceGUI newServiceGUI)
 {
     this.mainform   = newMainForm;
     this.serviceGUI = newServiceGUI;
 }
示例#17
0
 public void Initialize(ISimpleKexplorerGUI newForm)
 {
     this.Initialize(newForm, null, null);
 }
示例#18
0
        //-----------------------------------------------------------------------------//
        /// <summary>
        /// Initialize with a Form1
        /// </summary>
        /// <param name="newForm"></param>
        public void Initialize(ISimpleKexplorerGUI newForm, string currentFolderName, ArrayList onlyTheseDrives)
        {
            this.form = newForm;

            this.pipeline = new Pipeline(this.form);
            this.pipeline.StartWork();

            this.drivePipelines = new Hashtable();

            newForm.WatchingForFolder = currentFolderName;


            string[] drives = null;

            if (onlyTheseDrives != null && onlyTheseDrives.Count > 0)
            {
                drives = (string[])onlyTheseDrives.ToArray(typeof(string));
            }
            else
            {
                drives = System.IO.Directory.GetLogicalDrives();
            }

            foreach (string drive in drives)
            {
                //this.pipeline.AddJob(
                //	new DriveLoaderWorkUnit( drive.Substring( 0, 1), this.form, this ) );

                Pipeline drivePipeline = new Pipeline(this.form);
                this.drivePipelines[drive.Substring(0, 1)] = drivePipeline;
                drivePipeline.StartWork();

                KExplorerNode createdNode = new KExplorerNode(drive.Substring(0, 1));
                this.form.TreeView1.Nodes.Add(createdNode);

                drivePipeline.AddJob(new DriveLoaderWorkUnit(createdNode, drive.Substring(0, 1), this.form, this));
            }

            this.launcher = new Launcher();

            this.launcher.Initialize();


            this.form.TreeView1.AfterExpand += new TreeViewEventHandler(TreeView1_AfterExpand);


            this.form.TreeView1.KeyDown += new KeyEventHandler(TreeView1_KeyDown);


            this.form.TreeView1.AfterSelect += new TreeViewEventHandler(TreeView1_AfterSelect);


            this.form.DataGridView1.KeyDown += new KeyEventHandler(DataGrid1_KeyDown);

            this.form.TreeView1.DoubleClick += new EventHandler(TreeView1_DoubleClick);

            this.form.DataGridView1.DoubleClick += new EventHandler(DataGrid1_DoubleClick);



            this.form.TreeView1.MouseDown += new MouseEventHandler(TreeView1_MouseDown);


            this.InitializeScriptManager();



            this.form.TreeView1.ContextMenu.Popup += new EventHandler(ContextMenu_Popup);

            this.form.DataGridView1.ContextMenuStrip          = this.form.FileGridMenuStrip;
            this.form.DataGridView1.ContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening);


            if (currentFolderName != null && currentFolderName.Length > 0)
            {
                KExplorerNode driveNode = null;
                foreach (KExplorerNode node in this.form.TreeView1.Nodes)
                {
                    if (currentFolderName.StartsWith(node.Text))
                    {
                        driveNode = node;
                        break;
                    }
                }
                Pipeline drivePipeline = (Pipeline)this.drivePipelines[currentFolderName.Substring(0, 1)];

                drivePipeline.AddJob(new FolderFinderWorkUnit(
                                         currentFolderName, new KExplorerNode[] { driveNode }
                                         , this.form
                                         , this
                                         ));
            }
        }
示例#19
0
 //-------------------------------------------------------------------
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="newForm"></param>
 /// <param name="flagger"></param>
 public FtpFileListWorkUnit(KexplorerFtpNode node, ISimpleKexplorerGUI newForm, IWorkGUIFlagger flagger)
 {
     this.kForm      = newForm;
     this.kNode      = node;
     this.guiFlagger = flagger;
 }
示例#20
0
 /// <summary>
 ///  Simple Constructor
 /// </summary>
 public Pipeline( ISimpleKexplorerGUI newForm)
 {
     this.form = newForm;
 }
示例#21
0
        /// <summary>
        /// Read the tree state of the GUI to figure out what is loaded, where it pointed, whats
        /// the name of the tab.
        /// </summary>
        /// <param name="kexplorerTab"></param>
        private void Initialize(  ISimpleKexplorerGUI kexplorerTab )
        {
            if (kexplorerTab.TreeView1.Nodes[0] is KexplorerFtpNode)
            {
                var site =  (KexplorerFtpNode)kexplorerTab.TreeView1.Nodes[0];
                this.ftpSite = site.Site;

            }
            else
            {
                KExplorerNode selectedNode = (KExplorerNode)kexplorerTab.TreeView1.SelectedNode;

                if (selectedNode != null)
                {
                    this.currentFolder = selectedNode.DirInfo.FullName;
                }
                else
                {
                    this.currentFolder = "";
                }

                ArrayList tdrives = new ArrayList();

                foreach (KExplorerNode node in kexplorerTab.TreeView1.Nodes)
                {

                    tdrives.Add(node.Text);

                }

                this.drives = (string[])tdrives.ToArray(typeof(string));
            }
        }
示例#22
0
 /// <summary>
 ///  Simple Constructor
 /// </summary>
 public Pipeline(ISimpleKexplorerGUI newForm)
 {
     this.form = newForm;
 }
示例#23
0
 //-------------------------------------------------------------------
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="newForm"></param>
 /// <param name="flagger"></param>
 public FileListWorkUnit(KExplorerNode node,  ISimpleKexplorerGUI newForm, IWorkGUIFlagger flagger )
 {
     this.kForm = newForm;
     this.kNode = node;
     this.guiFlagger = flagger;
 }
示例#24
0
        //-----------------------------------------------------------------------------//
        /// <summary>
        /// Initialize with a Form1
        /// </summary>
        /// <param name="newForm"></param>
        public void Initialize(ISimpleKexplorerGUI newForm, string currentFolderName, ArrayList onlyTheseDrives )
        {
            this.form = newForm;

            this.pipeline = new Pipeline( this.form);
            this.pipeline.StartWork();

            this.drivePipelines = new Hashtable();

            newForm.WatchingForFolder = currentFolderName;

            string[] drives = null;

            if ( onlyTheseDrives != null && onlyTheseDrives.Count > 0 )
            {
                drives = (string[])onlyTheseDrives.ToArray(typeof(string));
            }
            else
            {
                drives = System.IO.Directory.GetLogicalDrives();
            }

            foreach( string drive in drives )
            {
                //this.pipeline.AddJob(
                //	new DriveLoaderWorkUnit( drive.Substring( 0, 1), this.form, this ) );

                Pipeline drivePipeline = new Pipeline( this.form );
                this.drivePipelines[ drive.Substring(0,1) ] = drivePipeline;
                drivePipeline.StartWork();

                KExplorerNode createdNode = new KExplorerNode( drive.Substring( 0, 1) );
                this.form.TreeView1.Nodes.Add( createdNode );

                drivePipeline.AddJob(new DriveLoaderWorkUnit( createdNode, drive.Substring( 0, 1), this.form, this ) );

            }

            this.launcher = new Launcher();

            this.launcher.Initialize();

            this.form.TreeView1.AfterExpand += new TreeViewEventHandler(TreeView1_AfterExpand);

            this.form.TreeView1.KeyDown += new KeyEventHandler(TreeView1_KeyDown);

            this.form.TreeView1.AfterSelect += new TreeViewEventHandler(TreeView1_AfterSelect);

            this.form.DataGridView1.KeyDown += new KeyEventHandler(DataGrid1_KeyDown);

            this.form.TreeView1.DoubleClick += new EventHandler(TreeView1_DoubleClick);

            this.form.DataGridView1.DoubleClick += new EventHandler(DataGrid1_DoubleClick);

            this.form.TreeView1.MouseDown += new MouseEventHandler(TreeView1_MouseDown);

            this.InitializeScriptManager();

            this.form.TreeView1.ContextMenu.Popup +=new EventHandler(ContextMenu_Popup );

            this.form.DataGridView1.ContextMenuStrip = this.form.FileGridMenuStrip;
            this.form.DataGridView1.ContextMenuStrip.Opening +=new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening);

            if ( currentFolderName != null && currentFolderName.Length > 0 )
            {
                KExplorerNode driveNode = null;
                foreach ( KExplorerNode node in this.form.TreeView1.Nodes )
                {
                    if ( currentFolderName.StartsWith( node.Text ))
                    {
                        driveNode = node;
                        break;
                    }
                }
                Pipeline drivePipeline = (Pipeline)this.drivePipelines[currentFolderName.Substring(0,1)];

                drivePipeline.AddJob( new FolderFinderWorkUnit(
                    currentFolderName, new KExplorerNode[]{driveNode}
                                        , this.form
                                        , this
                                                    ));

            }
        }
示例#25
0
        public void Initialize(ISimpleKexplorerGUI newForm, FtpSite ftpSite)
        {
            this.isFtpSite = true;
            this.form = newForm;

            this.pipeline = new Pipeline(this.form);
            this.pipeline.StartWork();

               this.drivePipelines = new Hashtable();

            Pipeline drivePipeline = new Pipeline(this.form);
            this.drivePipelines[ftpSite.host] = drivePipeline;
            drivePipeline.StartWork();

            KexplorerFtpNode createdNode = new KexplorerFtpNode(ftpSite);
            this.form.TreeView1.Nodes.Add(createdNode);

            drivePipeline.AddJob(new FtpLoaderWorkUnit(createdNode, ftpSite, this.form, this));

            this.form.TreeView1.ContextMenu.Popup += new EventHandler(this.ContextMenu_Popup);

            this.form.TreeView1.AfterExpand += new TreeViewEventHandler(TreeView1_AfterExpand);

            this.form.TreeView1.KeyDown += new KeyEventHandler(TreeView1_KeyDown);

            this.form.TreeView1.AfterSelect += new TreeViewEventHandler(TreeView1_AfterFtpSelect);

            this.InitializeScriptManager();
        }
示例#26
0
 public void Initialize(ISimpleKexplorerGUI newForm)
 {
     this.Initialize( newForm, null, null );
 }