当前位置: 首页>>代码示例>>C#>>正文


C# Control.clear方法代码示例

本文整理汇总了C#中System.Windows.Forms.Control.clear方法的典型用法代码示例。如果您正苦于以下问题:C# Control.clear方法的具体用法?C# Control.clear怎么用?C# Control.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Control的用法示例。


在下文中一共展示了Control.clear方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: setup_VsConnect

		public static API_CatNet_GUI setup_VsConnect(this API_CatNet_GUI catNetGui, Control topPanel)
		{
			catNetGui.HostControl 	= topPanel;
			catNetGui.vsConnect	 	= new VsConnect();		
			catNetGui.summaryView 	= topPanel.clear().add_Control<SummaryView>();
			catNetGui.lvSummary 	= (ListView)	catNetGui.summaryView.field("_lvSummary");
			catNetGui.detailView 	= (DetailView)	catNetGui.summaryView.field("_detailView");
			catNetGui.lvDataFlow 	= (ListView)	catNetGui.detailView.field("_lvDataFlow"); 
			catNetGui._tsActions 	= (ToolStrip)	catNetGui.summaryView.field("_tsActions");		
			
			catNetGui.CodeViewer 	= catNetGui.detailView.insert_Below().add_SourceCodeEditor();  
			return catNetGui;
		}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:13,代码来源:API_CatNet_GUI.cs

示例2: show_ImagesList_In_TreeView

		public static List<Image> show_ImagesList_In_TreeView(this API_AmazonEC2 amazonEC2, AmazonEC2Client ec2Client, Control control)
		{				
			var treeView = control.clear().add_TreeView_with_PropertyGrid(false).sort();  	 
			treeView.parent().backColor(System.Drawing.Color.Azure);
			treeView.visible(false);
			Application.DoEvents();
			var imagesList = amazonEC2.getImagesList(ec2Client); 
			
			Func<Amazon.EC2.Model.Image,string> imageName = 
				(image)=> (image.Description.valid())
									? "{0} - {1}".format(image.Description, image.Name)
									: "{0}".format(image.Name).trim();
									
			Action<string> mapByProperty  = 
				(propertyName)=>{				
									var byPropertyNode = treeView.add_Node("by {0}".format(propertyName),"");
									foreach(var distinctPropertyValue in imagesList.Select((image)=>image.property(propertyName).str()).Distinct())
									{										
										var byDistinctPropertyValue = byPropertyNode.add_Node(distinctPropertyValue,"");

										var mappedByImageName = new Dictionary<string, List<Image>>();
										foreach(var imageInProperty in imagesList.Where((image) => image.property(propertyName).str() == distinctPropertyValue))
											mappedByImageName.add(imageName(imageInProperty),imageInProperty);																				
											
										foreach(var mappedData in mappedByImageName)
										{
											if (mappedData.Value.size() > 1)
												byDistinctPropertyValue.add_Node("{0}".format(mappedData.Key,mappedData.Value.size()))
														      		   .add_Nodes(mappedData.Value, imageName);
											else
												byDistinctPropertyValue.add_Node(imageName(mappedData.Value.first()),mappedData.Value.first());
										}			     
									}													  			
								};
			mapByProperty("Visibility");
			mapByProperty("ImageOwnerAlias");
			mapByProperty("Platform"); 
			mapByProperty("Architecture"); 
			"Completed processing show_ImagesList_In_TreeView".info();
			if (treeView.nodes().size()>0)
				treeView.backColor(System.Drawing.Color.White); 
			treeView.visible(true);				
			return imagesList;
		}
开发者ID:paul-green,项目名称:O2.Platform.Scripts,代码行数:44,代码来源:API_AmazonEC2.cs

