private void removePointcutTargetToolStripMenuItem_Click(object sender, EventArgs e) { PresentationPointcutTarget pointcutTarget = selected as PresentationPointcutTarget; if (pointcutTarget != null) { RemovePointcutTarget(pointcutTarget); } }
private void AddPointcutTarget(PresentationPointcut pointcut) { PresentationPointcutTarget pointcutTarget = new PresentationPointcutTarget(pointcut); pointcutTarget.Signature = "[New Pointcut Target]"; pointcutTarget.TargetType = PointcutTargetType.Signature; pointcut.Targets.Add(pointcutTarget); RefreshAll(); }
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 SerializePointcutTarget(PresentationPointcutTarget target, XmlDocument xmlDoc, XmlNode pointcutNode) { 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); } pointcutNode.AppendChild(targetNode); }
private void RemovePointcutTarget(PresentationPointcutTarget pointcutTarget) { pointcutTarget.Pointcut.Targets.Remove(pointcutTarget); RefreshAll(); }