예제 #1
0
        private void WriteConstructor(StreamWriter writer)
        {
            writer.WriteLine();
            writer.WriteLine("//<editor-fold defaultstate=\"collapsed\" desc=\"Constructor\">");

            if (ComponentType.IsSubclassOf(typeof(EventArgs)))
            {
                List <string> fields = new List <string>();
                writer.Write("public {0}(Object source", className);

                foreach (var property in ComponentType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
                {
                    string typeName  = JavaHelper.GetTypeName(property.PropertyType);
                    string fieldName = JavaHelper.GetCammelCase(property.Name);
                    writer.Write(", {0} {1}", typeName, fieldName);
                    fields.Add(fieldName);
                }

                writer.WriteLine(")");
                writer.WriteLine("{");
                writer.WriteLine("	super(source);");
                foreach (var fieldName in fields)
                {
                    writer.WriteLine("	this.{0} = {0};", fieldName);
                }
                writer.WriteLine("}");
            }
            else if (ComponentType.IsSubclassOf(typeof(ACBrComposedComponent)))
            {
            }

            writer.WriteLine();
            writer.WriteLine();
            writer.WriteLine("//</editor-fold>");
        }
예제 #2
0
        public IEnumerable <CascadingParameterInfo> GetCascadingParameterInfos()
        {
            var properties = ComponentType.GetProperties(BindingFlags.Public | BindingFlags.Instance);

            foreach (var curProperty in properties)
            {
                var paramAttr = curProperty.GetCustomAttribute <CascadingParameterAttribute>(false);
                if (paramAttr == null)
                {
                    continue;
                }

                yield return(new CascadingParameterInfo(
                                 paramAttr.Name,
                                 curProperty.PropertyType));
            }
        }
예제 #3
0
        private void WriteFields(StreamWriter writer)
        {
            if (ComponentType.IsSubclassOf(typeof(ACBrInteropBase)))
            {
                return;
            }

            writer.WriteLine();
            writer.WriteLine("//<editor-fold defaultstate=\"collapsed\" desc=\"Fields\">");

            foreach (var property in ComponentType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
            {
                WriteField(writer, property);
            }

            writer.WriteLine();
            writer.WriteLine();
            writer.WriteLine("//</editor-fold>");
        }
예제 #4
0
        private void WriteProperties(StreamWriter writer)
        {
            writer.WriteLine();
            writer.WriteLine("//<editor-fold defaultstate=\"collapsed\" desc=\"Properties\">");

            foreach (var property in ComponentType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
            {
                if (InteropType == null)
                {
                    WriteProperty(writer, property);
                }
                else
                {
                    WriteInteropProperty(writer, property);
                }
            }

            writer.WriteLine();
            writer.WriteLine();
            writer.WriteLine("//</editor-fold>");
        }