示例3: show_In_TreeView

    	public static API_Veracode_DetailedXmlFindings show_In_TreeView(this API_Veracode_DetailedXmlFindings apiVeracode, Control control)
    	{
    		var treeView = control.clear().add_TreeView();
    		Action<TreeNode,string> removeSchemaReference = 
				(treeNode, textToRemove) => {
												treeNode.set_Text(treeNode.get_Text().remove(textToRemove));					
											};
			treeView.afterSelect(
				(treeNode)=>{
								removeSchemaReference(treeNode,"{" + apiVeracode.schemaName + "}"); 
							});
			
			Action<string> loadFile = 
				(file) =>{
								apiVeracode.load(file);
								treeView.rootNode().showXml(apiVeracode.ReportXmlFile); 			
							};
			treeView.onDrop(
				(fileOrFolder)=>{
									treeView.azure();
									O2Thread.mtaThread(
										()=>{									
												if (fileOrFolder.dirExists())						
													foreach(var file in fileOrFolder.files(true,"*.xml", "*.zip"))
														try
														{
															loadFile(file);
														}
														catch(Exception ex)
														{
															"error loading file: {0} : {1}".error(file.fileName(), ex.Message);
														}
												else
													loadFile(fileOrFolder);
												treeView.white();
											});
						});
						
			if (apiVeracode.ReportXmlFile.valid())
				treeView.rootNode().showXml(apiVeracode.ReportXmlFile); 
			else
				treeView.rootNode().add_Node("drop a Veracode DetailedFindings Xml (or zip) file to view it"); 
			
			treeView.selectFirst().expand();			
			return apiVeracode;
    	}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:46,代码来源:API_Veracode_DetailedXmlFindings.cs

示例4: show_Flaws_In_SourceCodeViewer

    	public static API_Veracode_DetailedXmlFindings show_Flaws_In_SourceCodeViewer(this API_Veracode_DetailedXmlFindings apiVeracode, Control control)
    	{
    		var topPanel = control.clear();
    		var codeViewer = topPanel.add_GroupBox("Flaw SourceCode reference").add_SourceCodeViewer();
			var treeView = codeViewer.parent().insert_Left("Flaws").add_TreeView(); 
			var propertyGrid = treeView.insert_Below(150,"Flaw properties")
									   .add_PropertyGrid().helpVisible(false);
			var description = codeViewer.insert_Below(150,"Flaw description")
									    .add_TextArea();
									    
			treeView.afterSelect<FlawType>(
				(flaw)=>{				
							propertyGrid.show(flaw);				
							if (apiVeracode.hasLocalSourceCodeFile(flaw))
							{
								codeViewer.open(apiVeracode.sourceCodeFile(flaw));
								codeViewer.editor().gotoLine((int)flaw.line); 
							}
							else
								codeViewer.set_Text(".. no source code available...");
							description.set_Text(flaw.description.fix_CRLF());
							treeView.focus();
						});
			 												
			treeView.beforeExpand<List<FlawType>>(
				(flaws)=>{
							var selectedNode = treeView.selected();
							if (selectedNode.nodes().size()== 1)
							{
								selectedNode.clear();
								selectedNode.add_Nodes(flaws, 
													   (flaw)=> flaw.type, 
													   (flaw) => apiVeracode.hasLocalSourceCodeFile(flaw)
																		? Color.DarkGreen
																		: Color.DarkRed
													   );
							}
						 });
										
			Action<TreeNode, Dictionary<string, List<FlawType>>> addFlawsToTreeNode =
				(treeNode, mappedFlaws) 
				   =>{
						foreach(var item in mappedFlaws)			
							treeNode.add_Node(item.Key,item.Value,item.Value.size()>0);
									/*.*/
					  };
					  
			Action showData = 		  
				()=>{
						treeView.clear();
						var o2Timer = new O2Timer("Building XRefs for flaws").start();
						var mappedFlawsByType = new Dictionary<string, List<FlawType>>();
						var mappedFlawsByCategoryName = new Dictionary<string, List<FlawType>>();
						var mappedFlawsByFile = new Dictionary<string, List<FlawType>>();
						var mappedFlawsBySeverity = new Dictionary<string, List<FlawType>>();
						
						foreach(var flaw in apiVeracode.flaws()) 
						{
							mappedFlawsByCategoryName.add(flaw.categoryname, flaw);
							mappedFlawsByType.add(flaw.type, flaw);
							mappedFlawsByFile.add(flaw.sourceCodeFile(), flaw);
							mappedFlawsBySeverity.add(flaw.severity.str(), flaw);	
						}
						o2Timer.stop();
						o2Timer = new O2Timer("Populating treeview").start();			
						addFlawsToTreeNode(treeView.add_Node("by Category Name"), mappedFlawsByCategoryName);
						addFlawsToTreeNode(treeView.add_Node("by Type"), mappedFlawsByType);
						addFlawsToTreeNode(treeView.add_Node("by File"), mappedFlawsByFile);
						addFlawsToTreeNode(treeView.add_Node("by Severity"),mappedFlawsBySeverity);
						o2Timer.stop();		
					};
			
			treeView.onDrop(
				(file)=>{
							apiVeracode.load(file);
							showData(); 			
						});
			if (apiVeracode.ReportXmlFile.valid())
				showData(); 
			else
				treeView.add_Node("drop a Veracode DetailedFindings Xml (or zip) file to view it"); 			
			
			
//			"There were {0} Files That Could Not Mapped Locally".error(apiVeracode.FilesThatCouldNotMappedLocally.size());			
			/*if (treeView.nodes()>0))
			{
				treeView.nodes()[0]
					 	.expand().nodes()[2].selected();
			}
			*/
			return apiVeracode;
    	}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:92,代码来源:API_Veracode_DetailedXmlFindings.cs

