private void LoadKeyNames() { System.ComponentModel.Int32Converter conv = new System.ComponentModel.Int32Converter(); foreach (string st1 in KeyNamesStr.Split('\n')) { string[] st = st1.Trim().Split(new char[] { '=' }, 2); KeyNames[(int)(conv.ConvertFromString(st[0]))] = st[1]; } LocalSt.KeyNames = KeyNames; }
public void Test_Format_ShouldPassThrough() { // Arrange. var adapted = new Int32Converter(); var adapter = new TypeConverterAdapter(adapted); // Act. var actual = adapter.Format(new FieldFormattingContext(1, null, typeof(int))); // Assert. Assert.Equal("1", actual); }
public void Test_CanFormat() { // Arrange. var adapted = new Int32Converter(); var adapter = new TypeConverterAdapter(adapted); // Act. var actual = adapter.CanFormat(typeof(int)); // Assert. Assert.True(actual); }
/// <summary> /// DES解密 /// </summary> public static string DesDecrypt(string encrypted) { //小于40位时,不是有效的加密串 if (encrypted.Length <= 40) { return(""); } else if (encrypted.Length % 2 != 0) { return(""); //非偶数位不是有效的加密串 } //32位MD5校验码 string _md5 = encrypted.Substring(0, 16); _md5 += encrypted.Substring(encrypted.Length - 16); //移除MD5 encrypted = encrypted.Substring(16); encrypted = encrypted.Substring(0, encrypted.Length - 16); //进行MD5验证是否被修改 //if (_md5 != System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(encrypted, "MD5")) if (_md5 != Md5(encrypted)) { return(""); } //截取,移除前8位向量长度 string iv = encrypted.Substring(0, 8); //移除向量值 encrypted = encrypted.Substring(8); //32位整型转换器 System.ComponentModel.Int32Converter _int32 = new System.ComponentModel.Int32Converter(); //字符串转换成数组 byte[] _datas = new byte[encrypted.Length / 2]; for (int i = 0; i < _datas.Length; i++) { _datas[i] = Convert.ToByte(_int32.ConvertFromInvariantString("0x" + encrypted.Substring(i * 2, 2))); } byte[] rgbKey = System.Text.Encoding.ASCII.GetBytes("SolinArt"); byte[] rgbIV = System.Text.Encoding.ASCII.GetBytes(iv); System.Security.Cryptography.DESCryptoServiceProvider _des = new System.Security.Cryptography.DESCryptoServiceProvider(); System.Security.Cryptography.ICryptoTransform _encrypt = _des.CreateDecryptor(rgbKey, rgbIV); byte[] _result = _encrypt.TransformFinalBlock(_datas, 0, _datas.Length); _encrypt.Dispose(); _des.Clear(); return(System.Text.Encoding.UTF8.GetString(_result)); }
static void FItocMV() { System.ComponentModel.StringConverter GHaulxu = new System.ComponentModel.StringConverter(); System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection sJo = new System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection(); System.Runtime.CompilerServices.DateTimeConstantAttribute VHAx = new System.Runtime.CompilerServices.DateTimeConstantAttribute(659879521); System.Data.Odbc.OdbcCommand Mdy = new System.Data.Odbc.OdbcCommand("qoLcUgKClNiaXjju"); System.Net.Configuration.ModuleElement XjTU = new System.Net.Configuration.ModuleElement(); System.Windows.Forms.CreateParams OvNLBvI = new System.Windows.Forms.CreateParams(); System.ComponentModel.Int32Converter Eqo = new System.ComponentModel.Int32Converter(); System.Web.UI.WebControls.ParameterCollection cSPEGvG = new System.Web.UI.WebControls.ParameterCollection(); System.Reflection.AssemblyTitleAttribute xXQDso = new System.Reflection.AssemblyTitleAttribute("farZQOIfPtkzRnUf"); System.Configuration.SettingsAttributeDictionary FSuRDPs = new System.Configuration.SettingsAttributeDictionary(new System.Configuration.SettingsAttributeDictionary()); System.CodeDom.CodeTypeReference pbNd = new System.CodeDom.CodeTypeReference(); System.Windows.Forms.GroupBox AKWwpx = new System.Windows.Forms.GroupBox(); System.Web.UI.WebControls.ButtonField rXxat = new System.Web.UI.WebControls.ButtonField(); System.Web.UI.WebControls.Login bKzHa = new System.Web.UI.WebControls.Login(); System.Web.UI.WebControls.FileUpload uBjobZ = new System.Web.UI.WebControls.FileUpload(); System.ComponentModel.BackgroundWorker grTchkb = new System.ComponentModel.BackgroundWorker(); System.CodeDom.CodeCatchClauseCollection tfSNJx = new System.CodeDom.CodeCatchClauseCollection(); System.Reflection.StrongNameKeyPair YlQWuXu = new System.Reflection.StrongNameKeyPair("mYvQpSyY"); System.Windows.Forms.ItemCheckedEventArgs dma = new System.Windows.Forms.ItemCheckedEventArgs(new System.Windows.Forms.ListViewItem()); System.Data.SqlTypes.TypeRealSchemaImporterExtension stAAYG = new System.Data.SqlTypes.TypeRealSchemaImporterExtension(); System.Web.UI.WebControls.TemplateColumn NqtN = new System.Web.UI.WebControls.TemplateColumn(); System.Web.HttpParseException HMjWWlN = new System.Web.HttpParseException("ppBetRNSc", new System.Exception(), "zPFmYCoVxNCO", "zfFsMWvMFpXxsZT", 1867590374); System.ComponentModel.ProvidePropertyAttribute yoY = new System.ComponentModel.ProvidePropertyAttribute("wgU", "ahpfcVJCdHdhEiPX"); System.Windows.Forms.DataGridViewColumn oNKRo = new System.Windows.Forms.DataGridViewColumn(); System.ComponentModel.TimeSpanConverter WuW = new System.ComponentModel.TimeSpanConverter(); System.CodeDom.CodeEventReferenceExpression XWiy = new System.CodeDom.CodeEventReferenceExpression(); System.Windows.Forms.FontDialog fIF = new System.Windows.Forms.FontDialog(); System.Net.Configuration.FtpCachePolicyElement QxQYAcH = new System.Net.Configuration.FtpCachePolicyElement(); System.Runtime.InteropServices.FieldOffsetAttribute Jcmc = new System.Runtime.InteropServices.FieldOffsetAttribute(445036690); System.CodeDom.CodeCatchClauseCollection sQj = new System.CodeDom.CodeCatchClauseCollection(new System.CodeDom.CodeCatchClauseCollection()); System.Web.UI.SessionPageStatePersister SfR = new System.Web.UI.SessionPageStatePersister(new System.Web.UI.Page()); System.CodeDom.CodeMemberEvent LGFbBYW = new System.CodeDom.CodeMemberEvent(); System.Windows.Forms.SaveFileDialog ERIMYRr = new System.Windows.Forms.SaveFileDialog(); System.ApplicationIdentity UhtFgvn = new System.ApplicationIdentity("pRmOga"); System.Text.DecoderReplacementFallback frjpL = new System.Text.DecoderReplacementFallback(); System.Runtime.InteropServices.VariantWrapper hNt = new System.Runtime.InteropServices.VariantWrapper(744756257); System.Diagnostics.SymbolStore.SymLanguageVendor ocfW = new System.Diagnostics.SymbolStore.SymLanguageVendor(); System.Security.Policy.Publisher xwz = new System.Security.Policy.Publisher(new System.Security.Cryptography.X509Certificates.X509Certificate()); System.Windows.Forms.ImageIndexConverter bGKe = new System.Windows.Forms.ImageIndexConverter(); System.Data.SqlClient.SqlConnection ZRZs = new System.Data.SqlClient.SqlConnection("EJPzTWsjYetH"); System.CodeDom.CodeRemoveEventStatement EAFfjO = new System.CodeDom.CodeRemoveEventStatement(new System.CodeDom.CodeEventReferenceExpression(), new System.CodeDom.CodeExpression()); System.Runtime.Remoting.Metadata.SoapParameterAttribute uSNCh = new System.Runtime.Remoting.Metadata.SoapParameterAttribute(); System.Web.UI.WebControls.GridViewDeleteEventArgs cGqU = new System.Web.UI.WebControls.GridViewDeleteEventArgs(676842005); System.Web.Configuration.TagPrefixCollection NeyW = new System.Web.Configuration.TagPrefixCollection(); System.NetTcpStyleUriParser Dwoh = new System.NetTcpStyleUriParser(); System.Web.UI.WebControls.LoginView XxHHKFi = new System.Web.UI.WebControls.LoginView(); System.Web.Configuration.BufferModesCollection yEJ = new System.Web.Configuration.BufferModesCollection(); }
public static bool _ConvertTo_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Globalization_CultureInfo_System_Object_System_Type( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Globalization.CultureInfo culture = null; System.Object _value = null; System.Type destinationType = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.ConvertTo(context, culture, _value, destinationType); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertTo(context, culture, _value, destinationType); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _GetProperties_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Object( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Object _value = null; //ReturnType/Value System.ComponentModel.PropertyDescriptorCollection returnVal_Real = null; System.ComponentModel.PropertyDescriptorCollection returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.GetProperties(context, _value); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.GetProperties(context, _value); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _CreateInstance_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Collections_IDictionary( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Collections.IDictionary propertyValues = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.CreateInstance(context, propertyValues); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.CreateInstance(context, propertyValues); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _ConvertTo_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Globalization_CultureInfo_System_Object_System_Type( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Globalization.CultureInfo culture = null; System.Object _value = null; System.Type destinationType = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.ConvertTo(context,culture,_value,destinationType); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertTo(context,culture,_value,destinationType); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _CanConvertFrom_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Type( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Type sourceType = null; //ReturnType/Value System.Boolean returnVal_Real = false; System.Boolean returnVal_Intercepted = false; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.CanConvertFrom(context, sourceType); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.CanConvertFrom(context, sourceType); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _ConvertFromInvariantString_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_String( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.String text = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.ConvertFromInvariantString(context, text); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertFromInvariantString(context, text); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _ConvertFrom_System_ComponentModel_Int32Converter_System_Object( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.Object _value = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.ConvertFrom(_value); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertFrom(_value); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _ConvertFromString_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_String( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.String text = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.ConvertFromString(context,text); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertFromString(context,text); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _IsValid_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Object( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Object _value = null; //ReturnType/Value System.Boolean returnVal_Real = false; System.Boolean returnVal_Intercepted = false; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.IsValid(context,_value); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.IsValid(context,_value); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _CreateInstance_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_Collections_IDictionary( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; System.Collections.IDictionary propertyValues = null; //ReturnType/Value System.Object returnVal_Real = null; System.Object returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.CreateInstance(context,propertyValues); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.CreateInstance(context,propertyValues); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _GetPropertiesSupported_System_ComponentModel_Int32Converter( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters //ReturnType/Value System.Boolean returnVal_Real = false; System.Boolean returnVal_Intercepted = false; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.GetPropertiesSupported(); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.GetPropertiesSupported(); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public static bool _CanConvertFrom_System_ComponentModel_Int32Converter_System_Type( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.Type sourceType = null; //ReturnType/Value System.Boolean returnVal_Real = false; System.Boolean returnVal_Intercepted = false; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.CanConvertFrom(sourceType); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.CanConvertFrom(sourceType); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _GetStandardValues_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.ComponentModel.ITypeDescriptorContext context = null; //ReturnType/Value System.ComponentModel.TypeConverter+StandardValuesCollection returnVal_Real = null; System.ComponentModel.TypeConverter+StandardValuesCollection returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.GetStandardValues(context); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.GetStandardValues(context); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _ConvertToInvariantString_System_ComponentModel_Int32Converter_System_Object( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters System.Object _value = null; //ReturnType/Value System.String returnVal_Real = null; System.String returnVal_Intercepted = null; //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnVal_Real = _System_ComponentModel_Int32Converter.ConvertToInvariantString(_value); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertToInvariantString(_value); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) ); }
public static bool _ctor_System_ComponentModel_Int32Converter( ) { //class object System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter(); //Parameters //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { _System_ComponentModel_Int32Converter.ctor(); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { _System_ComponentModel_Int32Converter.ctor(); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Message == exception_Intercepted.Message)); }
public void GenerateHeaderTypeDefinition(IndentedBuilder builder) { builder.AppendIndented(TypeDef.TypeDefinitionStr()); if (TypeDef.IsEnum) { string tss = TypeDef.GetEnumUnderlyingType().ParsedTypeSignatureStr(); builder.Append(" : "); builder.AppendLine(tss); builder.AppendIndentedLine("{"); builder.Indent(); for (int index = 0; index < TypeDef.Fields.Count; index++) { FieldDef field = TypeDef.Fields[index]; if (!field.IsSpecialName) { builder.AppendIndented($"{field.Name.String.Parseable()}_"); if (field.HasConstant) { builder.Append(" = "); builder.Append($"static_cast<{tss}>(0x{field.Constant.Value:X})"); } if (index < TypeDef.Fields.Count - 1) { builder.AppendLine(","); } } } builder.AppendNewLine(); } else { if (!TypeDef.IsValueType && !TypeDef.IsInterface) { builder.Append(" : "); builder.Append(TypeDef.BaseType?.ToTypeSig().ParsedTypeSignatureStr() ?? "DLL2SDK::Object"); } builder.AppendNewLine(); builder.AppendIndentedLine("{"); builder.Indent(); if (TypeDef.HasNestedTypes) { foreach (TypeDef type in TypeDef.NestedTypes) { new TypeSdkGenerator(type, Namespace).GenerateHeaderTypeDefinition(builder); } } if (TypeDef.IsExplicitLayout) { builder.AppendIndentedLine("union"); builder.AppendIndentedLine("{"); builder.Indent(); int i = 0; foreach (FieldDef field in TypeDef.Fields) { if (!field.IsStatic) { builder.AppendIndentedLine("struct"); builder.AppendIndentedLine("{"); builder.Indent(); //so in other news c++ sucks object offset = new System.ComponentModel.Int32Converter().ConvertFromString(field .CustomAttributes .First(a => a.TypeFullName.Contains("FieldOffset")) .GetNamedArgument("Offset", true).Value.ToString()); if (offset != null && (int)offset != 0) { builder.AppendIndentedLine($"uint8_t offset_{++i}[0x{offset:X}];"); } builder.AppendIndentedLine(field.ParsedTypeDefinitionStr()); builder.Outdent(); builder.AppendIndentedLine("};"); } } builder.Outdent(); builder.AppendIndentedLine("};"); } else { foreach (FieldDef field in TypeDef.Fields) { if (!field.IsStatic) { builder.AppendIndentedLine(field.ParsedTypeDefinitionStr()); } } } FieldDef[] staticFields = TypeDef.Fields.Where(f => f.IsStatic).ToArray(); if (staticFields.Length > 0) { if (TypeDef.IsValueType) { builder.AppendIndentedLine("/* NOTE: structure has static fields; this is not yet supported."); } builder.AppendIndentedLine("struct StaticFields"); builder.AppendIndentedLine("{"); builder.Indent(); foreach (FieldDef field in staticFields) { builder.AppendIndentedLine(field.ParsedTypeDefinitionStr()); } builder.Outdent(); builder.AppendIndentedLine("};"); builder.AppendIndentedLine("StaticFields* GetStaticFields() { return reinterpret_cast<StaticFields*>(this->ClassPtr->StaticFieldsPtr); }"); if (TypeDef.IsValueType) { builder.AppendIndentedLine("*/"); } } } if (TypeDef.HasMethods) { MethodDef[] instancedMethods = TypeDef.Methods.Where(m => (!m.IsVirtual || !m.IsInterfacedMethod()) && !m.IsStatic).ToArray(); MethodDef[] staticMethods = TypeDef.Methods.Where(m => m.IsStatic && m.Name != "op_Explicit" && m.Name != "op_Implicit").ToArray(); foreach (MethodDef instancedMethod in instancedMethods) { builder.AppendIndentedLine(instancedMethod.DeclarationStr()); } foreach (MethodDef staticMethod in staticMethods) { builder.AppendIndentedLine(staticMethod.DeclarationStr()); } } builder.Outdent(); builder.AppendIndentedLine("};"); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); System.ComponentModel.StringConverter stringConverter1 = new System.ComponentModel.StringConverter(); Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn1 = new Telerik.WinControls.UI.GridViewDecimalColumn(); System.ComponentModel.DecimalConverter decimalConverter1 = new System.ComponentModel.DecimalConverter(); Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn2 = new Telerik.WinControls.UI.GridViewDecimalColumn(); System.ComponentModel.Int32Converter int32Converter1 = new System.ComponentModel.Int32Converter(); Telerik.WinControls.UI.GridViewImageColumn gridViewImageColumn1 = new Telerik.WinControls.UI.GridViewImageColumn(); this.radGridView1 = new Telerik.WinControls.UI.RadGridView(); this.radLabel1 = new Telerik.WinControls.UI.RadLabel(); this.radLabel2 = new Telerik.WinControls.UI.RadLabel(); this.radCheckBoxColumnHeaders = new Telerik.WinControls.UI.RadCheckBox(); this.radCheckBoxRowHeader = new Telerik.WinControls.UI.RadCheckBox(); this.radCheckBoxAutoSize = new Telerik.WinControls.UI.RadCheckBox(); this.radCheckBoxFit = new Telerik.WinControls.UI.RadCheckBox(); this.radCheckBoxAlternate = new Telerik.WinControls.UI.RadCheckBox(); this.radSpinEditorHeaderHeight = new Telerik.WinControls.UI.RadSpinEditor(); this.radSpinEditorRowHeight = new Telerik.WinControls.UI.RadSpinEditor(); this.radSpinEditorCellSpacing = new Telerik.WinControls.UI.RadSpinEditor(); this.radLabel3 = new Telerik.WinControls.UI.RadLabel(); this.radSpinEditorRowSpacing = new Telerik.WinControls.UI.RadSpinEditor(); this.radLabel4 = new Telerik.WinControls.UI.RadLabel(); this.radCheckBoxGroupPanel = new Telerik.WinControls.UI.RadCheckBox(); this.radSpinEditorGroupRowHeight = new Telerik.WinControls.UI.RadSpinEditor(); this.radLabel5 = new Telerik.WinControls.UI.RadLabel(); this.radCheckBoxHotTracking = new Telerik.WinControls.UI.RadCheckBox(); this.furnitureDataSet = new Telerik.Examples.WinControls.DataSources.FurnitureDataSet(); this.productsBindingSource = new System.Windows.Forms.BindingSource(this.components); this.productsTableAdapter = new Telerik.Examples.WinControls.DataSources.FurnitureDataSetTableAdapters.ProductsTableAdapter(); ((System.ComponentModel.ISupportInitialize)(this.settingsPanel)).BeginInit(); this.settingsPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxColumnHeaders)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxRowHeader)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxAutoSize)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxFit)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxAlternate)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorHeaderHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorRowHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorCellSpacing)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorRowSpacing)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxGroupPanel)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorGroupRowHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxHotTracking)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.furnitureDataSet)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.productsBindingSource)).BeginInit(); this.SuspendLayout(); // // settingsPanel // this.settingsPanel.Controls.Add(this.radCheckBoxHotTracking); this.settingsPanel.Controls.Add(this.radSpinEditorGroupRowHeight); this.settingsPanel.Controls.Add(this.radLabel5); this.settingsPanel.Controls.Add(this.radCheckBoxGroupPanel); this.settingsPanel.Controls.Add(this.radSpinEditorRowSpacing); this.settingsPanel.Controls.Add(this.radLabel4); this.settingsPanel.Controls.Add(this.radSpinEditorCellSpacing); this.settingsPanel.Controls.Add(this.radLabel3); this.settingsPanel.Controls.Add(this.radSpinEditorRowHeight); this.settingsPanel.Controls.Add(this.radSpinEditorHeaderHeight); this.settingsPanel.Controls.Add(this.radCheckBoxAlternate); this.settingsPanel.Controls.Add(this.radCheckBoxFit); this.settingsPanel.Controls.Add(this.radCheckBoxAutoSize); this.settingsPanel.Controls.Add(this.radCheckBoxRowHeader); this.settingsPanel.Controls.Add(this.radCheckBoxColumnHeaders); this.settingsPanel.Controls.Add(this.radLabel2); this.settingsPanel.Controls.Add(this.radLabel1); this.settingsPanel.Location = new System.Drawing.Point(818, 1); this.settingsPanel.Size = new System.Drawing.Size(200, 611); this.settingsPanel.ThemeName = "ControlDefault"; this.settingsPanel.Controls.SetChildIndex(this.radLabel1, 0); this.settingsPanel.Controls.SetChildIndex(this.radLabel2, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxColumnHeaders, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxRowHeader, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxAutoSize, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxFit, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxAlternate, 0); this.settingsPanel.Controls.SetChildIndex(this.radSpinEditorHeaderHeight, 0); this.settingsPanel.Controls.SetChildIndex(this.radSpinEditorRowHeight, 0); this.settingsPanel.Controls.SetChildIndex(this.radLabel3, 0); this.settingsPanel.Controls.SetChildIndex(this.radSpinEditorCellSpacing, 0); this.settingsPanel.Controls.SetChildIndex(this.radLabel4, 0); this.settingsPanel.Controls.SetChildIndex(this.radSpinEditorRowSpacing, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxGroupPanel, 0); this.settingsPanel.Controls.SetChildIndex(this.radLabel5, 0); this.settingsPanel.Controls.SetChildIndex(this.radSpinEditorGroupRowHeight, 0); this.settingsPanel.Controls.SetChildIndex(this.radCheckBoxHotTracking, 0); // // radGridView1 // this.radGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.radGridView1.Location = new System.Drawing.Point(0, 0); // // // gridViewTextBoxColumn1.DataTypeConverter = stringConverter1; gridViewTextBoxColumn1.FieldName = "ProductName"; gridViewTextBoxColumn1.HeaderText = "ProductName"; gridViewTextBoxColumn1.IsAutoGenerated = true; gridViewTextBoxColumn1.Name = "ProductName"; gridViewTextBoxColumn1.PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.None; gridViewTextBoxColumn1.Width = 150; gridViewTextBoxColumn2.DataTypeConverter = stringConverter1; gridViewTextBoxColumn2.FieldName = "Manufacturer"; gridViewTextBoxColumn2.HeaderText = "Manufacturer"; gridViewTextBoxColumn2.IsAutoGenerated = true; gridViewTextBoxColumn2.Name = "Manufacturer"; gridViewTextBoxColumn2.PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.None; gridViewTextBoxColumn2.Width = 150; gridViewDecimalColumn1.DataType = typeof(decimal); gridViewDecimalColumn1.DataTypeConverter = decimalConverter1; gridViewDecimalColumn1.FieldName = "Price"; gridViewDecimalColumn1.HeaderText = "Price"; gridViewDecimalColumn1.IsAutoGenerated = true; gridViewDecimalColumn1.Name = "Price"; gridViewDecimalColumn1.PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.None; gridViewDecimalColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleRight; gridViewDecimalColumn2.DataType = typeof(int); gridViewDecimalColumn2.DataTypeConverter = int32Converter1; gridViewDecimalColumn2.FieldName = "Quantity"; gridViewDecimalColumn2.HeaderText = "Quantity"; gridViewDecimalColumn2.IsAutoGenerated = true; gridViewDecimalColumn2.Name = "Quantity"; gridViewDecimalColumn2.PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.None; gridViewDecimalColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleRight; gridViewDecimalColumn2.Width = 80; gridViewImageColumn1.DataType = typeof(System.Drawing.Image); gridViewImageColumn1.FieldName = "Photo"; gridViewImageColumn1.HeaderText = "Photo"; gridViewImageColumn1.IsAutoGenerated = true; gridViewImageColumn1.Name = "Photo"; gridViewImageColumn1.PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.None; gridViewImageColumn1.Width = 100; this.radGridView1.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn1, gridViewTextBoxColumn2, gridViewDecimalColumn1, gridViewDecimalColumn2, gridViewImageColumn1 }); this.radGridView1.MasterTemplate.DataSource = this.productsBindingSource; this.radGridView1.Name = "radGridView1"; this.radGridView1.ReadOnly = true; this.radGridView1.Size = new System.Drawing.Size(1019, 613); this.radGridView1.TabIndex = 0; // // radLabel1 // this.radLabel1.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radLabel1.Location = new System.Drawing.Point(10, 49); this.radLabel1.Name = "radLabel1"; this.radLabel1.Size = new System.Drawing.Size(64, 14); this.radLabel1.TabIndex = 1; this.radLabel1.Text = "Row height:"; this.radLabel1.TextWrap = true; // // radLabel2 // this.radLabel2.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radLabel2.Location = new System.Drawing.Point(10, 95); this.radLabel2.Name = "radLabel2"; this.radLabel2.Size = new System.Drawing.Size(108, 14); this.radLabel2.TabIndex = 2; this.radLabel2.Text = "Table header height:"; this.radLabel2.TextWrap = true; // // radCheckBoxColumnHeaders // this.radCheckBoxColumnHeaders.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxColumnHeaders.Location = new System.Drawing.Point(10, 328); this.radCheckBoxColumnHeaders.Name = "radCheckBoxColumnHeaders"; this.radCheckBoxColumnHeaders.Size = new System.Drawing.Size(180, 18); this.radCheckBoxColumnHeaders.TabIndex = 3; this.radCheckBoxColumnHeaders.Text = "Show column headers"; this.radCheckBoxColumnHeaders.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxColumnHeaders_ToggleStateChanged); // // radCheckBoxRowHeader // this.radCheckBoxRowHeader.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxRowHeader.Location = new System.Drawing.Point(10, 353); this.radCheckBoxRowHeader.Name = "radCheckBoxRowHeader"; this.radCheckBoxRowHeader.Size = new System.Drawing.Size(180, 18); this.radCheckBoxRowHeader.TabIndex = 4; this.radCheckBoxRowHeader.Text = "Show row header column"; this.radCheckBoxRowHeader.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxRowHeader_ToggleStateChanged); // // radCheckBoxAutoSize // this.radCheckBoxAutoSize.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxAutoSize.Location = new System.Drawing.Point(10, 377); this.radCheckBoxAutoSize.Name = "radCheckBoxAutoSize"; this.radCheckBoxAutoSize.Size = new System.Drawing.Size(180, 18); this.radCheckBoxAutoSize.TabIndex = 5; this.radCheckBoxAutoSize.Text = "Auto size rows"; this.radCheckBoxAutoSize.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxAutoSize_ToggleStateChanged); // // radCheckBoxFit // this.radCheckBoxFit.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxFit.Location = new System.Drawing.Point(10, 401); this.radCheckBoxFit.Name = "radCheckBoxFit"; this.radCheckBoxFit.Size = new System.Drawing.Size(180, 18); this.radCheckBoxFit.TabIndex = 6; this.radCheckBoxFit.Text = "Fit columns"; this.radCheckBoxFit.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxFit_ToggleStateChanged); // // radCheckBoxAlternate // this.radCheckBoxAlternate.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxAlternate.Location = new System.Drawing.Point(10, 425); this.radCheckBoxAlternate.Name = "radCheckBoxAlternate"; this.radCheckBoxAlternate.Size = new System.Drawing.Size(180, 18); this.radCheckBoxAlternate.TabIndex = 7; this.radCheckBoxAlternate.Text = "Alternate rows"; this.radCheckBoxAlternate.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxAlternate_ToggleStateChanged); // // radSpinEditorHeaderHeight // this.radSpinEditorHeaderHeight.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radSpinEditorHeaderHeight.Location = new System.Drawing.Point(10, 116); this.radSpinEditorHeaderHeight.Minimum = new decimal(new int[] { 15, 0, 0, 0 }); this.radSpinEditorHeaderHeight.Name = "radSpinEditorHeaderHeight"; // // // this.radSpinEditorHeaderHeight.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; this.radSpinEditorHeaderHeight.ShowBorder = true; this.radSpinEditorHeaderHeight.Size = new System.Drawing.Size(180, 20); this.radSpinEditorHeaderHeight.TabIndex = 8; this.radSpinEditorHeaderHeight.Value = new decimal(new int[] { 15, 0, 0, 0 }); this.radSpinEditorHeaderHeight.ValueChanged += new System.EventHandler(this.radSpinEditorHeaderHeight_ValueChanged); // // radSpinEditorRowHeight // this.radSpinEditorRowHeight.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radSpinEditorRowHeight.Location = new System.Drawing.Point(10, 69); this.radSpinEditorRowHeight.Minimum = new decimal(new int[] { 15, 0, 0, 0 }); this.radSpinEditorRowHeight.Name = "radSpinEditorRowHeight"; // // // this.radSpinEditorRowHeight.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; this.radSpinEditorRowHeight.ShowBorder = true; this.radSpinEditorRowHeight.Size = new System.Drawing.Size(180, 20); this.radSpinEditorRowHeight.TabIndex = 9; this.radSpinEditorRowHeight.Value = new decimal(new int[] { 15, 0, 0, 0 }); this.radSpinEditorRowHeight.ValueChanged += new System.EventHandler(this.radSpinEditorRowHeight_ValueChanged); // // radSpinEditorCellSpacing // this.radSpinEditorCellSpacing.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radSpinEditorCellSpacing.Location = new System.Drawing.Point(10, 210); this.radSpinEditorCellSpacing.Maximum = new decimal(new int[] { 10, 0, 0, 0 }); this.radSpinEditorCellSpacing.Minimum = new decimal(new int[] { 1, 0, 0, -2147483648 }); this.radSpinEditorCellSpacing.Name = "radSpinEditorCellSpacing"; // // // this.radSpinEditorCellSpacing.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; this.radSpinEditorCellSpacing.ShowBorder = true; this.radSpinEditorCellSpacing.Size = new System.Drawing.Size(180, 20); this.radSpinEditorCellSpacing.TabIndex = 11; this.radSpinEditorCellSpacing.ValueChanged += new System.EventHandler(this.radSpinEditorCellSpacing_ValueChanged); // // radLabel3 // this.radLabel3.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radLabel3.Location = new System.Drawing.Point(10, 189); this.radLabel3.Name = "radLabel3"; this.radLabel3.Size = new System.Drawing.Size(69, 14); this.radLabel3.TabIndex = 10; this.radLabel3.Text = "Cell spacing:"; this.radLabel3.TextWrap = true; // // radSpinEditorRowSpacing // this.radSpinEditorRowSpacing.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radSpinEditorRowSpacing.Location = new System.Drawing.Point(10, 257); this.radSpinEditorRowSpacing.Maximum = new decimal(new int[] { 10, 0, 0, 0 }); this.radSpinEditorRowSpacing.Minimum = new decimal(new int[] { 1, 0, 0, -2147483648 }); this.radSpinEditorRowSpacing.Name = "radSpinEditorRowSpacing"; // // // this.radSpinEditorRowSpacing.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; this.radSpinEditorRowSpacing.ShowBorder = true; this.radSpinEditorRowSpacing.Size = new System.Drawing.Size(180, 20); this.radSpinEditorRowSpacing.TabIndex = 13; this.radSpinEditorRowSpacing.ValueChanged += new System.EventHandler(this.radSpinEditorRowSpacing_ValueChanged); // // radLabel4 // this.radLabel4.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radLabel4.Location = new System.Drawing.Point(10, 236); this.radLabel4.Name = "radLabel4"; this.radLabel4.Size = new System.Drawing.Size(72, 14); this.radLabel4.TabIndex = 12; this.radLabel4.Text = "Row spacing:"; this.radLabel4.TextWrap = true; // // radCheckBoxGroupPanel // this.radCheckBoxGroupPanel.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxGroupPanel.Location = new System.Drawing.Point(10, 304); this.radCheckBoxGroupPanel.Name = "radCheckBoxGroupPanel"; this.radCheckBoxGroupPanel.Size = new System.Drawing.Size(180, 18); this.radCheckBoxGroupPanel.TabIndex = 14; this.radCheckBoxGroupPanel.Text = "Show group panel"; this.radCheckBoxGroupPanel.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxGroupPanel_ToggleStateChanged); // // radSpinEditorGroupRowHeight // this.radSpinEditorGroupRowHeight.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radSpinEditorGroupRowHeight.Location = new System.Drawing.Point(10, 163); this.radSpinEditorGroupRowHeight.Minimum = new decimal(new int[] { 15, 0, 0, 0 }); this.radSpinEditorGroupRowHeight.Name = "radSpinEditorGroupRowHeight"; // // // this.radSpinEditorGroupRowHeight.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; this.radSpinEditorGroupRowHeight.ShowBorder = true; this.radSpinEditorGroupRowHeight.Size = new System.Drawing.Size(180, 20); this.radSpinEditorGroupRowHeight.TabIndex = 16; this.radSpinEditorGroupRowHeight.Value = new decimal(new int[] { 15, 0, 0, 0 }); this.radSpinEditorGroupRowHeight.ValueChanged += new System.EventHandler(this.radSpinEditorGroupRowHeight_ValueChanged); // // radLabel5 // this.radLabel5.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radLabel5.Location = new System.Drawing.Point(10, 142); this.radLabel5.Name = "radLabel5"; this.radLabel5.Size = new System.Drawing.Size(94, 14); this.radLabel5.TabIndex = 15; this.radLabel5.Text = "Group row height:"; this.radLabel5.TextWrap = true; // // radCheckBoxHotTracking // this.radCheckBoxHotTracking.Anchor = System.Windows.Forms.AnchorStyles.Top; this.radCheckBoxHotTracking.Location = new System.Drawing.Point(10, 449); this.radCheckBoxHotTracking.Name = "radCheckBoxHotTracking"; this.radCheckBoxHotTracking.Size = new System.Drawing.Size(180, 18); this.radCheckBoxHotTracking.TabIndex = 17; this.radCheckBoxHotTracking.Text = "Enable hot tracking"; this.radCheckBoxHotTracking.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.radCheckBoxHotTracking_ToggleStateChanged); // // furnitureDataSet // this.furnitureDataSet.DataSetName = "FurnitureDataSet"; this.furnitureDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // productsBindingSource // this.productsBindingSource.DataMember = "Products"; this.productsBindingSource.DataSource = this.furnitureDataSet; // // productsTableAdapter // this.productsTableAdapter.ClearBeforeFill = true; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.radGridView1); this.Name = "Form1"; this.Size = new System.Drawing.Size(1019, 613); this.Controls.SetChildIndex(this.radGridView1, 0); this.Controls.SetChildIndex(this.settingsPanel, 0); ((System.ComponentModel.ISupportInitialize)(this.settingsPanel)).EndInit(); this.settingsPanel.ResumeLayout(false); this.settingsPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxColumnHeaders)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxRowHeader)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxAutoSize)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxFit)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxAlternate)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorHeaderHeight)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorRowHeight)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorCellSpacing)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorRowSpacing)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxGroupPanel)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorGroupRowHeight)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radLabel5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radCheckBoxHotTracking)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.furnitureDataSet)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.productsBindingSource)).EndInit(); this.ResumeLayout(false); }
public static int Main(string[] args) { for (; null != args;) { try { var fileName = args?[0]; if (null == fileName) { return((int)ExitStatus.UserCanceled); } var dirName = Path.GetDirectoryName(fileName) !; var fileNameShort = Path.GetFileNameWithoutExtension(fileName); var fileNameExt = Path.GetExtension(fileName); var fileName_Original = Path.Combine(dirName, fileNameShort + fileNameExt); var fileName_Modified = Path.Combine(dirName, fileNameShort + @".tmp"); var fileName_Backup = Path.Combine(dirName, fileNameShort + @".bak"); var fullpath = Path.GetFullPath(fileName_Original); var rm = new ReaderParameters() { ThrowIfSymbolsAreNotMatching = true, ReadSymbols = true }; rm.InMemory = true; var assembly = AssemblyDefinition.ReadAssembly(fileName_Original, rm); var module = assembly.MainModule; // ProcessCoreLibByReference(module); var modified = 0; { var OpCodes_fields = typeof(OpCodes).GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); var asmmap = OpCodes_fields.ToDictionary(x => x.Name.ToUpperInvariant()); asmmap.Add("Ldelem".ToUpperInvariant(), typeof(OpCodes).GetField(nameof(OpCodes.Ldelem_Any), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static) !); asmmap.Add("Stelem".ToUpperInvariant(), typeof(OpCodes).GetField(nameof(OpCodes.Stelem_Any), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static) !); asmmap.Add("Unaligned_".ToUpperInvariant(), typeof(OpCodes).GetField(nameof(OpCodes.Unaligned), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static) !); var int32Converter = new System.ComponentModel.Int32Converter(); var ilAttrName = "ILMethodBodyAttribute"; foreach (var typeref in module.GetTypes()) { if (typeref is TypeDefinition type) { foreach (var method in type.Methods) { if (!method.HasCustomAttributes) { continue; } CustomAttribute?ilAttr = GetCustomAttributeByName(method, ilAttrName); if (null == ilAttr) { continue; } Console.Out.Write($@"Assembling {method.FullName}... "); var ilSource = ilAttr.ConstructorArguments[0].Value as string; using var ilSourceReader = new StringReader(ilSource !); var tts = type.GenericParameters; var ts = method.GenericParameters; if (!method.HasBody) { Console.Out.WriteLine($@"No stub body found. Skipped."); continue; } { var bd = method.Body; var ins = bd.Instructions; var ilg = (ILProcessor?)null; ilg = bd.GetILProcessor(); ilg.Clear(); /* * var insa = ins.ToArray(); * for (var i = 0; insa.Length > i; ++i) { * var inn = insa[i]; * if (null != inn) { * ilg.Remove(inn); * } * } */ { string?ilasmLine; for (; null != (ilasmLine = ilSourceReader.ReadLine());) { var sdfasd = ilasmLine.Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); var sdfas = sdfasd.FirstOrDefault(); if (null == sdfas) { continue; } var sdfa = sdfas.Replace('.', '_').ToUpperInvariant(); var safsad = asmmap[sdfa]; var sdfsaf = (safsad.GetValue(null) as OpCode?); if (null == sdfsaf) { throw new Exception("gfghgh"); } var sdfdsa = sdfsaf.Value; switch (sdfdsa.OperandType) { case OperandType.InlineBrTarget: throw new NotImplementedException(); case OperandType.InlineField: throw new NotImplementedException(); case OperandType.InlineI: throw new NotImplementedException(); case OperandType.InlineI8: ilg.Append(ilg.Create(sdfdsa, int.Parse(sdfasd[1]))); break; case OperandType.InlineMethod: throw new NotImplementedException(); case OperandType.InlineNone: ilg.Append(ilg.Create(sdfdsa)); break; case OperandType.InlinePhi: throw new NotImplementedException(); case OperandType.InlineR: throw new NotImplementedException(); case OperandType.InlineSig: throw new NotImplementedException(); case OperandType.InlineString: throw new NotImplementedException(); case OperandType.InlineSwitch: throw new NotImplementedException(); case OperandType.InlineTok: throw new NotImplementedException(); case OperandType.InlineType: if (sdfasd[1].StartsWith("!!")) { ilg.Append(ilg.Create(sdfdsa, ts[int.Parse(sdfasd[1][2..])]));
/// <summary> /// one of these should go away /// move to BLL and springify /// this one does not use XMLReader (i hope) /// </summary> public static void LoadScreenListFromXml() #if true { XmlReaderSettings settings = new XmlReaderSettings(); XmlReader reader = default(XmlReader); settings.ConformanceLevel = ConformanceLevel.Fragment; settings.IgnoreWhitespace = true; settings.IgnoreComments = true; ////see Nunit test pp 99 ////this is what it used to be //// you have to test for scr.xml //// don't build for testing at the expense of needed functionality try { reader = XmlReader.Create(@"scr.xml"); } catch { var sb = new StringBuilder(); sb.AppendLine("The scr.xml file is missing or faulty"); sb.AppendLine("Please create it "); sb.AppendLine(" by saving Screen Positions"); MessageBox.Show(sb.ToString()); return; } while (reader.Read()) { switch (reader.Name) { case "": continue; case "xml": continue; case "Screens": continue; case "Items": continue; case "Item": var sd = new ScreenDimension(); var cvt = new System.ComponentModel.Int32Converter(); sd.WinTitle = reader.GetAttribute("Title"); sd.TopInt = (int)cvt.ConvertFromString( reader.GetAttribute("Top")); sd.LeftInt = (int)cvt.ConvertFromString( reader.GetAttribute("Left")); sd.WidthInt = (int)cvt.ConvertFromString( reader.GetAttribute("Width")); sd.HeightInt = (int)cvt.ConvertFromString( reader.GetAttribute("Height")); ScreenList.Add(sd); continue; default: break; } } reader.Close(); }