/// <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; }
//-----------------------------------------------------------------------------// /// <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; }
/// <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)); } }
/// <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; }
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; }
public ServiceMgrWorkUnit( ISimpleKexplorerGUI newMainForm, IServiceGUI newServiceGUI) { this.mainform = newMainForm; this.serviceGUI = newServiceGUI; }
//-----------------------------------------------------------------------------// /// <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; }
public FolderFinderWorkUnit(string newPathToLookFor, KExplorerNode[] newStartNodes, ISimpleKexplorerGUI newForm, IKExplorerControl newFlagger) { this.pathToLookFor = newPathToLookFor; this.startNodes = newStartNodes; this.form = newForm; this.controller = newFlagger; }
public FolderFinderWorkUnit( string newPathToLookFor,KExplorerNode[] newStartNodes, ISimpleKexplorerGUI newForm, IKExplorerControl newFlagger ) { this.pathToLookFor = newPathToLookFor; this.startNodes = newStartNodes; this.form = newForm; this.controller = newFlagger; }
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); } }
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(); } }
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(); } }
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 ); } }
/// <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"); }
public ServiceMgrWorkUnit(ISimpleKexplorerGUI newMainForm, IServiceGUI newServiceGUI) { this.mainform = newMainForm; this.serviceGUI = newServiceGUI; }
public void Initialize(ISimpleKexplorerGUI newForm) { this.Initialize(newForm, null, null); }
//-----------------------------------------------------------------------------// /// <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 )); } }
//------------------------------------------------------------------- /// <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; }
/// <summary> /// Simple Constructor /// </summary> public Pipeline( ISimpleKexplorerGUI newForm) { this.form = newForm; }
/// <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)); } }
/// <summary> /// Simple Constructor /// </summary> public Pipeline(ISimpleKexplorerGUI newForm) { this.form = newForm; }
//------------------------------------------------------------------- /// <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; }
//-----------------------------------------------------------------------------// /// <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 )); } }
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(); }
public void Initialize(ISimpleKexplorerGUI newForm) { this.Initialize( newForm, null, null ); }