示例5: show_In_TableList

    	public static ctrl_TableList show_In_TableList(this List<FlawType> flaws , Control control)
    	{    	
    		control.clear();
    		var tableList = control.add_TableList();
    		Action showData = 
    			()=>{
		    			
						var selectedRows =  from flaw in flaws
											select new {flaw.severity, flaw.categoryname, flaw.issueid,
														flaw.module, flaw.type, flaw.description, flaw.cweid,  
														flaw.exploitLevel, flaw.categoryid, 
														flaw.sourcefile, flaw.line,  flaw.sourcefilepath,
														flaw.scope, flaw.functionprototype, flaw.functionrelativelocation};
				  
		
						tableList.show(selectedRows);
						tableList.makeColumnWidthMatchCellWidth();
					};
			tableList.onDrop(
				(file)=>{
							var apiVeracode = new API_Veracode_DetailedXmlFindings().load(file);
							flaws = apiVeracode.flaws();
							showData();
						});
			if (flaws.size()>0)
				showData(); 
			else
				tableList.add_Column("note")
						 .add_Row("drop a Veracode DetailedFindings Xml (or zip) file to view it")
						 .makeColumnWidthMatchCellWidth();
				
			return tableList;
		}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:33,代码来源:API_Veracode_DetailedXmlFindings.cs

示例6: add_MultipleGuiViewers

    	public static API_Veracode_DetailedXmlFindings add_MultipleGuiViewers(this API_Veracode_DetailedXmlFindings apiVeracode , Control control)
    	{
    		var topPanel = control.clear();
    		topPanel.insert_LogViewer();
    		var viewersPanel = topPanel.insert_Left(200,"Viewers");

			var viewInTreeView = viewersPanel.add_Link("View in TreeView",0, 0, ()=> apiVeracode.show_In_TreeView(topPanel)); 
			var viewInTableList = viewersPanel.add_Link("View in TableList",20, 0, ()=> apiVeracode.show_In_TableList(topPanel));  
			var viewInSourceCodeViewer = viewersPanel.add_Link("View in SourceCodeViewer",40, 0, ()=> apiVeracode.show_Flaws_In_SourceCodeViewer(topPanel));
			
			var sourceCodePaths = viewersPanel.insert_Below("Source Code Paths").add_TextArea();
			sourceCodePaths.onTextChange(
				(text)=>{
							apiVeracode.SourceCodePaths.Clear();
							apiVeracode.SourceCodePaths.AddRange(text.split_onLines().ToArray());
						});
				
			viewersPanel.onDrop(
				(file)=>{
							if (file.fileExists())
							{										
								apiVeracode.load(file);   
								viewInSourceCodeViewer.click();
							}
						});
			
			viewInSourceCodeViewer.click();
			
			
			viewersPanel.add_Label("DROP XML FILE HERE to load it", 100,0).font_bold(); 
			return apiVeracode;
		}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:32,代码来源:API_Veracode_DetailedXmlFindings.cs

