internal Property(Bridge pBridge, System.Type pType, object pInstance, System.Reflection.PropertyInfo pProperty) { this.lBridge = pBridge; this.lType = pType; this.lInstance = pInstance; this.lProperty = pProperty; }
public void SetAutoFetch(object o, string property) { this._autoFetchObject = o; if (o != null) this._autoFetchPropInfo = Endogine.Serialization.Access.GetPropertyInfoNoCase(o, property); else this._autoFetchPropInfo = null; }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { var classAttribute = property.DeclaringType.GetCustomAttributeByReflection<AuthorizePropertyAttribute>(); var propertyAttribute = property.GetCustomAttribute<AuthorizePropertyAttribute>(); if (classAttribute != null && propertyAttribute != null) { Log.WarnFormat("Class and property level AuthorizeAttributes applied to class {0} - ignoring attribute on property {1}", property.DeclaringType.FullName, property.Name); } return Create(classAttribute ?? propertyAttribute, holder); }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { if ((property.PropertyType.IsPrimitive || TypeUtils.IsEnum(property.PropertyType)) && property.GetCustomAttribute<OptionallyAttribute>() != null) { Log.Warn("Ignoring Optionally annotation on primitive or un-readable parameter on " + property.ReflectedType + "." + property.Name); return false; } if (property.GetGetMethod() != null && !property.PropertyType.IsPrimitive) { return Process(property, holder); } return false; }
public Animator(object a_obj, string a_sProp) { m_obj = a_obj; System.Type type = a_obj.GetType(); m_pi = type.GetProperty(a_sProp); _slKeys = new SortedList<float, AnimationKey>(); if (m_pi == null) throw new Exception("Property "+a_sProp+" not found for animating "+a_obj.ToString()); m_fTime = 0.0f; m_fStep = 1.0f; this.FrameInterval = 1; }
public static IEnumerable<System.Reflection.PropertyInfo> GetAllProps(Object obj) { System.Reflection.BindingFlags propFlags = //System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic; System.Reflection.PropertyInfo[] props = new System.Reflection.PropertyInfo[] { }; Type objType = obj.GetType(); while (objType != null) { props = props.Concat(objType.GetProperties(propFlags)).ToArray(); objType = objType.BaseType; } return props; }
public MySocket() { //System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient(); //UnityEngine.Debug.Log(client.GetType().Assembly.GetName().Name); //tcpClient = client;//System.Activator.CreateInstance(GetType().Assembly.FullName, "System.Net.Sockets.TcpClient"); System.Type testType = typeof(System.Uri); System.Type clazz = testType.Assembly.GetType("System.Net.Sockets.TcpClient"); tcpClient = clazz.GetConstructor(new System.Type[]{}).Invoke(null); //tcpClient = System.Activator.CreateInstance(testType.Assembly.FullName, "System.Net.Sockets.TcpClient"); availableProperty = clazz.GetProperty("Available"); connectedProperty = clazz.GetProperty("Connected"); connectMethod = clazz.GetMethod("Connect", new System.Type[] {typeof(string), typeof(int)}); getStreamMethod = clazz.GetMethod("GetStream"); closeMethod = clazz.GetMethod("Close"); }
protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) { // ptentially this can cause a racing condition when more than one thread will rush to set the manager_property value // I think it is still ok because all of them will get back the same value and if it is assigned more than once it should be // no problem if (manager_property == null) { manager_property = controllerContext.HttpContext.ApplicationInstance.GetType().GetProperty("DjangoTemplateManager"); if (manager_property == null || !manager_property.CanWrite || !manager_property.CanRead || manager_property.PropertyType != typeof(ITemplateManager)) throw new ApplicationException("Missing or invalid TemplateManager property in Global.asax. The required format is\n public NDjango.Interfaces.ITemplateManager DjangoTemplateManager { get; set; }"); } var manager = (ITemplateManager) manager_property.GetValue(controllerContext.HttpContext.ApplicationInstance, new object[] { }); if (manager == null) { manager = manager_provider.GetNewManager(); manager_property.SetValue(controllerContext.HttpContext.ApplicationInstance, manager, new object[] { }); } return new DjangoView(manager, viewPath); }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { string capitalizedName = property.Name; var paramTypes = new[] {property.PropertyType}; var facets = new List<IFacet> {new PropertyAccessorFacetViaAccessor(property, holder)}; if (property.PropertyType.IsGenericType && (property.PropertyType.GetGenericTypeDefinition() == typeof (Nullable<>))) { facets.Add(new NullableFacetAlways(holder)); } if (property.GetSetMethod() != null) { if (property.PropertyType == typeof (byte[])) { facets.Add(new DisabledFacetAlways(holder)); } else { facets.Add(new PropertySetterFacetViaSetterMethod(property, holder)); } facets.Add(new PropertyInitializationFacetViaSetterMethod(property, holder)); } else { //facets.Add(new DerivedFacetInferred(holder)); facets.Add(new NotPersistedFacetAnnotation(holder)); facets.Add(new DisabledFacetAlways(holder)); } FindAndRemoveModifyMethod(facets, methodRemover, property.DeclaringType, capitalizedName, paramTypes, holder); FindAndRemoveClearMethod(facets, methodRemover, property.DeclaringType, capitalizedName, holder); FindAndRemoveAutoCompleteMethod(facets, methodRemover, property.DeclaringType, capitalizedName, property.PropertyType, holder); FindAndRemoveChoicesMethod(facets, methodRemover, property.DeclaringType, capitalizedName, property.PropertyType, holder); FindAndRemoveDefaultMethod(facets, methodRemover, property.DeclaringType, capitalizedName, property.PropertyType, holder); FindAndRemoveValidateMethod(facets, methodRemover, property.DeclaringType, paramTypes, capitalizedName, holder); AddHideForSessionFacetNone(facets, holder); AddDisableForSessionFacetNone(facets, holder); FindDefaultHideMethod(facets, methodRemover, property.DeclaringType, MethodType.Object, "PropertyDefault", new Type[0], holder); FindAndRemoveHideMethod(facets, methodRemover, property.DeclaringType, MethodType.Object, capitalizedName, property.PropertyType, holder); FindDefaultDisableMethod(facets, methodRemover, property.DeclaringType, MethodType.Object, "PropertyDefault", new Type[0], holder); FindAndRemoveDisableMethod(facets, methodRemover, property.DeclaringType, MethodType.Object, capitalizedName, property.PropertyType, holder); return FacetUtils.AddFacets(facets); }
/// <summary> /// Erstellt eine neue Instanz für eine gefundene Eigenschaft /// </summary> /// <param name="initCsvAttribute">CsvAttribut, dass in der Klasse angegeben wurde</param> /// <param name="initPropertyInfo">PropertyInfo für die Eigenschaft der Klasse</param> public CsvFieldInfo(CsvColumnAttribute initCsvAttribute, System.Reflection.PropertyInfo initPropertyInfo) : base() { csvColumnAttribute = initCsvAttribute; propertyInfo = initPropertyInfo; }
private bool GetPropertyValue(PropertyInfo pi, PropertyLookupParams paramBag, ref object @value) { try { @value = pi.GetValue(paramBag.instance, (object[]) null); return true; } catch(Exception ex) { paramBag.self.Error("Can't get property " + paramBag.propertyName + " as CLR property " + pi.Name + " from " + paramBag.prototype.FullName + " instance", ex); } return false; }
public PDFDataBindEventHandler GetDataBindingExpression(string expressionvalue, Type classType, System.Reflection.PropertyInfo forProperty) { BindingItemExpression expr = BindingItemExpression.Create(expressionvalue, forProperty); return(new PDFDataBindEventHandler(expr.BindComponent)); }
public UndoSetProperty(object obj, string propname, object newValue) { Object = obj; PropertyName = propname; prop = Object.GetType().GetProperty(propname); NewValue = newValue; }
public PropertyMetadata(System.Type ownerType, System.Reflection.PropertyInfo propertyInfo) { }
Add(string name, System.Reflection.MethodInfo method, System.Reflection.PropertyInfo property) => _attributes.Add(name, new MemberPropertyResolverI(name, method, property));
public static System.Object GetValueTSS( System.Reflection.PropertyInfo target, System.Object obj, System.Object[] index) { return(2); }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { Attribute attribute = property.GetCustomAttribute<ConcurrencyCheckAttribute>(); return FacetUtils.AddFacet(Create(attribute, holder)); }
public void initalize(MaskDAGGraphNode gn) { this.SuspendLayout(); startingControlCount = this.Controls.Count; int textLeft = 10; int objLeft = 100; int objHeight = 20; this.Width = 500; mOwnerNode = gn; this.Text = mOwnerNode.GetType().ToString() + " Properties"; Type type = mOwnerNode.GetType();// Get object type System.Reflection.PropertyInfo[] pi = type.GetProperties(); for (int i = 0; i < pi.Length; i++) { System.Reflection.PropertyInfo prop = pi[i]; object[] custAttrib = prop.GetCustomAttributes(false); if (custAttrib == null) { continue; } Type ptt = prop.PropertyType; for (int k = 0; k < custAttrib.Length; k++) { if (custAttrib[k] is ConnectionType) { ConnectionType ct = custAttrib[k] as ConnectionType; if (ct.ConnType == "Param") { Label ll = new Label(); ll.Text = ct.Description; ll.Left = textLeft; ll.Top = (this.Controls.Count) * objHeight + 5; Control ctrl = giveControlForType(ptt, prop); ctrl.Left = objLeft; ctrl.Top = (this.Controls.Count) * objHeight + 5; ctrl.Width = 300; this.Controls.Add(ctrl); this.Controls.Add(ll); } break; } } } button1.Top = (this.Controls.Count) * objHeight; this.Controls.Add(this.button1); this.Height = (this.Controls.Count + 3) * objHeight; this.ResumeLayout(); }
private void CreateSite(Site site) { List <Role> roles = RoleRepository.GetRoles(site.SiteId, true).ToList(); if (!roles.Where(item => item.Name == Constants.AllUsersRole).Any()) { RoleRepository.AddRole(new Role { SiteId = null, Name = Constants.AllUsersRole, Description = "All Users", IsAutoAssigned = false, IsSystem = true }); } if (!roles.Where(item => item.Name == Constants.HostRole).Any()) { RoleRepository.AddRole(new Role { SiteId = null, Name = Constants.HostRole, Description = "Application Administrators", IsAutoAssigned = false, IsSystem = true }); } RoleRepository.AddRole(new Role { SiteId = site.SiteId, Name = Constants.RegisteredRole, Description = "Registered Users", IsAutoAssigned = true, IsSystem = true }); RoleRepository.AddRole(new Role { SiteId = site.SiteId, Name = Constants.AdminRole, Description = "Site Administrators", IsAutoAssigned = false, IsSystem = true }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "FirstName", Title = "First Name", Description = "Your First Or Given Name", Category = "Name", ViewOrder = 1, MaxLength = 50, DefaultValue = "", IsRequired = true, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "LastName", Title = "Last Name", Description = "Your Last Or Family Name", Category = "Name", ViewOrder = 2, MaxLength = 50, DefaultValue = "", IsRequired = true, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "Street", Title = "Street", Description = "Street Or Building Address", Category = "Address", ViewOrder = 3, MaxLength = 50, DefaultValue = "", IsRequired = false, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "City", Title = "City", Description = "City", Category = "Address", ViewOrder = 4, MaxLength = 50, DefaultValue = "", IsRequired = false, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "Region", Title = "Region", Description = "State Or Province", Category = "Address", ViewOrder = 5, MaxLength = 50, DefaultValue = "", IsRequired = false, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "Country", Title = "Country", Description = "Country", Category = "Address", ViewOrder = 6, MaxLength = 50, DefaultValue = "", IsRequired = false, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "PostalCode", Title = "Postal Code", Description = "Postal Code Or Zip Code", Category = "Address", ViewOrder = 7, MaxLength = 50, DefaultValue = "", IsRequired = false, IsPrivate = false }); ProfileRepository.AddProfile(new Profile { SiteId = site.SiteId, Name = "Phone", Title = "Phone Number", Description = "Phone Number", Category = "Contact", ViewOrder = 8, MaxLength = 50, DefaultValue = "", IsRequired = false, IsPrivate = false }); foreach (PageTemplate pagetemplate in SiteTemplate) { int?parentid = null; if (pagetemplate.Parent != "") { List <Page> pages = PageRepository.GetPages(site.SiteId).ToList(); Page parent = pages.Where(item => item.Name == pagetemplate.Parent).FirstOrDefault(); parentid = parent.PageId; } Page page = new Page { SiteId = site.SiteId, ParentId = parentid, Name = pagetemplate.Name, Path = pagetemplate.Path, Order = pagetemplate.Order, IsNavigation = pagetemplate.IsNavigation, EditMode = pagetemplate.EditMode, ThemeType = site.DefaultThemeType, LayoutType = site.DefaultLayoutType, Icon = pagetemplate.Icon, Permissions = pagetemplate.PagePermissions }; Type type = Type.GetType(page.ThemeType); System.Reflection.PropertyInfo property = type.GetProperty("Panes"); page.Panes = (string)property.GetValue(Activator.CreateInstance(type), null); page = PageRepository.AddPage(page); if (pagetemplate.ModuleDefinitionName != "") { Module module = new Module { SiteId = site.SiteId, ModuleDefinitionName = pagetemplate.ModuleDefinitionName, Permissions = pagetemplate.ModulePermissions, }; module = ModuleRepository.AddModule(module); PageModule pagemodule = new PageModule { PageId = page.PageId, ModuleId = module.ModuleId, Title = pagetemplate.Title, Pane = pagetemplate.Pane, Order = 1, ContainerType = pagetemplate.ContainerType }; PageModuleRepository.AddPageModule(pagemodule); } } }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL model, params string[] updateProperties) { Apps.Models.SHIPMENT_DETAIL entity = m_Rep.GetById(model.INTERNAL_SHIPMENT_LINE_NUM); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM; entity.INTERNAL_SHIPMENT_NUM = model.INTERNAL_SHIPMENT_NUM; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.SHIPMENT_ID = model.SHIPMENT_ID; entity.ERP_ORDER = model.ERP_ORDER; entity.ERP_ORDER_LINE_NUM = model.ERP_ORDER_LINE_NUM; entity.SHIPMENT_TYPE = model.SHIPMENT_TYPE; entity.ITEM = model.ITEM; entity.ITEM_DESC = model.ITEM_DESC; entity.TOTAL_QTY = model.TOTAL_QTY; entity.REQUEST_QTY = model.REQUEST_QTY; entity.QUANTITY_UM = model.QUANTITY_UM; entity.ALLOCATION_RULE = model.ALLOCATION_RULE; entity.PICK_LOC = model.PICK_LOC; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; entity.ATTRIBUTE_TRACK = model.ATTRIBUTE_TRACK; entity.ATTRIBUTE1 = model.ATTRIBUTE1; entity.ATTRIBUTE2 = model.ATTRIBUTE2; entity.ATTRIBUTE3 = model.ATTRIBUTE3; entity.ATTRIBUTE4 = model.ATTRIBUTE4; entity.ATTRIBUTE5 = model.ATTRIBUTE5; entity.ATTRIBUTE6 = model.ATTRIBUTE6; entity.ATTRIBUTE7 = model.ATTRIBUTE7; entity.ATTRIBUTE8 = model.ATTRIBUTE8; entity.INVENTORY_STS = model.INVENTORY_STS; entity.DOCK_LOC = model.DOCK_LOC; entity.PACKING_CLASS = model.PACKING_CLASS; entity.STATUS = model.STATUS; entity.INTERNAL_WAVE_NUM = model.INTERNAL_WAVE_NUM; entity.TOTAL_WEIGHT = model.TOTAL_WEIGHT; entity.WEIGHT_UM = model.WEIGHT_UM; entity.TOTAL_VOLUME = model.TOTAL_VOLUME; entity.VOLUME_UM = model.VOLUME_UM; entity.BACK_ORDER_LINE_NUM = model.BACK_ORDER_LINE_NUM; entity.USER_DEF1 = model.USER_DEF1; entity.USER_DEF2 = model.USER_DEF2; entity.USER_DEF3 = model.USER_DEF3; entity.USER_DEF4 = model.USER_DEF4; entity.USER_DEF5 = model.USER_DEF5; entity.USER_DEF6 = model.USER_DEF6; entity.USER_DEF7 = model.USER_DEF7; entity.USER_DEF8 = model.USER_DEF8; entity.USER_DEF9 = model.USER_DEF9; entity.USER_DEF10 = model.USER_DEF10; entity.ITEM_LIST_PRICE = model.ITEM_LIST_PRICE; entity.ITEM_NET_PRICE = model.ITEM_NET_PRICE; entity.SERIAL_NUM_TRACK = model.SERIAL_NUM_TRACK; entity.ORIGINAL_ORDER_NUM = model.ORIGINAL_ORDER_NUM; entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME; entity.CREATE_USER = model.CREATE_USER; entity.HOST_ITEM = model.HOST_ITEM; entity.UPLOAD_INTERFACE_REQUIRED = model.UPLOAD_INTERFACE_REQUIRED; } else { Type type = typeof(Apps.Models.SCV.SHIPMENT.SHIPMENT_DETAIL_MODEL); Type typeE = typeof(Apps.Models.SHIPMENT_DETAIL); foreach (var item in updateProperties) { System.Reflection.PropertyInfo pi = type.GetProperty(item); System.Reflection.PropertyInfo piE = typeE.GetProperty(item); piE.SetValue(entity, pi.GetValue(model), null); } } m_Rep.Modify(entity, updateProperties); }
public DataTablePropertyInfo(System.Reflection.PropertyInfo propertyInfo, DataTableAttributeBase[] attributes) { PropertyInfo = propertyInfo; Attributes = attributes; }
public MongoDbRepository(MongoDatabaseProvider provider) { this.provider = provider; idGetter = typeof(TEntity).GetProperty("ID"); }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { var attribute = property.GetCustomAttribute<EagerlyAttribute>(); return FacetUtils.AddFacet(Create(attribute, holder)); }
private static bool PropertySatisfiesPredicate <T, PropertyType>(Predicate <PropertyType> predicate, T item, System.Reflection.PropertyInfo prop) { try { return(predicate((PropertyType)prop.GetValue(item))); } catch { return(false); } }
public string getValue(object v, string name) { object s = null; if (v is DataRowView) { DataRowView r = (DataRowView)v; s = r[name]; } else if (v is DataRow) { DataRow r = (DataRow)v; s = r[name]; } else if (v is DBObject) { System.Reflection.PropertyInfo propInfo = v.GetType().GetProperty(name); if (propInfo != null) { s = propInfo.GetValue(v, null); } } if (s == null || Convert.IsDBNull(s)) { return(""); } if (db != null) { DBField f = db.getField(name); if (f != null && f.transcoder != null) { s = f.transcoder.fromDB(s); } } Hashtable map = (Hashtable)values[name]; if (map != null && s != null) { object s1 = map[s.ToString()]; if (s1 == null) { try { s1 = map[Convert.ToInt32(s)]; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } } if (s1 != null) { s = s1; } } s = s.ToString().Trim(); return(HTMLUtils.toHTMLText(s.ToString())); }
// http://web.archive.org/web/20120101201615/http://beaucrawford.net/post/Enable-HTML-in-ReportViewer-LocalReport.aspx private void EnableFormat(string formatName) { const System.Reflection.BindingFlags Flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance; System.Type tt = this.m_Viewer.LocalReport.GetType(); System.Reflection.FieldInfo m_previewService = tt.GetField("m_previewService", Flags); if (m_previewService == null) { m_previewService = tt.GetField("m_processingHost", Flags); } // Works only for v2005 if (m_previewService != null) { System.Reflection.MethodInfo ListRenderingExtensions = m_previewService.FieldType.GetMethod ( "ListRenderingExtensions", Flags ); object previewServiceInstance = m_previewService.GetValue(this.m_Viewer.LocalReport); System.Collections.IList extensions = ListRenderingExtensions.Invoke(previewServiceInstance, null) as System.Collections.IList; System.Reflection.PropertyInfo name = null; if (extensions.Count > 0) { name = extensions[0].GetType().GetProperty("Name", Flags); } if (name == null) { return; } foreach (object extension in extensions) { string thisFormat = name.GetValue(extension, null).ToString(); //{ // System.Reflection.FieldInfo m_isVisible = extension.GetType().GetField("m_isVisible", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); // System.Reflection.FieldInfo m_isExposedExternally = extension.GetType().GetField("m_isExposedExternally", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); // object valVisible = m_isVisible.GetValue(extension); // object valExposed = m_isExposedExternally.GetValue(extension); // System.Console.WriteLine(valVisible); // System.Console.WriteLine(valExposed); //} //if (string.Compare(thisFormat, formatName, true) == 0) if (true) { System.Reflection.FieldInfo m_isVisible = extension.GetType().GetField("m_isVisible", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); System.Reflection.FieldInfo m_isExposedExternally = extension.GetType().GetField("m_isExposedExternally", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); m_isVisible.SetValue(extension, true); m_isExposedExternally.SetValue(extension, true); //break; } } // Next extension } // End if (m_previewService != null) } // End Sub EnableFormat
public ClassProperty(System.Reflection.PropertyInfo Property) { this._Property = Property; }
public static System.Reflection.MethodInfo?GetSetMethod(this System.Reflection.PropertyInfo property) { throw null; }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { return Process(property, holder); }
public static System.Reflection.MethodInfo[] GetAccessors(this System.Reflection.PropertyInfo property, bool nonPublic) { throw null; }
/// <summary> /// コントロールの DoubleBuffered を設定します。 /// </summary> /// <param name="control">対象となるコントロール。</param> /// <param name="flag">設定するフラグ。既定では true です。</param> public static void SetDoubleBuffered(System.Windows.Forms.Control control, bool flag = true) { System.Reflection.PropertyInfo prop = control.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); prop.SetValue(control, flag, null); }
public static System.Reflection.MethodInfo?GetGetMethod(this System.Reflection.PropertyInfo property, bool nonPublic) { throw null; }
public override object Evaluate(ISoqlEvaluateContext context) { object val; if (this.Left == null) { val = context.GetRootObject(); } else { val = this.Left.Evaluate(context); } if (val == null) return null; if (_propInfoCache == null) { _propInfoCache = val.GetType().GetProperty(PropertyName); if (_propInfoCache == null) throw new SoodaException(PropertyName + " not found in " + val.GetType().Name); } return _propInfoCache.GetValue(val, null); }
public static bool GetGameViewSize(out float width, out float height, out float aspect) { try { Editor__gameViewReflectionError = false; System.Type gameViewType = System.Type.GetType("UnityEditor.GameView,UnityEditor"); System.Reflection.MethodInfo GetMainGameView = gameViewType.GetMethod("GetMainGameView", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic); object mainGameViewInst = GetMainGameView.Invoke(null, null); if (mainGameViewInst == null) { width = height = aspect = 0; return(false); } System.Reflection.FieldInfo s_viewModeResolutions = gameViewType.GetField("s_viewModeResolutions", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic); if (s_viewModeResolutions == null) { System.Reflection.PropertyInfo currentGameViewSize = gameViewType.GetProperty("currentGameViewSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic); object gameViewSize = currentGameViewSize.GetValue(mainGameViewInst, null); System.Type gameViewSizeType = gameViewSize.GetType(); int gvWidth = (int)gameViewSizeType.GetProperty("width").GetValue(gameViewSize, null); int gvHeight = (int)gameViewSizeType.GetProperty("height").GetValue(gameViewSize, null); int gvSizeType = (int)gameViewSizeType.GetProperty("sizeType").GetValue(gameViewSize, null); if (gvWidth == 0 || gvHeight == 0) { width = height = aspect = 0; return(false); } else if (gvSizeType == 0) { width = height = 0; aspect = (float)gvWidth / (float)gvHeight; return(true); } else { width = gvWidth; height = gvHeight; aspect = (float)gvWidth / (float)gvHeight; return(true); } } else { Vector2[] viewModeResolutions = (Vector2[])s_viewModeResolutions.GetValue(null); float[] viewModeAspects = (float[])gameViewType.GetField("s_viewModeAspects", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic).GetValue(null); string[] viewModeStrings = (string[])gameViewType.GetField("s_viewModeAspectStrings", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic).GetValue(null); if (mainGameViewInst != null && viewModeStrings != null && viewModeResolutions != null && viewModeAspects != null) { int aspectRatio = (int)gameViewType.GetField("m_AspectRatio", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic).GetValue(mainGameViewInst); string thisViewModeString = viewModeStrings[aspectRatio]; if (thisViewModeString.Contains("Standalone")) { width = UnityEditor.PlayerSettings.defaultScreenWidth; height = UnityEditor.PlayerSettings.defaultScreenHeight; aspect = width / height; } else if (thisViewModeString.Contains("Web")) { width = UnityEditor.PlayerSettings.defaultWebScreenWidth; height = UnityEditor.PlayerSettings.defaultWebScreenHeight; aspect = width / height; } else { width = viewModeResolutions[aspectRatio].x; height = viewModeResolutions[aspectRatio].y; aspect = viewModeAspects[aspectRatio]; // this is an error state if (width == 0 && height == 0 && aspect == 0) { return(false); } } return(true); } } } catch (System.Exception e) { if (Editor__getGameViewSizeError == false) { Debug.LogError("GameCamera.GetGameViewSize - has a Unity update broken this?\nThis is not a fatal error !\n" + e.ToString()); Editor__getGameViewSizeError = true; } Editor__gameViewReflectionError = true; } width = height = aspect = 0; return(false); }
/// <summary> /// Initializes a new instance of the <see cref="DefaultHttpClientFactory"/> class. /// </summary> /// <param name="setCredentials">Set the credentials for the native <see cref="HttpMessageHandler"/> (<see cref="HttpClientHandler"/>)?</param> public DefaultHttpClientFactory(bool setCredentials) { _proxyProperty = typeof(HttpClientHandler).GetProperty("Proxy"); _setCredentials = setCredentials; }
public virtual System.Reflection.PropertyInfo GetPropertyInfo() { if(this.propertyInfo == null) { if(this.DeclaringType == null) return null; Type t = this.DeclaringType.GetRuntimeType(); if(t == null) return null; if(this.Type == null) return null; Type retType = this.Type.GetRuntimeType(); if(retType == null) return null; ParameterList pars = this.Parameters; int n = pars == null ? 0 : pars.Count; Type[] types = new Type[n]; for(int i = 0; i < n; i++) { Parameter p = pars[i]; if(p == null || p.Type == null) return null; Type pt = types[i] = p.Type.GetRuntimeType(); if(pt == null) return null; } System.Reflection.MemberInfo[] members = t.GetMember(this.Name.ToString(), System.Reflection.MemberTypes.Property, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach(System.Reflection.PropertyInfo prop in members) { if(prop == null || prop.PropertyType != retType) continue; System.Reflection.ParameterInfo[] parameters = prop.GetIndexParameters(); if(parameters == null || parameters.Length != n) continue; for(int i = 0; i < n; i++) { System.Reflection.ParameterInfo parInfo = parameters[i]; if(parInfo == null || parInfo.ParameterType != types[i]) goto tryNext; } return this.propertyInfo = prop; tryNext: ; } } return this.propertyInfo; }
public PDFLoadedEventHandler GetLoadBindingExpression(string expressionvalue, Type classType, System.Reflection.PropertyInfo forProperty) { throw new NotSupportedException("Item Binding is not supported on any other document lifecycle stage than the databinding"); }
static CodeGenerationTypeParameterSymbol() { typeInfo = Type.GetType("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationTypeParameterSymbol" + ReflectionNamespaces.WorkspacesAsmName, true); constraintTypesProperty = typeInfo.GetProperty("ConstraintTypes"); }
public void Handle(string text, Color color) { if (lastText == text && lastColor == color) { return; } #if ENABLE_REFLECTION if (!this.text) { return; } System.Type type = this.text.GetType(); if (type.BaseType == typeof(MonoBehaviour)) { if (lastText != text) { if (textField == null) { textField = type.GetField("text"); } if (textField != null) { textField.SetValue(this.text, text); } lastText = text; } if (lastColor != color) { if (colorField == null) { colorField = type.GetField("color"); } if (colorField != null) { colorField.SetValue(this.text, color); } lastColor = color; } } else if (type != typeof(Transform) && type != typeof(RectTransform)) { if (lastText != text) { if (textProperty == null) { textProperty = type.GetProperty("text"); } if (textProperty != null) { textProperty.SetValue(this.text, text, null); } lastText = text; } if (lastColor != color) { if (colorProperty == null) { colorProperty = type.GetProperty("color"); } if (colorProperty != null) { colorProperty.SetValue(this.text, color, null); } lastColor = color; } } #else #if ENABLE_UNITY_TEXT if (this.text) { #endif if (lastText != text) { this.text.text = text; lastText = text; } if (lastColor != color) { this.text.color = color; lastColor = color; } #if ENABLE_UNITY_TEXT } else if (textMesh) { if (lastText != text) { textMesh.text = text; lastText = text; } if (lastColor != color) { textMesh.color = color; lastColor = color; } } #endif #endif }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { if (property.GetGetMethod() != null) { return Process(property, holder); } return false; }
public static Dictionary <string, object> GetDictionaryForMetadataExport(IRfcFunction rfc, string tableName) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); for (int i = 0; i < rfc.Metadata.ParameterCount; i++) { if (rfc.Metadata[i].Name.ToString().ToUpper() == tableName) { switch (rfc.Metadata[i].DataType.ToString()) { case "STRUCTURE": for (int j = 0; j < rfc.Metadata[i].ValueMetadataAsStructureMetadata.FieldCount; j++) { dictionary[rfc.Metadata[i].ValueMetadataAsStructureMetadata[j].Name] = Activator.CreateInstance(SAPData.GetDataType(rfc.Metadata[i].ValueMetadataAsStructureMetadata[j].DataType)); } break; case "TABLE": IRfcTable detail = rfc[tableName].GetTable(); /*for (int j = 0; j < detail.Count(); j++) * { * var valueObj = detail[j].GetValue(rfc.Metadata[i].ValueMetadataAsTableMetadata[i].Name); * dictionary[rfc.Metadata[i].ValueMetadataAsTableMetadata[i].Name] = valueObj; * }*/ for (int j = 0; j < rfc.Metadata[i].ValueMetadataAsTableMetadata.LineType.FieldCount; j++) { RfcFieldMetadata jd = rfc.Metadata[i].ValueMetadataAsTableMetadata[j]; Type t = SAPData.GetDataType(rfc.Metadata[i].ValueMetadataAsTableMetadata[j].DataType); var valueObject = detail.GetValue(rfc.Metadata[i].ValueMetadataAsTableMetadata[j].Name); object value = new object(); System.Reflection.PropertyInfo propInfo = t.GetType().GetProperty("UnderlyingSystemType"); if (t.Name != "String") { Type type; switch (t.Name) { case "Decimal": type = (Type)propInfo.GetValue(typeof(System.Decimal), null); value = Activator.CreateInstance(type, valueObject); break; case "int": type = (Type)propInfo.GetValue(typeof(System.Int64), null); value = Activator.CreateInstance(type, valueObject); break; case "double": type = (Type)propInfo.GetValue(typeof(System.Double), null); value = Activator.CreateInstance(type, valueObject); break; default: type = (Type)propInfo.GetValue(t, null); value = Activator.CreateInstance(typeof(System.String), valueObject); break; } } else { //Type type = (Type)propInfo.GetValue(t, null); value = valueObject.ToString(); } dictionary[rfc.Metadata[i].ValueMetadataAsTableMetadata[j].Name] = value; } break; } } } return(dictionary); }
public string getFValue(object v, string name, string format) { object s = null; if (v.GetType() == typeof(DataRowView)) { DataRowView r = (DataRowView)v; s = r[name]; } else if (v is DataRow) { DataRow r = (DataRow)v; s = r[name]; } else if (v is DBObject) { System.Reflection.PropertyInfo propInfo = v.GetType().GetProperty(name); if (propInfo != null) { s = propInfo.GetValue(v, null); } } if (s == null || Convert.IsDBNull(s)) { return(""); } if (db != null) { DBField f = db.getField(name); if (f != null && f.transcoder != null) { s = f.transcoder.fromDB(s); } } Hashtable map = (Hashtable)values[name]; if (map != null && s != null) { object s1 = map[s.ToString()]; if (s1 == null) { try { s1 = map[Convert.ToInt32(s)]; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } } if (s1 != null) { s = s1; } } if (string.IsNullOrEmpty(format) && db != null) { DBField field = db.getField(name); if (field != null) { s = field.populateValue(s); } else { s = s.ToString().Trim(); } } else if (s is DateTime) { DateTime dt = (DateTime)s; if (dt.Ticks == 0) { return(""); } if (format != null) { return(((DateTime)s).ToString(format)); } } else if (s is decimal) { if (format != null) { s = ((decimal)s).ToString(format); } } else if (s is double) { if (Double.IsNaN((double)s)) { s = ""; } else if (format != null) { s = ((double)s).ToString(format); } } else if (s is float) { if (float.IsNaN((float)s)) { s = ""; } else if (format != null) { s = ((float)s).ToString(format); } } else if (s is int) { if (format != null) { s = ((int)s).ToString(format); } } else if (s is long) { if (format != null) { s = ((long)s).ToString(format); } } return(HTMLUtils.toHTMLText(s.ToString().Trim())); }
internal PropertyInfoImpl(System.Reflection.PropertyInfo property) { Debug.Assert(property != null); this.Property = property; }
public abstract void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi);
public MouseButtonBinding(String button, KeyBindingType bindingType) { this.button = button; this.bindingType = bindingType; buttonProperty = typeof(MouseState).GetProperty(button); if (buttonProperty == null || buttonProperty.PropertyType != typeof(ButtonState)) throw new InvalidProgramException("Could not find button " + button); }
private void SetCommandText(string commandText, bool isProc) { if (OracleDal.clientType > 0) { Type t = _com.GetType(); System.Reflection.PropertyInfo pi = t.GetProperty("BindByName"); if (pi != null) { pi.SetValue(_com, true, null); } } _com.CommandText = isProc ? commandText : SqlFormat.Compatible(commandText, dalType, false); if (!isProc && dalType == DalType.SQLite && _com.CommandText.Contains("charindex")) { _com.CommandText += " COLLATE NOCASE";//忽略大小写 } //else if (isProc && dalType == DalType.MySql) //{ // _com.CommandText = "Call " + _com.CommandText; //} _com.CommandType = isProc ? CommandType.StoredProcedure : CommandType.Text; if (isProc) { if (commandText.Contains("SelectBase") && !_com.Parameters.Contains("ReturnValue")) { AddReturnPara(); //检测是否存在分页存储过程,若不存在,则创建。 Tool.DBTool.CreateSelectBaseProc(dalType, conn);//内部分检测是否已创建过。 } } else { //取消多余的参数,新加的小贴心,过滤掉用户不小心写多的参数。 if (_com != null && _com.Parameters != null && _com.Parameters.Count > 0) { bool needToReplace = (dalType == DalType.Oracle || dalType == DalType.MySql) && _com.CommandText.Contains("@"); string paraName; for (int i = 0; i < _com.Parameters.Count; i++) { paraName = _com.Parameters[i].ParameterName.TrimStart(Pre);//默认自带前缀的,取消再判断 if (needToReplace && _com.CommandText.IndexOf("@" + paraName) > -1) { //兼容多数据库的参数(虽然提供了=:?"为兼容语法,但还是贴心的再处理一下) switch (dalType) { case DalType.Oracle: case DalType.MySql: _com.CommandText = _com.CommandText.Replace("@" + paraName, Pre + paraName); break; } } if (_com.CommandText.IndexOf(Pre + paraName, StringComparison.OrdinalIgnoreCase) == -1) { _com.Parameters.RemoveAt(i); i--; } } } } //else //{ // string checkText = commandText.ToLower(); // //int index= // //if (checkText.IndexOf("table") > -1 && (checkText.IndexOf("delete") > -1 || checkText.IndexOf("drop") > -1 || checkText.IndexOf("truncate") > -1)) // //{ // // Log.WriteLog(commandText); // //} //} if (IsAllowRecordSql) { tempSql = GetParaInfo(_com.CommandText) + AppConst.BR + "execute time is: "; } }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { var attribute = property.GetCustomAttribute<EnumDataTypeAttribute>(); return AddEnumFacet(attribute, holder, property.PropertyType); }
/// <summary> /// UnBind the cell with the property /// </summary> protected virtual void UnBindValueAtProperty() { m_LinkPropertyInfo = null; m_LinkObject = null; }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { if (property.GetGetMethod() != null && TypeUtils.IsString(property.PropertyType)) { return Process(property, holder); } return false; }
static CodeGenerationTypeParameterSymbol () { typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationTypeParameterSymbol" + ReflectionNamespaces.WorkspacesAsmName, true); constraintTypesProperty = typeInfo.GetProperty ("ConstraintTypes"); }
/// <summary> /// Validates the specified property. /// </summary> /// <param name="property">The property that will its value validated.</param> /// <param name="sender">The sender who owns the property.</param> /// <returns> /// Returns a validation message if validation failed. Otherwise null is returned to indicate a passing validation. /// </returns> public override IValidationMessage Validate(System.Reflection.PropertyInfo property, IValidatable sender) { if (!this.CanValidate(sender)) { return(null); } // Set up localization if available. this.PrepareLocalization(); var validationMessage = Activator.CreateInstance(this.ValidationMessageType, this.FailureMessage) as IValidationMessage; // Get the property value. var propertyValue = property.GetValue(sender, null); // Ensure the property value is the same data type we are comparing to. if (!this.ValidateDataTypesAreEqual(propertyValue)) { var error = string.Format( "The property '{0}' data type is not the same as the data type ({1}) specified for validation checks. They must be the same Type.", property.PropertyType.Name, this.numberDataType.ToString()); throw new ArgumentNullException(error); } // Check if we need to compare against another property. object alternateMaxProperty = null; object alternateMinProperty = null; if (!string.IsNullOrEmpty(this.MaximumComparisonProperty)) { // Fetch the value of the secondary property specified. alternateMaxProperty = this.GetComparisonValue(sender, this.MaximumComparisonProperty); } if (!string.IsNullOrEmpty(this.MinimumComparisonProperty)) { alternateMinProperty = this.GetComparisonValue(sender, this.MinimumComparisonProperty); } IValidationMessage result = null; if (this.numberDataType == ValidationNumberDataTypes.Short) { result = ValidateShortValueInRange(propertyValue, alternateMaxProperty, alternateMinProperty, validationMessage); } else if (this.numberDataType == ValidationNumberDataTypes.Int) { result = this.ValidateIntegerInRange(propertyValue, alternateMaxProperty, alternateMinProperty, validationMessage); } else if (this.numberDataType == ValidationNumberDataTypes.Long) { result = this.ValidateLongInRange(propertyValue, alternateMaxProperty, alternateMinProperty, validationMessage); } else if (this.numberDataType == ValidationNumberDataTypes.Float) { result = this.ValidateFloatInRange(propertyValue, alternateMaxProperty, alternateMinProperty, validationMessage); } else if (this.numberDataType == ValidationNumberDataTypes.Double) { result = this.ValidateDoubleInRange(propertyValue, alternateMaxProperty, alternateMinProperty, validationMessage); } else if (this.numberDataType == ValidationNumberDataTypes.Decimal) { result = this.ValidateDecimalInRange(propertyValue, alternateMaxProperty, alternateMinProperty, validationMessage); } return(this.RunInterceptedValidation(sender, property, result)); }
public static bool IsSupportedType(this System.Reflection.PropertyInfo property) { }
/// <summary> /// Bind the cell's value with the property p_Property of the object p_LinkObject /// when the cell's value change also the property change /// </summary> /// <param name="p_Property">linked property</param> /// <param name="p_LinkObject">Can be null to call static property</param> protected virtual void BindValueAtProperty(System.Reflection.PropertyInfo p_Property, object p_LinkObject) { m_LinkPropertyInfo = p_Property; m_LinkObject = p_LinkObject; }
public override MapOffset GetMapOffset(System.Reflection.PropertyInfo property, EventHandler offsetChanged) { return(new MapOffset(this, property, offsetChanged)); }
public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) { UpdateScratchPad(property.ReflectedType); Attribute attribute = property.GetCustomAttribute<DisplayNameAttribute>() ?? (Attribute) property.GetCustomAttribute<NamedAttribute>(); return FacetUtils.AddFacet(CreateProperty(attribute, holder)); }
public static EditableValue Create(object o, System.Reflection.PropertyInfo info) { var ret = new EditableValue(); ret.Value = o; var p = info; var attributes = p.GetCustomAttributes(false); var undo = attributes.Where(_ => _.GetType() == typeof(UndoAttribute)).FirstOrDefault() as UndoAttribute; if (undo != null && !undo.Undo) { ret.IsUndoEnabled = false; } else { ret.IsUndoEnabled = true; } var shown = attributes.Where(_ => _.GetType() == typeof(ShownAttribute)).FirstOrDefault() as ShownAttribute; if (shown != null && !shown.Shown) { ret.IsShown = false; } var selector_attribute = (from a in attributes where a is Data.SelectorAttribute select a).FirstOrDefault() as Data.SelectorAttribute; if (selector_attribute != null) { ret.SelfSelectorID = selector_attribute.ID; } // collect selected values var selectedAttributes = attributes.OfType <Data.SelectedAttribute>(); if (selectedAttributes.Count() > 0) { if (selectedAttributes.Select(_ => _.ID).Distinct().Count() > 1) { throw new Exception("Same IDs are required."); } ret.TargetSelectorID = selectedAttributes.First().ID; ret.RequiredSelectorValues = selectedAttributes.Select(_ => _.Value).ToArray(); } var key = KeyAttribute.GetKey(attributes); var nameKey = key + "_Name"; if (string.IsNullOrEmpty(key)) { nameKey = info.ReflectedType.Name + "_" + info.Name + "_Name"; } if (MultiLanguageTextProvider.HasKey(nameKey)) { ret.Title = new MultiLanguageString(nameKey); } else { ret.Title = NameAttribute.GetName(attributes); } var descKey = key + "_Desc"; if (string.IsNullOrEmpty(key)) { descKey = info.ReflectedType.Name + "_" + info.Name + "_Desc"; } if (MultiLanguageTextProvider.HasKey(descKey)) { ret.Description = new MultiLanguageString(descKey); } var treeNode = attributes.OfType <TreeNodeAttribute>().FirstOrDefault(); if (treeNode != null) { ret.TreeNodeID = treeNode.id; ret.TreeNodeType = treeNode.type; if (MultiLanguageTextProvider.HasKey(treeNode.key)) { ret.Title = new MultiLanguageString(treeNode.key); } else if (MultiLanguageTextProvider.HasKey(treeNode.key + "_Name")) { ret.Title = new MultiLanguageString(treeNode.key + "_Name"); } } return(ret); }
private static bool IsIndexer(PropertyInfo propertyInfo) { if (propertyInfo == null) throw new ArgumentNullException("propertyInfo"); var indexParameters = propertyInfo.GetIndexParameters(); return indexParameters != null && indexParameters.Length > 0 && indexParameters[0].ParameterType == typeof(string); }
/// <summary> /// GetPropertyValue /// </summary> protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) { return(propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture)); }
void chk_box_CheckedChanged(object sender, EventArgs e) { if (((CheckBox)sender).Checked) { if (list1item == null) { if (setupPropertyInfo(ref list1item, ((CheckBox)sender).Name, MainV2.cs)) list1curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list1, Color.Red, SymbolType.None); } else if (list2item == null) { if (setupPropertyInfo(ref list2item, ((CheckBox)sender).Name, MainV2.cs)) list2curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list2, Color.Blue, SymbolType.None); } else if (list3item == null) { if (setupPropertyInfo(ref list3item, ((CheckBox)sender).Name, MainV2.cs)) list3curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list3, Color.Green, SymbolType.None); } else if (list4item == null) { if (setupPropertyInfo(ref list4item, ((CheckBox)sender).Name, MainV2.cs)) list4curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list4, Color.Orange, SymbolType.None); } else if (list5item == null) { if (setupPropertyInfo(ref list5item, ((CheckBox)sender).Name, MainV2.cs)) list5curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list5, Color.Yellow, SymbolType.None); } else if (list6item == null) { if (setupPropertyInfo(ref list6item, ((CheckBox)sender).Name, MainV2.cs)) list6curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list6, Color.Magenta, SymbolType.None); } else if (list7item == null) { if (setupPropertyInfo(ref list7item, ((CheckBox)sender).Name, MainV2.cs)) list7curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list7, Color.Purple, SymbolType.None); } else if (list8item == null) { if (setupPropertyInfo(ref list8item, ((CheckBox)sender).Name, MainV2.cs)) list8curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list8, Color.LimeGreen, SymbolType.None); } else if (list9item == null) { if (setupPropertyInfo(ref list9item, ((CheckBox)sender).Name, MainV2.cs)) list9curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list9, Color.Cyan, SymbolType.None); } else if (list10item == null) { if (setupPropertyInfo(ref list10item, ((CheckBox)sender).Name, MainV2.cs)) list10curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list10, Color.Violet, SymbolType.None); } else { CustomMessageBox.Show("Max 10 at a time."); ((CheckBox)sender).Checked = false; } ThemeManager.ApplyThemeTo(this); string selected = ""; try { selected = selected + zg1.GraphPane.CurveList[0].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[1].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[2].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[3].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[4].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[5].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[6].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[7].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[8].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[9].Label.Text + "|"; selected = selected + zg1.GraphPane.CurveList[10].Label.Text + "|"; } catch { } MainV2.config["Tuning_Graph_Selected"] = selected; } else { // reset old stuff if (list1item != null && list1item.Name == ((CheckBox)sender).Name) { list1item = null; zg1.GraphPane.CurveList.Remove(list1curve); } if (list2item != null && list2item.Name == ((CheckBox)sender).Name) { list2item = null; zg1.GraphPane.CurveList.Remove(list2curve); } if (list3item != null && list3item.Name == ((CheckBox)sender).Name) { list3item = null; zg1.GraphPane.CurveList.Remove(list3curve); } if (list4item != null && list4item.Name == ((CheckBox)sender).Name) { list4item = null; zg1.GraphPane.CurveList.Remove(list4curve); } if (list5item != null && list5item.Name == ((CheckBox)sender).Name) { list5item = null; zg1.GraphPane.CurveList.Remove(list5curve); } if (list6item != null && list6item.Name == ((CheckBox)sender).Name) { list6item = null; zg1.GraphPane.CurveList.Remove(list6curve); } if (list7item != null && list7item.Name == ((CheckBox)sender).Name) { list7item = null; zg1.GraphPane.CurveList.Remove(list7curve); } if (list8item != null && list8item.Name == ((CheckBox)sender).Name) { list8item = null; zg1.GraphPane.CurveList.Remove(list8curve); } if (list9item != null && list9item.Name == ((CheckBox)sender).Name) { list9item = null; zg1.GraphPane.CurveList.Remove(list9curve); } if (list10item != null && list10item.Name == ((CheckBox)sender).Name) { list10item = null; zg1.GraphPane.CurveList.Remove(list10curve); } } }
/// <summary> /// SetPropertyValue /// </summary> protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) { propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture); }