/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> /// <param name="displayerText">Text to display</param> public ReferenceStatusImageLinkLabel(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType, string displayerText) { Displayer = displayer; Entity = entity; ReflectionType = reflectionType; DisplayerText = displayerText; }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> /// <param name="displayerText">Text to display</param> public ReferenceAvalonButtonM(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType, string displayerText) { this.displayer = displayer; this.entity = entity; this.reflectionType = reflectionType; this.displayerText = displayerText; }
public static DisplayerParams CreateScreenParams(ReflectionTypes reflectionType, string pageCaption, ScreenControl screenControl) { return(new DisplayerParams() { TypeOfReflection = reflectionType, PageCaption = pageCaption, Page = screenControl, DisplayerType = DisplayerType.Screen }); }
/// <summary> /// Creates new instance of ReferenceEventArgs /// </summary> /// <param name="requestedEntity">Entity to display</param> /// <param name="typeOfReflection">Displaying parameters</param> /// <param name="destinationDisplayer">Displayer where entity must be displayed</param> /// <param name="displayerText">Text of displayer's header</param> public ReferenceEventArgs(IDisplayingEntity requestedEntity, ReflectionTypes typeOfReflection, IDisplayer destinationDisplayer, string displayerText) { this.requestedEntity = requestedEntity; this.typeOfReflection = typeOfReflection; this.destinationDisplayer = destinationDisplayer; this.displayerText = displayerText; }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> /// <param name="displayerText">Text to display</param> public RichReferenceButton(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType, string displayerText) { this.displayer = displayer; this.entity = entity; this.reflectionType = reflectionType; this.displayerText = displayerText; Click += RichReferenceButton_Click; }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> /// <param name="displayerText">Text to display</param> public RichReferenceButton(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType, string displayerText) { Displayer = displayer; Entity = entity; ReflectionType = reflectionType; DisplayerText = displayerText; Click += RichReferenceButtonClick; }
/// <summary> /// Initializes a new instance of the <see cref="ReflectionCacheKey"/> class. /// </summary> /// <param name="type"> /// The type. /// </param> /// <param name="reflectionType"> /// The reflection type. /// </param> /// <param name="bindingFlags"> /// The binding flags. /// </param> /// <param name="additionalInfo"> /// The additional info. /// </param> public ReflectionCacheKey(Type type, ReflectionTypes reflectionType, BindingFlags bindingFlags, object additionalInfo = null) { Type = type; ReflectionType = reflectionType; BindingFlags = bindingFlags; AdditionalInfo = additionalInfo; _hashCode = CalculateHashCode(); }
/// <summary> /// Creates instance of control providing information about aircraft and it's operator /// </summary> /// <param name="aircraft">Aircraft to display</param> public AircraftScreenHeaderControl(Aircraft aircraft, bool operatorClickable) : base(aircraft.Parent as Operator, operatorClickable) { this.aircraft = aircraft; InitializeComponents(); reflectionType = ReflectionTypes.DisplayInNew; //TitleButton.Click += title_Click; UpdateInformation(); }
private void InitializeComponent() { ReflectionType = ReflectionTypes.DisplayInNew; Dock = DockStyle.Left; Size = new Size(250, 47); PaddingMain = new Padding(0, 8, 0, 0); FontMain = new Font("Verdana", 16, GraphicsUnit.Pixel); ForeColorMain = Css.OrdinaryText.Colors.ForeColor; ForeColorSecondary = Css.OrdinaryText.Colors.ForeColor; Click += AircraftStateItem_Click; }
/// <summary> /// Occurs when requested associated displayer /// </summary> protected void OnDisplayerRequested() { if (null != DisplayerRequested) { ReflectionTypes reflection = reflectionType; Keyboard k = new Keyboard(); if (k.ShiftKeyDown && reflection == ReflectionTypes.DisplayInCurrent) { reflection = ReflectionTypes.DisplayInNew; } DisplayerRequested(this, null != displayer ? new ReferenceEventArgs(entity, reflection, displayer, displayerText) : new ReferenceEventArgs(entity, reflection, displayerText)); } }
private void ButtonEditClick(object sender, EventArgs e) { if (_screenControl != null && _screenControl.IsDisposed) { _screenControl = null; } if (_screenControl == null) { _screenControl = new CommonListScreen(_type); } //Отписка от событий, что бы они не были подписаны 2 и более раз _screenControl.EntityRemoving -= ScreenControlEntityRemoving; _screenControl.EntityRemoved -= ScreenControlEntityRemoved; //Подписка на события _screenControl.EntityRemoving += ScreenControlEntityRemoving; _screenControl.EntityRemoved += ScreenControlEntityRemoved; if (null != DisplayerRequested) { ReflectionTypes reflection = ReflectionType; Keyboard k = new Keyboard(); if (k.ShiftKeyDown && reflection == ReflectionTypes.DisplayInCurrent) { reflection = ReflectionTypes.DisplayInNew; } ReferenceEventArgs refe = null != Displayer ? new ReferenceEventArgs(Entity, reflection, Displayer, DisplayerText) : new ReferenceEventArgs(Entity, reflection, DisplayerText); DescriptionAttribute da = _type.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute; string typeName = da != null && !string.IsNullOrEmpty(da.Description) ? da.Description : _type.Name; refe.DisplayerText = typeName; refe.RequestedEntity = _screenControl; refe.TypeOfReflection = ReflectionTypes.DisplayInNew; DisplayerRequested(this, refe); } }
private void OnDisplayerRequested() { if (DisplayerRequested != null) { ReflectionTypes reflection = reflectionType; Keyboard k = new Keyboard(); if (k.ShiftKeyDown && reflection == ReflectionTypes.DisplayInCurrent) { reflection = ReflectionTypes.DisplayInNew; } if (null != displayer) { DisplayerRequested(this, new ReferenceEventArgs(entity, reflection, displayer, displayerText)); } else { DisplayerRequested(this, new ReferenceEventArgs(entity, reflection, displayerText)); } } }
/// <summary> /// Метод, возбуждающий событие DisplayerRequested /// </summary> protected void OnDisplayerRequested() { if (null != DisplayerRequested) { ReflectionTypes reflection = ReflectionType; Keyboard k = new Keyboard(); if (k.ShiftKeyDown && reflection == ReflectionTypes.DisplayInCurrent) { reflection = ReflectionTypes.DisplayInNew; } ReferenceEventArgs e; if (null != Displayer) { e = new ReferenceEventArgs(Entity, reflection, Displayer, DisplayerText); } else { e = new ReferenceEventArgs(Entity, reflection, DisplayerText); } FillDisplayerRequestedParams(e); DisplayerRequested(this, e); } }
/// <summary> /// /// </summary> public ReferenceEventArgs() { typeOfReflection = ReflectionTypes.DisplayInNew; }
public static void WriteDefinition(this IndexWriter writer, Assembly assembly, ReflectionTypes dataToExport) { if (assembly == null) { return; } Type[] assemblyTypes = assembly.GetTypes(); if (assemblyTypes == null) { return; } int totalTypes = assemblyTypes.Length; //Type writerClass = typeof(IndexWriterRelfectionExtensions); //MethodInfo writerMethod = writerClass.GetMethod("WriteDefinition", new Type[] { typeof(IndexWriter), typeof(FieldStorage), typeof(DefinitionData) }); //if (writerMethod == null) return; for (int i = 0; i < totalTypes; i++) { // we can't output generic parameter types //if (assemblyTypes[i].ContainsGenericParameters) continue; //MethodInfo typeMethod = writerMethod.MakeGenericMethod(assemblyTypes[i]); //typeMethod.Invoke(writer, new object[] { writer, new FieldStorage(true, FieldSearchableRule.Analyzed, FieldVectorRule.No), DefinitionData.All }); WriteDefinition(writer, assemblyTypes[i], dataToExport); } }
public static void WriteDefinition(this IndexWriter writer, Type typeToOutput, ReflectionTypes dataToExport) { if (typeToOutput == null) { throw new ArgumentNullException("typeToOutput", "typeToOutput cannot be null"); } if (writer == null) { throw new ArgumentNullException("writer", "writer cannot be null"); } if (!writer.IsOpen) { throw new ObjectDisposedException("writer", "You cannot access this method from a disposed IndexWriter"); } string assemblyName = typeToOutput.Assembly.FullName; string codeTypeFieldName = "CodeType"; string assemblyFieldName = "AssemblyName"; string declaringTypeFieldName = "DeclaringType"; string declarationModifiersFieldName = "DeclarationModifiers"; string declarationFieldName = "Declaration"; string parametersFieldName = "Parameters"; bool exportAll = ((dataToExport & ReflectionTypes.All) == ReflectionTypes.All); int i = 0; if (exportAll || (dataToExport & ReflectionTypes.Constructors) == ReflectionTypes.Constructors) { ConstructorInfo[] constructors = typeToOutput.GetConstructors(); if (constructors != null) { int totalConstructors = constructors.Length; for (i = 0; i < totalConstructors; i++) { IndexDocument constructorDocument = new IndexDocument(); constructorDocument.Add(new FieldNormal(codeTypeFieldName, "Constructor", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); constructorDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); constructorDocument.Add(new FieldNormal(declaringTypeFieldName, constructors[i].DeclaringType == null ? NO_VALUE : constructors[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); constructorDocument.Add(new FieldNormal(declarationModifiersFieldName, GetAccessParameters(constructors[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); constructorDocument.Add(new FieldNormal(declarationFieldName, constructors[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); constructorDocument.Add(new FieldNormal(parametersFieldName, GetParameterString(constructors[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(constructorDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.Properties) == ReflectionTypes.Properties) { PropertyInfo[] properties = typeToOutput.GetProperties(); if (properties != null) { int totalProperties = properties.Length; for (i = 0; i < totalProperties; i++) { IndexDocument propertyDocument = new IndexDocument(); propertyDocument.Add(new FieldNormal(codeTypeFieldName, "Property", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); propertyDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); propertyDocument.Add(new FieldNormal(declaringTypeFieldName, properties[i].DeclaringType == null ? NO_VALUE : properties[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); propertyDocument.Add(new FieldNormal(declarationModifiersFieldName, GetAccessParameters(properties[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); propertyDocument.Add(new FieldNormal(declarationFieldName, properties[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); propertyDocument.Add(new FieldNormal(parametersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(propertyDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.NestedTypes) == ReflectionTypes.NestedTypes) { Type[] nestedTypes = typeToOutput.GetNestedTypes(); if (nestedTypes != null) { int totalNestedTypes = nestedTypes.Length; for (i = 0; i < totalNestedTypes; i++) { IndexDocument nestedDocument = new IndexDocument(); nestedDocument.Add(new FieldNormal(codeTypeFieldName, "NestedType", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); nestedDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); nestedDocument.Add(new FieldNormal(declaringTypeFieldName, nestedTypes[i].DeclaringType == null ? NO_VALUE : nestedTypes[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); nestedDocument.Add(new FieldNormal(declarationModifiersFieldName, GetAccessParameters(nestedTypes[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); nestedDocument.Add(new FieldNormal(declarationFieldName, nestedTypes[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); nestedDocument.Add(new FieldNormal(parametersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(nestedDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.Methods) == ReflectionTypes.Methods) { MethodInfo[] methods = typeToOutput.GetMethods(); if (methods != null) { int totalMethods = methods.Length; for (i = 0; i < totalMethods; i++) { IndexDocument methodDocument = new IndexDocument(); methodDocument.Add(new FieldNormal(codeTypeFieldName, "Method", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); methodDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); methodDocument.Add(new FieldNormal(declaringTypeFieldName, methods[i].DeclaringType == null ? NO_VALUE : methods[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); methodDocument.Add(new FieldNormal(declarationModifiersFieldName, GetAccessParameters(methods[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); methodDocument.Add(new FieldNormal(declarationFieldName, methods[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); methodDocument.Add(new FieldNormal(parametersFieldName, GetParameterString(methods[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(methodDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.Members) == ReflectionTypes.Members) { MemberInfo[] members = typeToOutput.GetMembers(); if (members != null) { int totalMembers = members.Length; for (i = 0; i < totalMembers; i++) { IndexDocument memberDocument = new IndexDocument(); memberDocument.Add(new FieldNormal(codeTypeFieldName, "Member", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); memberDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); memberDocument.Add(new FieldNormal(declaringTypeFieldName, members[i].DeclaringType == null ? NO_VALUE : members[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); memberDocument.Add(new FieldNormal(declarationModifiersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); memberDocument.Add(new FieldNormal(declarationFieldName, members[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); memberDocument.Add(new FieldNormal(parametersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(memberDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.Interfaces) == ReflectionTypes.Interfaces) { Type[] interfaces = typeToOutput.GetInterfaces(); if (interfaces != null) { int totalInterfaces = interfaces.Length; for (i = 0; i < totalInterfaces; i++) { IndexDocument interfaceDocument = new IndexDocument(); interfaceDocument.Add(new FieldNormal(codeTypeFieldName, "Interface", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); interfaceDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); interfaceDocument.Add(new FieldNormal(declaringTypeFieldName, interfaces[i].DeclaringType == null ? NO_VALUE : interfaces[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); interfaceDocument.Add(new FieldNormal(declarationModifiersFieldName, GetAccessParameters(interfaces[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); interfaceDocument.Add(new FieldNormal(declarationFieldName, interfaces[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); interfaceDocument.Add(new FieldNormal(parametersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(interfaceDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.Fields) == ReflectionTypes.Fields) { FieldInfo[] fields = typeToOutput.GetFields(); if (fields != null) { int totalFields = fields.Length; for (i = 0; i < totalFields; i++) { IndexDocument fieldDocument = new IndexDocument(); fieldDocument.Add(new FieldNormal(codeTypeFieldName, "Field", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); fieldDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); fieldDocument.Add(new FieldNormal(declaringTypeFieldName, fields[i].DeclaringType == null ? NO_VALUE : fields[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); fieldDocument.Add(new FieldNormal(declarationModifiersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); fieldDocument.Add(new FieldNormal(declarationFieldName, fields[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); fieldDocument.Add(new FieldNormal(parametersFieldName, GetAccessParameters(fields[i]), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(fieldDocument); } } } if (exportAll || (dataToExport & ReflectionTypes.Events) == ReflectionTypes.Events) { EventInfo[] events = typeToOutput.GetEvents(); if (events != null) { int totalEvents = events.Length; for (i = 0; i < totalEvents; i++) { IndexDocument eventDocument = new IndexDocument(); eventDocument.Add(new FieldNormal(codeTypeFieldName, "Event", true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); eventDocument.Add(new FieldNormal(assemblyFieldName, assemblyName, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); eventDocument.Add(new FieldNormal(declaringTypeFieldName, events[i].DeclaringType == null ? NO_VALUE : events[i].DeclaringType.Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); eventDocument.Add(new FieldNormal(declarationModifiersFieldName, NO_VALUE, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); eventDocument.Add(new FieldNormal(declarationFieldName, events[i].Name, true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); eventDocument.Add(new FieldNormal(parametersFieldName, GetAccessParameters(events[i].GetRaiseMethod()), true, FieldSearchableRule.Analyzed, FieldVectorRule.No)); writer.Write(eventDocument); } } } }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> public ReferenceStatusImageLinkLabel(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType) : this(displayer, entity, reflectionType, "") { }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> public RichReferenceButton(IDisplayingEntity entity, ReflectionTypes reflectionType) : this(null, entity, reflectionType) { }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> public ReferenceStatusImageLinkLabel(IDisplayingEntity entity, ReflectionTypes reflectionType) : this(null, entity, reflectionType) { }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> public ReferenceAvalonButtonM(IDisplayingEntity entity, ReflectionTypes reflectionType) : this(null, entity, reflectionType) { }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> public ReferenceAvalonButtonM(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType) : this(displayer, entity, reflectionType, "") { }
/// <summary> /// /// </summary> public ReferenceEventArgs() { _typeOfReflection = ReflectionTypes.DisplayInCurrent; }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> /// <param name="displayerText">Text to display</param> public RichReferenceButton(IDisplayingEntity entity, ReflectionTypes reflectionType, string displayerText) : this(null, entity, reflectionType, displayerText) { }
/// <summary> /// Creates new instance of ReferenceEventArgs /// </summary> /// <param name="requestedEntity">Entity to display</param> /// <param name="typeOfReflection">Displaying parameters</param> /// <param name="displayerText">Text of displayer's header</param> public ReferenceEventArgs(IDisplayingEntity requestedEntity, ReflectionTypes typeOfReflection, string displayerText) : this(requestedEntity, typeOfReflection, null, displayerText) { }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> /// <param name="displayerText">Text to display</param> public ReferenceStatusImageLinkLabel(IDisplayingEntity entity, ReflectionTypes reflectionType, string displayerText) : this(null, entity, reflectionType, displayerText) { }
/// <summary> /// Creates new instance of reference avbutton /// </summary> /// <param name="displayer">Displayer in which entity should be displayed</param> /// <param name="entity">Entity to display</param> /// <param name="reflectionType">Type of displaying</param> public RichReferenceButton(IDisplayer displayer, IDisplayingEntity entity, ReflectionTypes reflectionType) : this(displayer, entity, reflectionType, "") { }
public void SetParameters(DisplayerParams parameters) { _typeOfReflection = parameters.TypeOfReflection; _requestedEntity = parameters.Page; _displayerText = parameters.PageCaption; }