コード例 #1
0
		public override TreeViewNodeFilterResult GetFilterResult(LoadedAssembly asm, AssemblyFilterType type) {
			if (type == AssemblyFilterType.NonNetFile)
				return new TreeViewNodeFilterResult(FilterResult.Hidden, false);

			if (type == AssemblyFilterType.Assembly) {
				if (assembly == null || asm.AssemblyDefinition != assembly)
					return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
				return new TreeViewNodeFilterResult(FilterResult.Match, false);
			}

			if (type == AssemblyFilterType.NetModule) {
				if (asm.AssemblyDefinition != assembly)
					return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
				if (assembly == null || assembly.ManifestModule != module) {
					if (asm.ModuleDefinition != module)
						return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
					return new TreeViewNodeFilterResult(FilterResult.Match, false);
				}
				else
					return new TreeViewNodeFilterResult(FilterResult.Match, asm.ModuleDefinition != assembly.ManifestModule);
			}

			Debug.Fail("Invalid AssemblyFilterType value");
			return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
		}
コード例 #2
0
		public override TreeViewNodeFilterResult GetFilterResult(DnSpyFile file, AssemblyFilterType type) {
			if (file.AssemblyDef != allowedAsm)
				return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
			if (allowedAsm == null && file.ModuleDef != allowedMod)
				return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
			return base.GetFilterResult(file, type);
		}
コード例 #3
0
		public override TreeViewNodeFilterResult GetFilterResult(LoadedAssembly asm, AssemblyFilterType type) {
			if (asm.AssemblyDefinition != allowedAsm)
				return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
			if (allowedAsm == null && asm.ModuleDefinition != allowedMod)
				return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
			return base.GetFilterResult(asm, type);
		}
コード例 #4
0
		public override TreeViewNodeFilterResult GetFilterResult(LoadedAssembly asm, AssemblyFilterType type) {
			VisibleMembersFlags thisFlag, visibleFlags;
			switch (type) {
			case AssemblyFilterType.Assembly:
				thisFlag = VisibleMembersFlags.AssemblyDef;
				visibleFlags = thisFlag | VisibleMembersFlags.ModuleDef |
						VisibleMembersFlags.Namespace | VisibleMembersFlags.AnyTypeDef |
						VisibleMembersFlags.FieldDef | VisibleMembersFlags.MethodDef |
						VisibleMembersFlags.InstanceConstructor | VisibleMembersFlags.PropertyDef |
						VisibleMembersFlags.EventDef | VisibleMembersFlags.AssemblyRef |
						VisibleMembersFlags.BaseTypes | VisibleMembersFlags.DerivedTypes |
						VisibleMembersFlags.ModuleRef | VisibleMembersFlags.ResourceList |
						VisibleMembersFlags.MethodBody | VisibleMembersFlags.ParamDefs |
						VisibleMembersFlags.ParamDef | VisibleMembersFlags.Locals |
						VisibleMembersFlags.Local | VisibleMembersFlags.Resource |
						VisibleMembersFlags.ResourceElement | VisibleMembersFlags.PE |
						VisibleMembersFlags.Hex;
				break;

			case AssemblyFilterType.NetModule:
				thisFlag = VisibleMembersFlags.ModuleDef;
				visibleFlags = thisFlag |
						VisibleMembersFlags.Namespace | VisibleMembersFlags.AnyTypeDef |
						VisibleMembersFlags.FieldDef | VisibleMembersFlags.MethodDef |
						VisibleMembersFlags.InstanceConstructor | VisibleMembersFlags.PropertyDef |
						VisibleMembersFlags.EventDef | VisibleMembersFlags.AssemblyRef |
						VisibleMembersFlags.BaseTypes | VisibleMembersFlags.DerivedTypes |
						VisibleMembersFlags.ModuleRef | VisibleMembersFlags.ResourceList |
						VisibleMembersFlags.MethodBody | VisibleMembersFlags.ParamDefs |
						VisibleMembersFlags.ParamDef | VisibleMembersFlags.Locals |
						VisibleMembersFlags.Local | VisibleMembersFlags.Resource |
						VisibleMembersFlags.ResourceElement | VisibleMembersFlags.PE |
						VisibleMembersFlags.Hex;
				break;

			case AssemblyFilterType.NonNetFile:
			default:
				thisFlag = VisibleMembersFlags.NonNetFile;
				visibleFlags = thisFlag | VisibleMembersFlags.PE | VisibleMembersFlags.Hex;
				break;
			}
			bool isMatch = (flags & thisFlag) != 0;
			if ((flags & visibleFlags) == 0)
				return new TreeViewNodeFilterResult(FilterResult.Hidden, isMatch);

			if (isMatch)
				return new TreeViewNodeFilterResult(FilterResult.Match, isMatch);   // Make sure it's not hidden

			return new TreeViewNodeFilterResult(null, isMatch);
		}
コード例 #5
0
		public virtual TreeViewNodeFilterResult GetFilterResult(DnSpyFile file, AssemblyFilterType type) {
			return new TreeViewNodeFilterResult(FilterResult.Hidden, false);
		}
コード例 #6
0
		public virtual TreeViewNodeFilterResult GetFilterResult(LoadedAssembly asm, AssemblyFilterType type) {
			return new TreeViewNodeFilterResult();
		}
コード例 #7
0
		public virtual TreeViewNodeFilterResult GetFilterResult(DnSpyFile file, AssemblyFilterType type) {
			return filter.GetFilterResult(file, type);
		}