C2016-008: Don’t have ‘Create Missing Enhanced xxx Document Steps’ on context menu if enhanced section does not exist.
This commit is contained in:
		@@ -179,7 +179,19 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
				if (!itemHasLink)
 | 
									if (!itemHasLink)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					if (inSource && (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0)))
 | 
										// don't put up 'create missing' if the enhanced procedure does not have a section for this step:
 | 
				
			||||||
 | 
										ItemInfo sectInfo = MyItemInfo.ActiveSection;
 | 
				
			||||||
 | 
										SectionConfig sectConfig = sectInfo.MyConfig as SectionConfig;
 | 
				
			||||||
 | 
										bool hasEnhSect = false;
 | 
				
			||||||
 | 
										foreach (EnhancedDocument edsect in sectConfig.MyEnhancedDocuments)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											if (edsect.Type == edtypebtn)
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												hasEnhSect = true;
 | 
				
			||||||
 | 
												break;
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										if (inSource && hasEnhSect && (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0)))
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
						biEnhanced.Visible = true;
 | 
											biEnhanced.Visible = true;
 | 
				
			||||||
						biEnhanced.Text = string.Format("Create Missing Enhanced {0} Document Step", dveds.GetByType(edtypebtn).Name);
 | 
											biEnhanced.Text = string.Format("Create Missing Enhanced {0} Document Step", dveds.GetByType(edtypebtn).Name);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user