示例7: createGui_EditUsingCategories

        public void createGui_EditUsingCategories(Control hostControl, string title1, string title2)
        {
        	hostControl.clear();
        	var usersGui = hostControl.add_1x1(title1,title2,true,hostControl.width()/3);
        	
        	var pageEditor = usersGui[1].Parent.clear().add_Control<ascx_MediaWiki_PageEditor_Simple>().buildGui(WikiApi); 
        	
			var controls = usersGui[0].Parent.clear().add_1x1("Category Names","Pages in Selected Category",false);
			var Categories_TreeView = controls[0].add_TreeView();
			var PagesInCategories_TreeView = controls[1].add_TreeView();

        	MethodInvoker loadData = 
        		()=>{
						//Categories_TreeView.clear();
						Categories_TreeView =  controls[0].add_TreeViewWithFilter(WikiApi.categoryPages())
														    .afterSelect<string>(
							(value)=>{
										PagesInCategories_TreeView = controls[1].add_TreeViewWithFilter(WikiApi.pagesInCategory(value))
														    					.afterSelect<string>((page)=>pageEditor.openPage(page));
									 
						
										pageEditor.openPage(value); 
										addEditMenuItemsToTreeView(PagesInCategories_TreeView);	
									 });
									 
						addEditMenuItemsToTreeView(Categories_TreeView);
						
					 };
						//PagesInCategories_TreeView.clear();
						//Categories_TreeView.add_Nodes(WikiApi.categoryPages());					
					
			controls[1].insert_Below<Panel>(20)
					   .add_Link("Reload data",0,0,()=> loadData())
						.click();        					 
        }
开发者ID:jobyjames85,项目名称:O2.Platform.Scripts,代码行数:35,代码来源:MediaWikiEditor.cs

示例8: showEditGui

        public Control showEditGui(Control hostControl, string title1, string title2, Func<List<string>> getContent)
        {   
        	hostControl.clear();
        	var usersGui = hostControl.add_1x1(title1,title2,true, hostControl.width()/3);
        	
        	var pageEditor = usersGui[1].add_Control<ascx_MediaWiki_PageEditor_Simple>().buildGui(WikiApi); 
        	
        	Action<Control> loadData = 
        		(control)=>{
        						control.clear();
        						control.enabled(false);
        						O2Thread.mtaThread(
        						()=>{        				
			        					var content = getContent();
			        					var treeView = control.add_TreeViewWithFilter(content)
			        					       				  .afterSelect<string>((userPage)=> pageEditor.openPage(userPage)); 
			        					addEditMenuItemsToTreeView(treeView);
			        					control.enabled(true);       
			        				});
        					};
        	
			        	
			        	
			usersGui[0].insert_Below<Panel>(20)
					   .add_Link("Reload data",0,0,
							()=> loadData(usersGui[0]))
						.click();
			return hostControl;						        
        }                
开发者ID:jobyjames85,项目名称:O2.Platform.Scripts,代码行数:29,代码来源:MediaWikiEditor.cs

示例9: buildGui

        public REPL_Gui buildGui(Control targetControl)
        {
            try
            {
                TopPanel = targetControl.clear().add_Panel();

                Code_Panel = TopPanel.insert_Left("Code");

                Output_Panel = TopPanel.add_GroupBox("Invoke and Result")
                                       .add_GroupBox("Output").add_Panel();
                Execute_Button = Output_Panel.parent().insert_Above(60).add_Button("Execute").fill();
                Execute_Button.insert_Below(20).add_Link("stop execution", () => this.stopCurrentExecution());
                Output_View_RichTextBox = Output_Panel.add_RichTextBox();
                Output_View_Object = Output_Panel.add_Panel();
                //set actions

                Execute_Button.onClick(
                    () =>
                        {
                            try
                            {
                                ExecutionThread = O2Thread.mtaThread(() => On_ExecuteCode.invoke());
                            }
                            catch (Exception ex)
                            {
                                ex.log();
                            }
                        });
            }
            catch (Exception ex)
            {
                ex.log("[REPL_Gui] in buildGui");
            }
            return this;
        }
开发者ID:njmube,项目名称:FluentSharp,代码行数:35,代码来源:REPL_Gui.cs


注:本文中的System.Windows.Forms.Control.clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。