private PropertyTest(Assembly asset) { //Discarded unreachable code: IL_0002, IL_0006 //IL_0003: Incompatible stack heights: 0 vs 1 //IL_0007: Incompatible stack heights: 0 vs 1 SingletonReader.PushGlobal(); base._002Ector(); _0001(asset); Type type = asset.GetType("Microsoft.FSharp.Reflection.FSharpType"); MethodInfo v = PopIssuer(type, "IsUnion", BindingFlags.Static | BindingFlags.Public); _0001(ConfigProperty._0001()._0001 <object>(v)); MethodInfo v2 = PopIssuer(type, "GetUnionCases", BindingFlags.Static | BindingFlags.Public); _0002(ConfigProperty._0001()._0001 <object>(v2)); Type type2 = asset.GetType("Microsoft.FSharp.Reflection.FSharpValue"); _0003(NewIssuer(type2, "PreComputeUnionTagReader")); _0004(NewIssuer(type2, "PreComputeUnionReader")); _0005(NewIssuer(type2, "PreComputeUnionConstructor")); Type type3 = asset.GetType("Microsoft.FSharp.Reflection.UnionCaseInfo"); _0002(ConfigProperty._0001()._0001 <object>(type3.GetProperty("Name"))); _0003(ConfigProperty._0001()._0001 <object>(type3.GetProperty("Tag"))); _0001(ConfigProperty._0001()._0001 <object>(type3.GetProperty("DeclaringType"))); _0006(ConfigProperty._0001()._0001 <object>(type3.GetMethod("GetFields"))); Type type4 = asset.GetType("Microsoft.FSharp.Collections.ListModule"); clientTest = type4.GetMethod("OfSeq"); _BroadcasterTest = asset.GetType("Microsoft.FSharp.Collections.FSharpMap`2"); }
public void Show_and_Read_Entity_In_EntryFormTest() { BaseEntryForm baseEntryForm = new BaseEntryForm(this.TaskProjectBLO); TaskProject taskProject = new TaskProjectBLO().CreateTestInstance(); // Set Default Values // Set Values foreach (var prorpertyInfo in taskProject.GetType().GetProperties()) { ConfigProperty configProperty = new ConfigProperty(prorpertyInfo, configEntity); IFieldTraitements fieldTraitement = BaseFieldTraitement.CreateInstance(configProperty); var value = fieldTraitement.GetTestValue(prorpertyInfo); // Set Value prorpertyInfo.SetValue(taskProject, value); } baseEntryForm.Entity = taskProject; // Show Entity to View baseEntryForm.ShowEntity(); // Read Entity from View baseEntryForm.ReadEntity(); }
/// <summary> /// Show the Entitu in EntyForm /// With default value of objet /// and Defailt value of filter /// </summary> public virtual void ShowEntity(Dictionary <string, object> CritereRechercheFiltre, EntityActions EntityAction) { // Generate the the form if is note generated CreateFieldIfNotGenerated(); // set SetpInitalize to true to not execute EventsChange isStepInitializingValues = true; BaseEntity entity = this.Entity; Type typeEntity = this.EntityBLO.TypeEntity; foreach (PropertyInfo item in ListeChampsFormulaire()) { ConfigProperty configProperty = new ConfigProperty(item, this.ConfigEntity); // Param WriteEntity_To_EntryForm_Param param = new WriteEntity_To_EntryForm_Param(); param.Entity = this.Entity; param.ConfigProperty = configProperty; param.CritereRechercheFiltre = CritereRechercheFiltre; param.FromContainer = ConteneurFormulaire; param.EntityAction = EntityAction; // Get FieldTraitement Type IFieldTraitements fieldTraitement = BaseFieldTraitement.CreateInstance(configProperty); // Invok Create Field Method fieldTraitement.ShowEntity_To_EntryForm(param); } // Fin de la phase d'initialisaiton this.isStepInitializingValues = false; }
/// <summary> /// Ajouter une gestion ManyToOne à l'interface /// </summary> /// <param name="form"></param> private void AddManyToOneManager(EntityManagementControl form, PropertyInfo item, BaseEntity obj) { // Annotation de l'propriété DisplayPropertyAttribute affichageProperty = new ConfigProperty(item, this.ConfigEntity) .DisplayProperty; // Préparation de l'interface s'il n'est pas encors préparer if (this.tabControlManagers.Visible == false) { this.tabControlManagers.Visible = true; this.tabControl_MainManager.Dock = DockStyle.Fill; this.tabControlManagers.TabPages["main"].Text = this.ConfigEntity.ManagementForm.FormTitle; this.tabControlManagers.TabPages["main"].Controls.Add(this.tabControl_MainManager); this.tabControlManagers.Dock = DockStyle.Fill; this.panelDataGrid.Controls.Add(this.tabControlManagers); } // Création d'une TabPage dans TabControlManagers TabPage TabPageManyToOne = new TabPage(); TabPageManyToOne.Name = obj + item.Name; TabPageManyToOne.Text = affichageProperty.Titre + " : " + obj; this.tabControlManagers.TabPages.Add(TabPageManyToOne); // Insertion du formulaire form.Dock = DockStyle.Fill; TabPageManyToOne.Controls.Add(form); this.tabControlManagers.SelectedTab = TabPageManyToOne; }
public ConfigProperty this[String propertyName] { get { ConfigProperty ret = null; foreach (ConfigProperty cp in this) { if (cp.Name == propertyName) { ret = cp; break; } } return(ret); } set { ConfigProperty ret = null; foreach (ConfigProperty cp in this) { if (cp.Name == propertyName) { ret = cp; break; } } value = ret; } }
public SelectionFilterManager( IGwinBaseBLO Service, ConfigProperty ConfigProperty, Control MainContainner, Size SizeLabel, Size SizeControl, Orientation OrientationFiled, Int64 DefaultValue ) { this.ConfigProperty = ConfigProperty; this.MainContainner = MainContainner; this.SizeLabel = SizeLabel; this.SizeControl = SizeControl; this.OrientationFiled = OrientationFiled; this.Service = Service; this.ListeComboBox = new Dictionary <string, ManyToOneField>(); this.ListeValeursInitiaux = new Dictionary <string, long>(); this.LsiteTypeObjetCritere = new Dictionary <string, Type>(); if (this.ConfigProperty.SelectionCriteria != null) { InitInterface(); } CalculeValeursInitiaux((Int64)DefaultValue); ViewingData(); }
/// <summary> /// Returns current value of external script config /// </summary> /// <param name="serverConnection"></param> /// <returns></returns> private ServerConfigProperty GetConfig(ServerConnection serverConnection, int configNumber) { Server server = new Server(serverConnection); ConfigProperty serverConfig = GetSmoConfig(server, configNumber); return(serverConfig != null?ServerConfigProperty.ToServerConfigProperty(serverConfig) : null); }
public ModuleConfig() { Format = new ConfigProperty <TextArea>(null, "Format", true, true); Description = new ConfigProperty <StringLabel>("{date} is for the date", "Info", true, true); Background = new ConfigProperty <FilePath>(new FilePath("PNG files (*.png)|*.png|All files (*.*)|*.*", null), "Background", true, true); Example = new ConfigProperty <TextArea>("Item Shop for {date}!\nUse code \"furry\"!", "Example", false, true); }
private static void CompareIssuer() { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 Type type = Type.GetType("Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo, Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: true); Type type2 = Type.GetType("Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags, Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: true); Type type3 = Type.GetType("Microsoft.CSharp.RuntimeBinder.Binder, Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: true); Type type4 = typeof(IEnumerable <>).MakeGenericType(type); MethodInfo method = type3.GetMethod("GetMember", new Type[4] { type2, typeof(string), typeof(Type), type4 }); _TemplateComposer = ConfigProperty._0001()._0001 <object>(method); MethodInfo method2 = type3.GetMethod("SetMember", new Type[4] { type2, typeof(string), typeof(Type), type4 }); expressionComposer = ConfigProperty._0001()._0001 <object>(method2); }
internal static bool CalcIssuer(Type i, Type b, [ConsumerBroadcasterDispatcher(true)][_0008._0012(2)] out Type _0004, [_0008._0012(new byte[] { 2, 1 })][ConsumerBroadcasterDispatcher(true)] out GDBD.Specifications.AdapterClassSpec <object> _0005) { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 if (i.CallReader()) { Type genericTypeDefinition = i.GetGenericTypeDefinition(); string fullName = genericTypeDefinition.FullName; RegistryTest registryTest = _QueueTest.FirstOrDefault((RegistryTest P_0) => P_0._0001() == fullName); if (registryTest != null) { Type type = genericTypeDefinition.RevertReader().GetType(registryTest._0002()); Type type2 = genericTypeDefinition.RevertReader().GetType(registryTest._0003()); if (type != null && type2 != null) { MethodInfo methodInfo = type2.GetMethods().FirstOrDefault((MethodInfo spec) => spec.Name == "CreateRange" && spec.GetParameters().Length == 1); if (methodInfo != null) { _0004 = type.MakeGenericType(b); MethodInfo v = methodInfo.MakeGenericMethod(b); _0005 = ConfigProperty._0001()._0001(v); return(true); } } } } _0004 = null; _0005 = null; return(false); }
public void TestAllEntities() { // Test All EntryForm using (ModelContext db = new ModelContext()) { foreach (var TypeEntity in new GwinEntitiesManager().GetAll_Entities_Type()) { var EntityInstance = Activator.CreateInstance(TypeEntity); ConfigEntity configEntity = ConfigEntity.CreateConfigEntity(TypeEntity); Dictionary <string, object> TestValyes = new Dictionary <string, object>(); // Set Values foreach (var prorpertyInfo in TypeEntity.GetProperties()) { ConfigProperty configProperty = new ConfigProperty(prorpertyInfo, configEntity); IFieldTraitements fieldTraitement = BaseFieldTraitement.CreateInstance(configProperty); var value = fieldTraitement.GetTestValue(prorpertyInfo); TestValyes[prorpertyInfo.Name] = value; prorpertyInfo.SetValue(EntityInstance, value); } // GetValues foreach (var prorpertyInfo in TypeEntity.GetProperties()) { ConfigProperty configProperty = new ConfigProperty(prorpertyInfo, configEntity); IFieldTraitements fieldTraitement = BaseFieldTraitement.CreateInstance(configProperty); var value = prorpertyInfo.GetValue(EntityInstance); var Exptected = TestValyes[prorpertyInfo.Name]; } } } }
public void Save(ConfigProperty conf) { var bOk = this._sqlDbProduct.RunQuery(@" Update Configuration set CategoryXPath = @CategoryXPath Where CompanyID = @CompanyId IF Not Exists (Select Id From Configuration_Property cp Where CompanyId = @CompanyId) Begin Insert Into Configuration_Property (CompanyId, TypeLayout, XPath, JSonOtherConfig, UrlTest) Values (@CompanyId, @TypeLayout, @XPath, @JSonOtherConfig, @UrlTest) End Else Begin Update Configuration_Property Set TypeLayout=@TypeLayout, XPath=@XPath, JSonOtherConfig=@JSonOtherConfig, UrlTest = @UrlTest WHere CompanyId = @CompanyId End " , CommandType.Text, new SqlParameter[] { SqlDb.CreateParamteterSQL("CompanyId", conf.CompanyId, SqlDbType.BigInt), SqlDb.CreateParamteterSQL("TypeLayout", conf.TypeLayout, SqlDbType.Int), SqlDb.CreateParamteterSQL("XPath", conf.XPath, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("JSonOtherConfig", conf.JSonOtherConfig, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("CategoryXPath", conf.CategoryXPath, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("UrlTest", conf.UrlTest, SqlDbType.NVarChar), }); }
//private void Filtre_ComboBox_SelectedValueChanged(object sender, EventArgs e) //{ // foreach (var item in this.groupBoxFiltrage.Controls.OfType<TextBox>()) // { // item.Text = ""; // } // onRefreshEvent(sender, e); //} #endregion #region Read & Write /// <summary> /// Get Filter value /// </summary> /// <returns></returns> public Dictionary <string, object> GetFilterValues() { // Filter value Dictionary <string, object> FilterValues = new Dictionary <string, object>(); // List of Property shwon in Filter var PropertyListFilter = from i in BLO.TypeEntity.GetProperties() where i.GetCustomAttribute(typeof(FilterAttribute)) != null orderby((FilterAttribute)i.GetCustomAttribute(typeof(FilterAttribute))).Ordre select i; // Read Values from Fields foreach (PropertyInfo propertyInfo in PropertyListFilter) { ConfigProperty configProperty = new ConfigProperty(propertyInfo, this.ConfigEntity); IFieldTraitements fieldTraiement = BaseFieldTraitement.CreateInstance(configProperty); object value = fieldTraiement.GetFieldValue_From_Filter(FilterContainer, configProperty); if (value != null) { FilterValues[propertyInfo.Name] = value; } } return(FilterValues); }
/// <summary> /// Determine FieldNature in ConfigProperty /// </summary> public static FieldsNatures DetermineFieldNature(ConfigProperty configProperty) { // Default Value of FieldNature is Default FieldsNatures fieldNature = FieldsNatures.Default; if (configProperty.PropertyInfo.PropertyType.Name == "String" && configProperty.DataSource == null) { fieldNature = FieldsNatures.Default; } if (configProperty.PropertyInfo.PropertyType.Name == "String" && configProperty.DataSource != null) { fieldNature = FieldsNatures.StringWithDataSource; } if (configProperty.PropertyInfo.PropertyType.Name == "LocalizedString") { fieldNature = FieldsNatures.LocalizedString; } // // Use Default Field // //if (configProperty.PropertyInfo.PropertyType.Name == "Int32") //{ // fieldNature = FieldsNatures.Int32; //} //if (configProperty.PropertyInfo.PropertyType.Name == "Int64") //{ // fieldNature = FieldsNatures.Int64; //} if (configProperty.PropertyInfo.PropertyType.Name == "DateTime") { fieldNature = FieldsNatures.DateTime; } if (configProperty.PropertyInfo.PropertyType.Name == "bool" || configProperty.PropertyInfo.PropertyType.Name == "Boolean") { fieldNature = FieldsNatures.Bool; } if (configProperty.PropertyInfo.PropertyType.IsEnum) { fieldNature = FieldsNatures.Enumeration; } if (configProperty.Relationship?.Relation == RelationshipAttribute.Relations.ManyToOne) { fieldNature = FieldsNatures.ManyToOne; } if (configProperty.Relationship?.Relation == RelationshipAttribute.Relations.ManyToMany_Selection) { fieldNature = FieldsNatures.ManyToMany_Selection; } if (configProperty.Relationship?.Relation == RelationshipAttribute.Relations.ManyToMany_Creation) { fieldNature = FieldsNatures.ManyToMany_Creation; } return(fieldNature); }
public T Get <T>(ConfigProperty <T> pro) { if (properties.ContainsKey(pro.name)) { return((T)properties[pro.name]); } return(pro.defaultValue); }
public ConfigTable Remove <T>(ConfigProperty <T> pro) { if (properties.ContainsKey(pro.name)) { properties.Remove(pro.name); } return(this); }
public PlatformConfig() { AuthPin = new ConfigProperty <Func <IPlugin, Task> >(AuthPinF, "(1) Authorize with PIN", true, true); TwitterPin = new ConfigProperty <string>(null, "(2) Enter PIN from Twitter", false, false); SubmitPin = new ConfigProperty <Func <IPlugin, Task> >(SubmitPinF, "(3) Submit PIN", false, false); Logout = new ConfigProperty <Action <IPlugin> >(LogoutF, "Log Out", true, false); AuthStatus = new ConfigProperty <StringLabel>("Not Logged In", "Status", false, true); }
public GDBD.Specifications.AdapterClassSpec <object> ForgotIssuer(Type param) { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 MethodInfo v = clientTest.MakeGenericMethod(param); return(ConfigProperty._0001()._0001(v)); }
public void Add(String Name, String Value) { ConfigProperty cp = new ConfigProperty(); cp.Name = Name; cp.Value = Value; this.Add(cp); }
internal new GDBD.Specifications.AdapterClassSpec <object> _0001() { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 if (_ObserverProperty == null && m_MappingProperty != null) { _ObserverProperty = ConfigProperty._0001()._0001(m_MappingProperty); } return(_ObserverProperty); }
internal object ManageClient() { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 if (!ConfigProperty._0002()) { throw new ListenerTestItem("Insufficient permissions. Creating an uninitialized '{0}' type requires full trust.".ListReader(CultureInfo.InvariantCulture, _InstanceProperty)); } return(FormatterServices.GetUninitializedObject(_InstanceProperty)); }
internal new GDBD.Specifications.AdapterClassSpec <object> _0001() { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 if (m_ExpressionTest == null && _TemplateTest != null) { m_ExpressionTest = ConfigProperty._0001()._0001(_TemplateTest); } return(m_ExpressionTest); }
private void SaveData() { ConfigProperty conf = this.GetConfig(); this._storageConfigCrl.Save(conf); this.RefreshData(); MessageBox.Show("Saved"); }
public void Register <T>(string name, Expression <Func <T> > expression, Func <T> getDefaultValue) { if (expression.Body is MemberExpression memberExpression && memberExpression.Member is PropertyInfo propertyInfo) { object instance = (memberExpression.Expression as ConstantExpression)?.Value; name = name ?? expression.Body.ToString(); expressions[name] = new ConfigProperty(propertyInfo, instance); var value = repository.Get(name, getDefaultValue()); propertyInfo.SetValue(instance, value); }
/// <summary> /// Clikc Events /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { BaseEntity obj = (BaseEntity)ObjetBindingSource.Current; // Delete Clikc if (e.ColumnIndex == dataGridView.Columns["Supprimer"].Index && e.RowIndex >= 0) { if (DialogResult.Yes == MetroMessageBox.Show(this, "Voullez-vous vraimment supprimer :" + obj.ToString(), "Confirmation de supprision", MessageBoxButtons.YesNo)) { this.EntityBLO.Delete(obj); this.RefreshEntities(); } } // Editer Clikc if (e.ColumnIndex == dataGridView.Columns["Editer"].Index && e.RowIndex >= 0) { onEditClick(this, null); } // ManytoMany_Creation Clic foreach (var item in this.ShownEntityProperties.Where(p => p.PropertyType.Name == "List`1")) { ConfigProperty attributesOfProperty = new ConfigProperty(item, this.EntityBLO.ConfigEntity); if (attributesOfProperty.Relationship?.Relation != RelationshipAttribute.Relations.ManyToMany_Creation) { continue; } if (e.ColumnIndex == dataGridView.Columns[item.Name].Index && e.RowIndex >= 0) { this.SelectedProperty = item; onEditManyToMany_Creation(this, e); } } // ActionClikc for DataGridSeletedAction if (this.EntityBLO.ConfigEntity.ListDataGridSelectedAction != null) { foreach (DataGridSelectedActionAttribute item in this.EntityBLO.ConfigEntity.ListDataGridSelectedAction) { if (e.ColumnIndex == dataGridView.Columns[item.TypeOfForm.FullName].Index && e.RowIndex >= 0) { // Create TraitementAtionForm Instance IFormSelectedEntityAction Form = Activator.CreateInstance(item.TypeOfForm) as IFormSelectedEntityAction; Form.SetEntity(obj); // Show Form In MDI Application CreateAndShowManagerFormHelper ShowManagerFormHelper = new CreateAndShowManagerFormHelper(GwinApp.Instance.TypeDBContext, GwinApp.Instance.FormApplication); ShowManagerFormHelper.ShwoForm(Form as ManagerForm); } } } }
private void CheckPathConfiguration(BaseConfig baseConfig, ConfigProperty configProperty, bool bRequired, StringBuilder sbErrorMessage) { string strProperty = configProperty.ToString(); string strPath = baseConfig[strProperty].ToString(); if ((bRequired && string.IsNullOrEmpty(strPath)) || (!string.IsNullOrEmpty(strPath) && !File.Exists(strPath) && !Directory.Exists(strPath))) { sbErrorMessage.AppendLine(string.Format("{0}.{1} is not a valid path", baseConfig.Identifier, strProperty)); } }
internal IDictionary AssetClient() { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 if (_TokenizerProperty == null) { Type task = typeof(Dictionary <, >).MakeGenericType(this._0001() ?? typeof(object), _0004() ?? typeof(object)); _TokenizerProperty = ConfigProperty._0001()._0001 <object>(task); } return((IDictionary)_TokenizerProperty()); }
public void ConfigProperty_of_AllField_Test() { ConfigEntity ConfigEntity = ConfigEntity.CreateConfigEntity(typeof(TaskProject)); foreach (PropertyInfo PropertyInfoName in typeof(TaskProject).GetProperties()) { ConfigProperty ConfigProperty = new ConfigProperty(PropertyInfoName, ConfigEntity); Assert.IsNotNull(ConfigProperty.DisplayProperty.Title); Assert.AreNotEqual(ConfigProperty.DisplayProperty.Title, String.Empty); } }
private static Newtonsoft.Rules.ClientInstanceRule <object, object> NewIssuer(Type task, string pol) { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 MethodInfo methodInfo = PopIssuer(task, pol, BindingFlags.Static | BindingFlags.Public); MethodInfo method = methodInfo.ReturnType.GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public); Newtonsoft.Rules.ClientInstanceRule <object, object> clientInstanceRule = ConfigProperty._0001()._0001 <object>(methodInfo); Newtonsoft.Rules.ClientInstanceRule <object, object> col = ConfigProperty._0001()._0001 <object>(method); return((object P_0, object[] P_1) => new ParamsComposerWorker(clientInstanceRule(P_0, P_1), col)); }
internal IList GetClient() { //Discarded unreachable code: IL_0002 //IL_0003: Incompatible stack heights: 0 vs 1 if (_VisitorTest == null) { Type type = (this._0001() || this._0001() == null) ? typeof(object) : this._0001(); Type task = typeof(List <>).MakeGenericType(type); _VisitorTest = ConfigProperty._0001()._0001 <object>(task); } return((IList)_VisitorTest()); }
public NodeInputConfig NameConfig(string literal) { Name = new ConfigProperty<IDiagramNodeItem, string>(literal); return this; }
public NodeInputConfig NameConfig(ConfigProperty<IDiagramNodeItem, string> name) { Name = name; return this; }
public NodeInputConfig NameConfig(Func<IDiagramNodeItem, string> selector) { Name = new ConfigProperty<IDiagramNodeItem, string>(selector); return this; }