private void AddAspectTarget(PresentationAspect aspect) { PresentationAspectTarget aspectTarget = new PresentationAspectTarget(aspect); aspectTarget.Signature = "[New Aspect Target]"; aspectTarget.TargetType = AspectTargetType.Signature; aspect.Targets.Add(aspectTarget); RefreshAll(); }
private void removeAspectTargetToolStripMenuItem_Click(object sender, EventArgs e) { PresentationAspectTarget aspectTarget = selected as PresentationAspectTarget; if (aspectTarget != null) { RemoveAspectTarget(aspectTarget); } }
private void SelectObject(object obj) { PresentationAspect aspect = obj as PresentationAspect; if (aspect != null) { propertyGrid.SelectedObject = new AspectProperties(aspect); ShowAspectTypes(aspect); } PresentationAspectTarget aspectTarget = obj as PresentationAspectTarget; if (aspectTarget != null) { propertyGrid.SelectedObject = new AspectTargetProperties(aspectTarget); } PresentationMixin mixin = obj as PresentationMixin; if (mixin != null) { propertyGrid.SelectedObject = new MixinProperties(mixin); } PresentationPointcut pointcut = obj as PresentationPointcut; if (pointcut != null) { propertyGrid.SelectedObject = new PointcutProperties(pointcut); ShowPointcutMethods(pointcut); } PresentationPointcutTarget pointcutTarget = obj as PresentationPointcutTarget; if (pointcutTarget != null) { propertyGrid.SelectedObject = new PointcutTargetProperties(pointcutTarget); } PresentationInterceptor interceptor = obj as PresentationInterceptor; if (interceptor != null) { propertyGrid.SelectedObject = new InterceptorProperties(interceptor); ShowInterceptorMethods(interceptor); } Type type = obj as Type; if (type != null) { propertyGrid.SelectedObject = new TypeProperties(type); } }
private static void SerializeAspectTarget(PresentationAspectTarget target, XmlDocument xmlDoc, XmlNode aspectNode) { XmlNode targetNode = xmlDoc.CreateElement("target"); XmlAttribute sigAttrib = xmlDoc.CreateAttribute("signature"); sigAttrib.Value = target.Signature; targetNode.Attributes.Append(sigAttrib); XmlAttribute typeAttrib = xmlDoc.CreateAttribute("type"); typeAttrib.Value = target.TargetType.ToString().ToLower(); targetNode.Attributes.Append(typeAttrib); if (target.Exclude) { XmlAttribute exAttrib = xmlDoc.CreateAttribute("exclude"); exAttrib.Value = "true"; targetNode.Attributes.Append(exAttrib); } aspectNode.AppendChild(targetNode); }
private void RemoveAspectTarget(PresentationAspectTarget aspectTarget) { aspectTarget.Aspect.Targets.Remove(aspectTarget); RefreshAll(); }