Example #1
0
		void AnalyzeMessageAttach(BAMLAnalyzer analyzer, Tuple<IDnlibDef, AttributeInfoRecord, TypeDef> attr, string value) {
			if (attr.Item2 == null)
				return;
			var attrDeclType = analyzer.ResolveType(attr.Item2.OwnerTypeId);
			if (attrDeclType.FullName != "Caliburn.Micro.Message")
				return;

			foreach (var msg in value.Split(';')) {
				string msgStr;
				if (msg.Contains("=")) {
					msgStr = msg.Split('=')[1].Trim('[', ']', ' ');
				}
				else {
					msgStr = msg.Trim('[', ']', ' ');
				}
				if (msgStr.StartsWith("Action"))
					msgStr = msgStr.Substring(6);
				int parenIndex = msgStr.IndexOf('(');
				if (parenIndex != -1)
					msgStr = msgStr.Substring(0, parenIndex);

				string actName = msgStr.Trim();
				foreach (var method in analyzer.LookupMethod(actName))
					analyzer.NameService.SetCanRename(method, false);
			}
		}
Example #2
0
        void AnalyzeAutoBind(BAMLAnalyzer analyzer, Tuple<IDnlibDef, AttributeInfoRecord, TypeDef> attr, string value)
        {
            if (!(attr.Item1 is PropertyDef) || ((PropertyDef)attr.Item1).DeclaringType.FullName != "System.Windows.FrameworkElement")
                return;

            foreach (var method in analyzer.LookupMethod(value))
                analyzer.NameService.SetCanRename(method, false);
            foreach (var method in analyzer.LookupProperty(value))
                analyzer.NameService.SetCanRename(method, false);
        }
Example #3
0
        void AnalyzeActionMessage(BAMLAnalyzer analyzer, Tuple<IDnlibDef, AttributeInfoRecord, TypeDef> attr, string value)
        {
            if (attr.Item2 == null)
                return;
            var attrDeclType = analyzer.ResolveType(attr.Item2.OwnerTypeId);
            if (attrDeclType.FullName != "Caliburn.Micro.ActionMessage")
                return;

            foreach (var method in analyzer.LookupMethod(value))
                analyzer.NameService.SetCanRename(method, false);
        }