/// <summary> /// 获取类的所有Property信息 /// </summary> /// <param name="codeClass"></param> /// <param name="isRecursive">是否递归获取父类的信息</param> /// <returns></returns> public static List <CodeProperty2> GetCodeProperty2s(CodeClass2 codeClass, bool isRecursive = false) { List <CodeProperty2> list = new List <CodeProperty2>(); //获取基类的属性信息 if (isRecursive && codeClass.Bases.Count > 0) { var baseElements = codeClass.Bases as CodeElements; if (baseElements != null) { CodeClass2 clazz = GetCodeClass2(baseElements); list.AddRange(GetCodeProperty2s(clazz)); } } //获取当前类的属性 foreach (CodeElement prop in codeClass.Members) { if (prop.Kind == vsCMElement.vsCMElementProperty) { CodeProperty2 p = prop as CodeProperty2; list.Add(p); } else if (prop.Kind == vsCMElement.vsCMElementVariable) { CodeVariable2 v = prop as CodeVariable2; } else { Console.WriteLine("" + prop.Kind); } } return(list); }
/// <summary> /// constructor /// </summary> public CodePropertyInfo(BaseInfo parent, CodeProperty2 item) : base(parent, item as CodeElement2) { this._item = item; this.Access = ObjectFactory.Convert(this._item.Access); switch (this._item.ReadWrite) { case vsCMPropertyKind.vsCMPropertyKindReadWrite: this.CanRead = true; this.CanWrite = true; break; case vsCMPropertyKind.vsCMPropertyKindReadOnly: this.CanRead = true; this.CanWrite = false; break; case vsCMPropertyKind.vsCMPropertyKindWriteOnly: this.CanRead = false; this.CanWrite = true; break; } List<ParamInfo> _parameters = new List<ParamInfo>(); int index = 0; foreach (var p in this._item.Parameters.OfType<CodeParameter2>()) { ParamInfo pinfo = ObjectFactory.Instance.CreateParameter(this, p, index++, p.DocComment); _parameters.Add(pinfo); } this.Parameters = _parameters; }
/// <summary> /// Convert CodeProperty2 to PropertyInfo. Cached /// </summary> /// <param name="prop"></param> /// <returns></returns> /// <remarks></remarks> public static PropertyInfo ToPropertyInfo(this CodeProperty2 prop) { var t = prop.Parent.ToType(); var classType = TypeResolver.ByType(t); return(classType.TypeInfo.GetProperty(prop.Name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)); }
public bool IsIgnored(CodeProperty2 ce) { DebugWriteLine(ce.Name); var value = ce.ToPropertyInfo().GetGeneratorAttribute(); return((value != null) && value.IsIgnored); }
public CodeMember(CodeElement2 element, CodeElement2 type, Language language) { this.element = element; this.TypeElement = type; this.language = language; this.Name = element.Name; this.RequiresSeparatorLine = element.Kind != vsCMElement.vsCMElementVariable; switch (element.Kind) { case vsCMElement.vsCMElementFunction: CodeFunction2 function = (CodeFunction2)element; MemberKind kind; switch (function.FunctionKind) { case vsCMFunction.vsCMFunctionConstructor: kind = MemberKind.Constructor; break; case vsCMFunction.vsCMFunctionDestructor: kind = MemberKind.Destructor; break; case vsCMFunction.vsCMFunctionOperator: kind = MemberKind.Operator; break; default: kind = MemberKind.Function; break; } this.Initialize( kind, function.Access, function.IsShared, function.OverrideKind, functionKind: function.FunctionKind, parameters: function.Parameters); break; case vsCMElement.vsCMElementProperty: CodeProperty2 property = (CodeProperty2)element; this.Initialize(MemberKind.Property, property.Access, property.IsShared, property.OverrideKind, parameters: property.Parameters); break; case vsCMElement.vsCMElementVariable: CodeVariable2 variable = (CodeVariable2)element; this.Initialize(MemberKind.Variable, variable.Access, variable.IsShared, constKind: variable.ConstKind); break; case vsCMElement.vsCMElementEvent: CodeEvent evt = (CodeEvent)element; this.Initialize(MemberKind.Event, evt.Access, evt.IsShared, evt.OverrideKind); break; default: throw new NotSupportedException("Unsupported element kind: " + element.Kind); } }
/// <summary> /// Expand auto property into a normal property /// </summary> /// <param name="prop"></param> /// <param name="parentWriter"></param> /// <remarks></remarks> public void ExpandAutoProperty(CodeProperty2 prop, Writer parentWriter) { //Save existing doc comment var comment = prop.AsCodeElement().GetDocComment(); //Get its attribute var propAttrs = prop.GetText(vsCMPart.vsCMPartAttributesWithDelimiter); //Interface implementation var interfaceImpl = prop.GetInterfaceImplementation(); var tsWriter = new Writer(parentWriter) { SegmentType = Types.Region, TagComment = string.Format("{0} auto expanded by", prop.Name), GenAttribute = { RegenMode = GeneratorAttribute.RegenModes.Once } }; //only do this once, since once it is expanded it will no longer be detected as auto property var completeProp = GetIsolatedOutput(() => OutProperty(tsWriter.CreateTaggedRegionName(), prop.Name, prop.Type.SafeFullName(), comment, propAttrs, interfaceImpl)); //Replace all code starting from comment to endPoint of the property var ep = prop.GetCommentStartPoint().CreateEditPoint(); const int options = (int)(vsEPReplaceTextOptions.vsEPReplaceTextAutoformat | vsEPReplaceTextOptions.vsEPReplaceTextNormalizeNewlines); ep.ReplaceText(prop.EndPoint, completeProp, options); }
/// <summary> /// Convert CodeProperty2 to PropertyInfo. Cached /// </summary> /// <param name="prop"></param> /// <returns></returns> /// <remarks></remarks> public static PropertyInfo ToPropertyInfo(this CodeProperty2 prop) { //INSTANT C# NOTE: VB local static variable moved to class level: // Static classCache As new ConcurrentDictionary(Of CodeClass, Type) var classType = ToPropertyInfo_classCache.GetOrAdd(prop.Parent, x => prop.Parent.ToType()); return(classType.GetProperty(prop.Name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)); }
public static void PrintProperty2Info(CodeProperty2 item) { return; Debug.WriteLine("--------PrintParameter2Info--------"); Debug.WriteLine("Rename Method.FullName:" + item.FullName); Debug.WriteLine("Rename Method.OverrideKind :" + item.OverrideKind); Debug.WriteLine("-----------------------------------"); }
/// <summary> /// 获取属性的所有自定义特性 /// </summary> /// <param name="property"></param> /// <returns></returns> public static List <CodeAttribute2> GetCodeAttribute2s(CodeProperty2 property) { List <CodeAttribute2> list = new List <CodeAttribute2>(); //定位自定义属性信息 foreach (CodeAttribute2 attr in property.Attributes) { list.Add(attr); } return(list); }
public static string GetInterfaceImplementation(this CodeProperty2 prop) { var g = GetInterfaceImplementation_regex.Match(prop.GetText(vsCMPart.vsCMPartHeader)).Groups["impl"]; //add space to separate if (g.Success) { return(" " + g.Value); } return(null); }
/// <summary> /// Obtains a reflection wrapper for a property. /// </summary> /// <param name="target">The property, or null if none.</param> /// <returns>The reflection wrapper, or null if none.</returns> public StaticPropertyWrapper Wrap(CodeProperty2 target) { if (target == null) { return(null); } StaticDeclaredTypeWrapper declaringType = MakeDeclaredType(GetContainingType((CodeElement)target)); return(new StaticPropertyWrapper(this, target, declaringType, declaringType)); }
private static void MakeAutoProperty(CodeProperty2 newProp) { EditPoint setter = newProp.Setter.StartPoint.CreateEditPoint(); setter.Delete(newProp.Setter.EndPoint); setter.Insert("set;"); EditPoint getter = newProp.Getter.StartPoint.CreateEditPoint(); getter.Delete(newProp.Getter.EndPoint); getter.Insert("get;"); }
void CreateCodeProperty2(string code) { AddCodeFile("class.cs", code); IProperty member = assemblyModel .TopLevelTypeDefinitions .First() .Members .First() .Resolve() as IProperty; property = new CodeProperty2(codeModelContext, member); }
public void Members_ClassHasOneProperty_ReturnsOneProperty() { CreateProjectContent(); CreatePublicClass("MyClass"); AddPropertyToClass("MyClass.MyProperty"); CodeElements codeElements = codeClass.Members; CodeProperty2 codeFunction = codeElements.FirstCodeProperty2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("MyProperty", codeFunction.Name); }
protected override object NewParameter(NewCodeElementItemParams newItemParams, string path, object value) { CodeProperty2 p2 = _property as CodeProperty2; if (null == p2) { throw new PropertyDoesNotSupportParametersException(_property.Name); } return(p2.AddParameter(path, newItemParams.MemberType, newItemParams.Position)); }
public TemplateField([NotNull] CodeProperty2 property) { Assert.ArgumentNotNull(property, nameof(property)); Property = property; Name = string.Empty; TemplateFieldItemId = ItemId.Empty; Icon = string.Empty; Type = string.Empty; Source = string.Empty; Title = string.Empty; ValidatorBar = string.Empty; }
public void Members_ClassHasOneProperty_ReturnsOneProperty() { CreateClass( "public class MyClass {\r\n" + " public int MyProperty { get; set; }\r\n" + "}"); global::EnvDTE.CodeElements codeElements = codeClass.Members; CodeProperty2 codeProperty = codeElements.FirstCodeProperty2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("MyProperty", codeProperty.Name); }
public void Members_GetFirstPropertyTwice_PropertiesAreConsideredEqualWhenAddedToList() { CreateProjectContent(); CreatePublicClass("MyClass"); helper.AddPropertyToClass("MyClass.MyProperty"); CodeProperty2 property = codeClass.Members.FirstCodeProperty2OrDefault(); var properties = new List <CodeProperty2>(); properties.Add(property); CodeProperty2 property2 = codeClass.Members.FirstCodeProperty2OrDefault(); bool contains = properties.Contains(property2); Assert.IsTrue(contains); }
public void Members_GetFirstPropertyTwice_PropertiesAreConsideredEqualWhenAddedToList() { CreateClass( "public class MyClass {\r\n" + " public int MyProperty { get; set; }\r\n" + "}"); CodeProperty2 property = codeClass.Members.FirstCodeProperty2OrDefault(); var properties = new List <CodeProperty2>(); properties.Add(property); CodeProperty2 property2 = codeClass.Members.FirstCodeProperty2OrDefault(); bool contains = properties.Contains(property2); Assert.IsTrue(contains); }
public static string GetText(this CodeProperty2 prop, vsCMPart part = vsCMPart.vsCMPartWholeWithAttributes) { try { var p = prop.GetStartPoint(part); if (p == null) { return(""); } return(p.CreateEditPoint().GetText(prop.GetEndPoint(part))); } catch (Exception ex) { if (ex is COMException || ex is NotImplementedException) { return(""); } throw; } }
/// <summary> /// Expand auto property into a normal property /// </summary> /// <param name="prop"></param> /// <param name="parentWriter"></param> /// <remarks></remarks> public void ExpandAutoProperty(CodeProperty2 prop, ManagerType.Writer parentWriter) { //Save existing elements of the property //doc comment var comment = prop.AsCodeElement().GetDocComment(); //attributes var propAttrs = prop.GetText(vsCMPart.vsCMPartAttributesWithDelimiter); //Interface implementation var interfaceImpl = prop.GetInterfaceImplementation(); var code = General.GetTemplateOutput(output => GenProperty(output, prop.Name, prop.Type.SafeFullName(), comment, propAttrs, interfaceImpl) ); var writer = new ManagerType.Writer(parentWriter) { TargetRange = new TaggedRange { SegmentType = SegmentTypes.Region }, TagNote = string.Format("{0} expanded by", prop.Name), //OptionTag, Content = code }; var text = AutoPropertyExpansionIsTagged ? writer.GenText() : code; //only do this once, since once it is expanded it will no longer be detected as auto property //Replace all code starting from comment to endPoint of the property // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags const int options = (int)(vsEPReplaceTextOptions.vsEPReplaceTextAutoformat | vsEPReplaceTextOptions.vsEPReplaceTextNormalizeNewlines); prop.GetCommentStartPoint() .CreateEditPoint() .ReplaceText(prop.EndPoint, text, options); }
private bool AddPropertyToClass(DBObjectWithType obj, CodeClass newClass, Column v) { bool failure = false; SauceClassGenerationPackage.OutputWindow.OutputStringThreadSafe(string.Format("Processing Column: {0}.{1}..{2}", obj.Object.Name, v.Name, Environment.NewLine)); TranslateResult result = TranslateToClr(v.DataType); string name = MakeLegalName(v.Name); CodeProperty2 newProp = (CodeProperty2)newClass.AddProperty(name, name, result.Type, Type.Missing, vsCMAccess.vsCMAccessPublic); MakeAutoProperty(newProp); AddDataFieldAttribute(newProp, obj.Object, v); if (!result.Success) { failure = true; SauceClassGenerationPackage.OutputWindow.OutputStringThreadSafe(string.Format("Unable to translate {0} to a CLR type for {1}.{2}", v.DataType, obj.Object.Name, v.Name)); this.InvokeOnMe(() => { SauceClassGenerationPackage.OutputWindow.Activate(); }); } return(failure); }
private CodeDomPropertyMetadata(CodeProperty2 codeProperty, CodeDomFileMetadata file) { this.codeProperty = codeProperty; this.file = file; }
internal GeneratorAttribute(CodeProperty2 p) { ParentProperty = p; Init(p.AsCodeElement()); }
/// <summary> /// /// </summary> protected virtual bool AcceptProperty(CodeProperty2 property) { return true; }
public static ITypeMetadata FromCodeElement(CodeProperty2 codeVariable, CodeDomFileMetadata file) { return GetType(codeVariable, file); }
/// <summary> /// Expand auto property into a normal property /// </summary> /// <param name="prop"></param> /// <param name="parentWriter"></param> /// <remarks></remarks> public void ExpandAutoProperty(CodeProperty2 prop, Writer parentWriter) { //Save existing doc comment var comment = prop.AsCodeElement().GetDocComment(); //Get its attribute var propAttrs = prop.GetText(vsCMPart.vsCMPartAttributesWithDelimiter); //Interface implementation var interfaceImpl = prop.GetInterfaceImplementation(); var tsWriter = new Writer(parentWriter) { SegmentType = Types.Region, TagComment = string.Format("{0} auto expanded by", prop.Name), GenAttribute = {RegenMode = GeneratorAttribute.RegenModes.Once} }; //only do this once, since once it is expanded it will no longer be detected as auto property var completeProp = GetIsolatedOutput(() => OutProperty(tsWriter.CreateTaggedRegionName(), prop.Name, prop.Type.SafeFullName(), comment, propAttrs, interfaceImpl)); //Replace all code starting from comment to endPoint of the property var ep = prop.GetCommentStartPoint().CreateEditPoint(); const int options = (int)( vsEPReplaceTextOptions.vsEPReplaceTextAutoformat | vsEPReplaceTextOptions.vsEPReplaceTextNormalizeNewlines); ep.ReplaceText(prop.EndPoint, completeProp, options); }
private void AddClassProperty(CodeElements codeElements, ref List <ClassProperty> classProperties) { foreach (CodeElement2 codeElement in codeElements) { if (codeElement.Kind == vsCMElement.vsCMElementProperty) { ClassProperty classProperty = new ClassProperty(); CodeProperty2 property = codeElement as CodeProperty2; classProperty.Name = property.Name; //获取属性类型 var propertyType = property.Type; switch (propertyType.TypeKind) { case vsCMTypeRef.vsCMTypeRefString: classProperty.PropertyType = "string"; break; case vsCMTypeRef.vsCMTypeRefInt: classProperty.PropertyType = "int"; break; case vsCMTypeRef.vsCMTypeRefLong: classProperty.PropertyType = "long"; break; case vsCMTypeRef.vsCMTypeRefByte: classProperty.PropertyType = "byte"; break; case vsCMTypeRef.vsCMTypeRefChar: classProperty.PropertyType = "char"; break; case vsCMTypeRef.vsCMTypeRefShort: classProperty.PropertyType = "short"; break; case vsCMTypeRef.vsCMTypeRefBool: classProperty.PropertyType = "bool"; break; case vsCMTypeRef.vsCMTypeRefDecimal: classProperty.PropertyType = "decimal"; break; case vsCMTypeRef.vsCMTypeRefFloat: classProperty.PropertyType = "float"; break; case vsCMTypeRef.vsCMTypeRefDouble: classProperty.PropertyType = "double"; break; default: classProperty.PropertyType = propertyType.AsFullName; break; } classProperties.Add(classProperty); } } }
/// <summary> /// /// </summary> public virtual CodePropertyInfo CreateProperty(BaseInfo parent, CodeProperty2 item) { return new CodePropertyInfo(parent, item); }
public static EnvDTE.TextPoint GetAttributeStartPoint(this CodeProperty2 prop) { return(prop.GetStartPoint()); }
internal ShellCodeProperty2(CodeProperty2 property) : base(property) { _property = property; }
public static void ShowDialog(CodeProperty2[] props) { var win = new NotifyPropertyDialog(); win.PropertyList.ItemsSource = props; }
private static void GetPropertiesInfo(CodeClass2 codeClass, string modelName, ref string sql, ref string keyConstrait, ref string descriptions) { //获取基类信息 if (codeClass.Bases.Count > 0) { var baseElements = codeClass.Bases as CodeElements; if (baseElements != null) { foreach (CodeElement2 baseEle in baseElements) { //查找命名空间 if (baseEle.Kind == vsCMElement.vsCMElementClass) { CodeClass2 clazz = baseEle as CodeClass2; GetPropertiesInfo(clazz, modelName, ref sql, ref keyConstrait, ref descriptions); } } } } //定位到属性 foreach (CodeElement prop in codeClass.Members) { if (prop.Kind == vsCMElement.vsCMElementProperty) { //去掉需要忽略的列 if (IgnoreFieldList.Any(t => t == prop.Name)) { continue; } CodeProperty2 p = prop as CodeProperty2; string rawTypeName = p.Type.AsFullName; string rawDocComment = p.DocComment; //描述信息 bool isPrimaryKey = false; //是否需要跳过 bool isSkipProperty = false; // 字段描述 string desc = ""; int maxLength = DefaultStringLength; int maxAttrLen = DefaultStringLength; int minAttrLen = DefaultStringLength; int maxStrLen = DefaultStringLength; int minStrLen = DefaultStringLength; //定位自定义属性信息 foreach (CodeAttribute2 attr in p.Attributes) { //属性是否有标记最大或者最小长度、字符串长度 if (attr.Name == "MaxLength") { //500, ErrorMessage = "最大长度是500啊" foreach (CodeAttributeArgument attrArg in attr.Arguments) { if (attrArg.Name == "" || attrArg.Name == "MaximumLength") { //第一个没有名称的参数为最大长度 maxAttrLen = Convert.ToInt32(attrArg.Value); } else if (attrArg.Name == "ErrorMessage") { //错误描述 } } } else if (attr.Name == "MinLength") { foreach (CodeAttributeArgument attrArg in attr.Arguments) { if (attrArg.Name == "" || attrArg.Name == "MinimumLength") { //第一个没有名称的参数为最小长度 minAttrLen = Convert.ToInt32(attrArg.Value); } else if (attrArg.Name == "ErrorMessage") { //错误描述 } } } else if (attr.Name == "StringLength") { foreach (CodeAttributeArgument attrArg in attr.Arguments) { if (attrArg.Name == "" || attrArg.Name == "MaximumLength") { //第一个没有名称的参数为最大长度 maxStrLen = Convert.ToInt32(attrArg.Value); } else if (attrArg.Name == "MinimumLength") { //第一个没有名称的参数为最大长度 minStrLen = Convert.ToInt32(attrArg.Value); } else if (attrArg.Name == "ErrorMessage") { //错误描述 } } } else if (attr.Name == "Display") { foreach (CodeAttributeArgument attrArg in attr.Arguments) { if (attrArg.Name == "Name") { desc = attrArg.Value.Trim('"'); break; } } } else if (IgnoreAttributeList.Any(x => x == attr.Name)) { //如果是需要忽略的字段,则跳过 isSkipProperty = true; break; } else if (attr.Name == "Key") { //如果是Key属性,则认为其是主键 isPrimaryKey = true; keyConstrait = @" CONSTRAINT [PK_" + prop.Name + @"] PRIMARY KEY CLUSTERED" + "(" + " [" + prop.Name + @"] ASC" + " )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]"; } } //如果需要跳过,则跳过 if (isSkipProperty) { continue; } //根据长度约束条件获取最大长度 maxLength = Math.Max(maxStrLen, Math.Max(minAttrLen, maxLength)); //描述信息以Display为准 desc = string.IsNullOrEmpty(desc) ? Utility.GetCommentFromXMLString(rawDocComment) : desc; desc = isPrimaryKey ? "主键 " + desc : desc; //属性名称 sql += " [" + prop.Name + "] " + GetSQLType(rawTypeName, maxLength) + "," + Environment.NewLine; //如果描述信息不为空,则添加描述信息 if (!string.IsNullOrEmpty(desc)) { descriptions += (Environment.NewLine + @"EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'" + desc + "' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'" + modelName + "', @level2type=N'COLUMN',@level2name=N'" + prop.Name + "'") + Environment.NewLine + "GO"; } } else if (prop.Kind == vsCMElement.vsCMElementVariable) { CodeVariable2 v = prop as CodeVariable2; } else { Console.WriteLine("" + prop.Kind); } } }
internal AttributeProcessor(CodeProperty2 p) { ParentProperty = p; Init(p.AsCodeElement()); }
public static ITypeMetadata FromCodeElement(CodeProperty2 codeVariable, CodeDomFileMetadata file) { return(GetType(codeVariable, file)); }
public static EditPoint GetCommentStartPoint(this CodeProperty2 ce) { return(ce.AsCodeElement().GetCommentStartPoint()); }
public NotifyPropertyChanged_GenAttribute(CodeProperty2 p) : base(p) { Init(); }
private string RenameAttr(CodeElement item) { //var sb = new StringBuilder(); //try //{ if (item.Kind == vsCMElement.vsCMElementVariable || item.Kind == vsCMElement.vsCMElementParameter || item.Kind == vsCMElement.vsCMElementProperty) { if (item.Name.Contains(alien)) { PrintDetial("AttrNameHasAlien :" + item.Name); return(""); } if (item.Name.Contains(stringThis)) { PrintDetial("AttrNameHasThis :" + item.Name); return(""); } if (item.Name.Contains(stringGlobal)) { PrintDetial("GlobalAttr :" + item.Name); return(""); } if (interFaceFunction.Contains(item.Name)) { PrintDetial("InterFaceAttr :" + item.Name); return(""); } CodeProperty2 CodeProperty = item as CodeProperty2; if (CodeProperty != null && CodeProperty.OverrideKind != null && (CodeProperty.OverrideKind == vsCMOverrideKind.vsCMOverrideKindOverride || CodeProperty.OverrideKind == vsCMOverrideKind.vsCMOverrideKindNew || CodeProperty.OverrideKind == vsCMOverrideKind.vsCMOverrideKindAbstract || CodeProperty.OverrideKind == vsCMOverrideKind.vsCMOverrideKindVirtual)) { PrintDetial("AttrIsSpecial :" + item.Name); return(""); } CodeVariable2 codeVariable = item as CodeVariable2; if ((CodeProperty != null && CodeProperty.IsShared) || (codeVariable != null && codeVariable.IsShared)) { PrintDetial("StaticAttr :" + item.Name); return(""); } try { CodeElement2 code2 = item as CodeElement2; var one = nameCounter++; var alien2 = alien + nameCounter++; var three = nameCounter++; PrintDetial("RenameAttribute :" + item.Name); var randomOne = GetRandomName(3, 5, useUpper: true); var randomThree = GetRandomName(3, 5, useUpper: true); var replacement = string.Format("{0}{1}{2}{3}{4}", randomOne, one, item.Name.Insert(item.Name.Length / 2, alien2), randomThree, three); code2.RenameSymbol(replacement); } catch (Exception ex) { except += " error: " + ex.Message + "\n" + item.Name; PrintProperty2Info(CodeProperty); } //sb += (" " + code.Name + " " + code.IsCodeType + " " + code.Kind + "\n"); } else { } return(""); }