/// <summary> /// Create List /// </summary> /// <param name="web"></param> /// <param name="title"></param> /// <param name="description"></param> /// <param name="typeList"></param> /// <param name="versionControl"></param> /// <param name="genericClass"></param> /// <returns></returns> public static bool CreateList(this SPWeb web, string title, string description, TypeList typeList, bool versionControl, Type genericClass) { try { var list = new ListSharePoint(web, Logger, title); ListTemplateType type; switch (typeList) { case TypeList.DocumentLibrary: type = ListTemplateType.DocumentLibrary; break; case TypeList.PictureLibrary: type = ListTemplateType.PictureLibrary; break; case TypeList.CalendarList: type = ListTemplateType.Events; break; default: type = ListTemplateType.GenericList; break; } var result = list.Create(description, type, versionControl); if (genericClass != null) AddFieldInList(list, genericClass); return result; } catch (Exception exception) { Logger.Error(string.Concat("Error Create List:", exception.Message)); return false; } }
private void InitializeTest(Type typeInLibraryToTest) { BaseType = typeof(ViewModelBase); AllTypes = new TypeList(); AllTypes.AddRange(typeInLibraryToTest.Assembly.GetTypes()); AllTypesToCheck = new TypeList(); DataTypesToCheck = new TypeList(); TypeProperties = new Dictionary<Type, PropertyInfo[]>(); foreach (Type currentType in AllTypes) { if (currentType.IsAbstract) continue; if (ReflectionUtil.IsClassOfType(currentType, BaseType)) { AllTypesToCheck.Add(currentType); if (ReflectionUtil.IsClassOfType(currentType, BaseType)) DataTypesToCheck.Add(currentType); PropertyInfo[] properties = currentType.GetProperties(); List<PropertyInfo> finalProperties = new List<PropertyInfo>(); foreach (PropertyInfo current in properties) { NotMappedAttribute notMappedAttribute = current.GetCustomAttribute<NotMappedAttribute>(); if (notMappedAttribute != null) continue; finalProperties.Add(current); } TypeProperties.Add(currentType, finalProperties.ToArray()); } } }
public void Should_Only_Add_True_Types() { var list = new TypeList<IMyInterface>(); list.Add<MyClass1>(); list.Add(typeof(MyClass2)); Assert.Throws<ArgumentException>(() => list.Add(typeof(MyClass3))); }
public void Foo3() { ITypeList<TypeParent> lt = new TypeList<TypeParent>(); lt.Add<TypeParent>(); lt.Add(typeof(TypeChild)); lt.Add(typeof(int)); //lt.Add(new TypeParent { strP = "parent" }); //lt.Add(new TypeChild { strP = "child" }); lt.ToList().ForEach((t) => { Console.WriteLine(t.ToString()); }); }
public Plotter(int xsize, int ysize, TypeTabulator d, TypeList tl) { this.xsize = xsize; this.ysize = ysize; this.d = d; this.tl = tl; this.Profile = d.Profile; FixupData (); }
public void TypeListSerializationTest() { TypeList dataToSerialize = new TypeList(); byte[] data = SerializationUtil.SerializeData(dataToSerialize); Assert.IsNotNull(data); Assert.AreNotEqual(0, data.Length); TypeList deserializedData = SerializationUtil.DeserializeData<TypeList>(data); Assert.IsNotNull(deserializedData); Assert.AreNotSame(dataToSerialize, deserializedData); }
/// <summary> /// Returns a BuiltinFunction bound to the provided type arguments. Returns null if the binding /// cannot be performed. /// </summary> internal BuiltinFunction MakeGenericMethod(Type[] types) { TypeList tl = new TypeList(types); // check for cached method first... BuiltinFunction bf; if (_data.BoundGenerics != null) { lock (_data.BoundGenerics) { if (_data.BoundGenerics.TryGetValue(tl, out bf)) { return(bf); } } } // Search for generic targets with the correct arity (number of type parameters). // Compatible targets must be MethodInfos by definition (constructors never take // type arguments). List <MethodBase> targets = new List <MethodBase>(Targets.Count); foreach (MethodBase mb in Targets) { MethodInfo mi = mb as MethodInfo; if (mi == null) { continue; } if (mi.ContainsGenericParameters && mi.GetGenericArguments().Length == types.Length) { targets.Add(mi.MakeGenericMethod(types)); } } if (targets.Count == 0) { return(null); } // Build a new ReflectedMethod that will contain targets with bound type arguments & cache it. bf = new BuiltinFunction(Name, targets.ToArray(), DeclaringType, FunctionType); EnsureBoundGenericDict(); lock (_data.BoundGenerics) { _data.BoundGenerics[tl] = bf; } return(bf); }
public void Property() { var td = new TypeList <IServiceCollection> { typeof(ServiceCollection) }; td.Count.ShouldBe(1); td.IsReadOnly.ShouldBeFalse(); td[0].ShouldBe(typeof(ServiceCollection)); Should.Throw <ArgumentException>(() => td[0] = typeof(ServiceProvider)); Should.NotThrow(() => td[0] = typeof(IServiceCollection)); td.IsReadOnly.ShouldBeFalse(); td[0].ShouldBe(typeof(IServiceCollection)); }
public void GhiFile <T>(DanhSachHinhHoc danhSachHinhHoc, TypeList typeList) { StringBuilder str = new StringBuilder(); StringBuilder filename = new StringBuilder(); StringBuilder kq = new StringBuilder(); DanhSachHinhHoc result = new DanhSachHinhHoc(); switch (typeList) { case TypeList.HinhVuong: str.Append("hinhvuong"); filename.Append(str + ".txt"); result.ListHinhHoc = DanhSachTheoKieuHinh <T>(danhSachHinhHoc); kq.Append($"\n\n\t\t\tDANH SACH {str.ToString().ToUpper()}\n{result}\n"); break; case TypeList.HinhTron: str.Append("hinhtron"); filename.Append(str + ".txt"); result.ListHinhHoc = DanhSachTheoKieuHinh <T>(danhSachHinhHoc); kq.Append($"\n\n\t\t\tDANH SACH {str.ToString().ToUpper()}\n{result}\n"); break; case TypeList.HinhChuNhat: str.Append("hinhchunhat"); filename.Append(str + ".txt"); result.ListHinhHoc = DanhSachTheoKieuHinh <T>(danhSachHinhHoc); kq.Append($"\n\n\t\t\tDANH SACH {str.ToString().ToUpper()}\n{result}\n"); break; case TypeList.TatCaHinh: str.Append("tatcahinh"); filename.Append(str + ".txt"); kq.Append($"\t\t\tBANG TONG HOP THONG TIN\n1) Tong so cac doi tuong hinh hoc la: {DemTheoHinh<HinhHoc>(danhSachHinhHoc)}\n"); kq.Append($"2) Tong so hinh tron la: {DemTheoHinh<HinhTron>(danhSachHinhHoc)}\n"); kq.Append($"3) Tong so hinh vuong la: {DemTheoHinh<HinhVuong>(danhSachHinhHoc)}\n"); kq.Append($"4) Tong so hinh chu nhat la {DemTheoHinh<HinhChuNhat>(danhSachHinhHoc)}\n"); result.ListHinhHoc = DanhSachTheoKieuHinh <HinhTron>(danhSachHinhHoc); kq.Append($"\nA. Danh sach hinh tron\n{result}"); result.ListHinhHoc = DanhSachTheoKieuHinh <HinhVuong>(danhSachHinhHoc); kq.Append($"\n\nB. Danh sach hinh vuong\n{result}"); result.ListHinhHoc = DanhSachTheoKieuHinh <HinhChuNhat>(danhSachHinhHoc); kq.Append($"\n\nC. Danh sach hinh chu nhat\n{result}\n"); break; } using (StreamWriter file = new StreamWriter(filename.ToString(), append: false)) // FileMode.Append, FileAccess.Write) { file.Write(kq); } }
/////////////////////////////////////////////////////////////////////// public ReturnCode ListChangeTypes( ref TypeList types, ref Result error ) { CheckDisposed(); if (parentBinder == null) { throw new InvalidOperationException(); } return(parentBinder.ListChangeTypes(ref types, ref error)); }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.AspNetPager1.PageSize = NBasePage.pagesize; TypeList.BindDrop(this.dropPrjKindClass, "ProjectType", "", null, true); TypeList.BindDrop(this.dropPrjState, false, "", null, new System.Collections.Generic.List <int> { 5, 6 }); this.bindGv(); } }
public IActionResult Delete(int IdP) { var TypeAux = TypeList.GetType(IdP); if (TypeAux == null) { return(NotFound()); } if (!TypeList.RemoveType(IdP)) { return(BadRequest()); } return(Ok("Type removed!")); }
public questStatus Update(DbMgrTransaction trans, TypeList typeList) { // Initialize questStatus status = null; // Update typeList status = _dbTypeListsMgr.Update(trans, typeList); if (!questStatusDef.IsSuccess(status)) { return(status); } return(new questStatus(Severity.Success)); }
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { catalogItems = await CatalogItemListPaged.HandleAsync(50); catalogTypes = await TypeList.HandleAsync(); catalogBrands = await BrandList.HandleAsync(); CallRequestRefresh(); } await base.OnAfterRenderAsync(firstRender); }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.AspNetPager1.PageSize = NBasePage.pagesize; TypeList.BindDrop(this.dropPrjKindClass, "ProjectType", "", null, true); TypeList.BindDrop(this.dropPrjState, false, "", null, new System.Collections.Generic.List <int> { int.Parse(ProjectParameter.Initiate), int.Parse(ProjectParameter.Prequalification) }); this.hfldUserCode.Value = base.UserCode; this.bindGv(); } }
private void addChildNode(TypeList parenttype, TreeNode parentNode) { foreach (TypeList type in list) { if (type.parentname == parenttype.typename) { TreeNode node = new TreeNode(); node.Name = type.parentname; node.Text = type.typename + "," + type.typeinfo; node.Tag = type.typename; parentNode.Nodes.Add(node); addChildNode(type, node); } } }
private void GenerateComboBoxes() { CategoryList.Add("Engine"); CategoryList.Add("Tyres"); CategoryList.Add("Paint"); CategoryList.Add("Doors"); TypeList.Add("Car"); TypeList.Add("Truck"); TypeList.Add("Bus"); PriorityList.Add("1"); PriorityList.Add("2"); PriorityList.Add("3"); }
public questStatus Read(TypeListId typeListId, out TypeList typeList) { // Initialize typeList = null; questStatus status = null; // Read typeList status = _dbTypeListsMgr.Read(typeListId, out typeList); if (!questStatusDef.IsSuccess(status)) { return(status); } return(new questStatus(Severity.Success)); }
public void Remove_T() { var td = new TypeList <IServiceCollection> { typeof(ServiceCollection) }; td.Count.ShouldBe(1); td.ShouldContain(typeof(ServiceCollection)); Should.NotThrow(() => td.Remove <IServiceCollection>()).ShouldBeFalse(); td.Count.ShouldBe(1); td.ShouldContain(typeof(ServiceCollection)); Should.NotThrow(() => td.Remove <ServiceCollection>()).ShouldBeTrue(); td.Count.ShouldBe(0); td.ShouldNotContain(typeof(ServiceCollection)); }
public questStatus Create(DbMgrTransaction trans, TypeList typeList, out TypeListId typeListId) { // Initialize typeListId = null; questStatus status = null; // Create typeList status = _dbTypeListsMgr.Create(trans, typeList, out typeListId); if (!questStatusDef.IsSuccess(status)) { return(status); } return(new questStatus(Severity.Success)); }
protected void bindDrop() { TypeList.BindDrop(this.drpDLstState, false, "", null, new System.Collections.Generic.List <int> { 1, 2, 3, 4, 5, 6, 15, 16, 19 }); }
/// <summary> /// 将类型转化为读取类型 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public static TypeList GetType <T>() { TypeList result = TypeList.UnKnow; switch (System.Type.GetTypeCode(typeof(T))) { case TypeCode.Object: result = TypeList.Bytes; break; case TypeCode.Int64: result = TypeList.Long; break; case TypeCode.Byte: result = TypeList.Byte; break; case TypeCode.String: result = TypeList.String; break; case TypeCode.Double: result = TypeList.Double; break; case TypeCode.UInt16: result = TypeList.UShort; break; case TypeCode.Int32: result = TypeList.Int; break; case TypeCode.Single: result = TypeList.Float; break; case TypeCode.Boolean: result = TypeList.Boolean; break; case TypeCode.DateTime: result = TypeList.DateTime; break; } return(result); }
public void dropBind() { TypeList.BindDrop(this.dropBudgetWay, "ysType", "", null, true); TypeList.BindDrop(this.dropContractWay, "cbType", "", null, true); TypeList.BindDrop(this.dropKeyPart, "primaryGrade", "", null, true); TypeList.BindDrop(this.dropPayCondition, "payment", "", null, true); TypeList.BindDrop(this.dropPayWay, "jsType", "", null, true); TypeList.BindDrop(this.dropPrjKindClass, "ProjectType", "", null, true); TypeList.BindDrop(this.dropQualityClass, "ProjectQuality", "", null, true); TypeList.BindDrop(this.dropRank, "zzGrade", "", null, true); TypeList.BindDrop(this.dropTenderWay, "zbType", "", null, true); TypeList.BindDrop(this.dropProperty, "ProjectProperty", "", null, true); TypeList.BindBuildingTypeDrop(this.dropBuildingType_0); TypeList.BindXmgroupDrop(this.dropXmgroup); this.BindProvice(); }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.AspNetPager1.PageSize = NBasePage.pagesize; int[] prjTypeCodes = new int[] { 5, 7, 17 }; TypeList.BindDrop(this.dropPrjState, prjTypeCodes, "", null); this.BindFlowState(); this.bindGv(); } }
public void Action() { var action = new ProxyConventionalAction(); var services = new ServiceCollection(); var types = new List <Type> { typeof(TestProxiedService) }; var interceptor = new TypeList <IInterceptor>(); Expression <Func <Type, bool> > typePredicate = t => true; interceptor.Add <TestInterceptor>(); var context = new ProxyConventionalActionContext(services, types, typePredicate, interceptor); Should.NotThrow(() => action.Action(context)); services.GetSingletonInstance <ServiceInterceptorList>().GetInterceptors(typeof(TestProxiedService)).ShouldHaveSingleItem().ShouldBe(typeof(TestInterceptor)); }
protected void bindDrop() { TypeList.BindDrop(this.dropPrjState, false, "", null, new System.Collections.Generic.List <int> { 1, 2, 3, 4, 6, 14, 15, 16, 19 }); TypeList.BindDrop(this.dropPrjType, "ProjectType", "", null, true); }
public ActionResult <Type> Get(int IdP) { try { var TypeAux = TypeList.GetType(IdP).First(); if (TypeAux == null) { return(BadRequest()); } return(Ok(TypeAux)); } catch (InvalidOperationException) { return(NotFound()); } }
/// <summary> /// Initializes a new instance of the <see cref="CSharpCloneOfExpression"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="source">The Easly expression from which the C# expression is created.</param> protected CSharpCloneOfExpression(ICSharpContext context, ICloneOfExpression source) : base(context, source) { SourceExpression = Create(context, (IExpression)source.Source); IResultType SourceResult = SourceExpression.Source.ResolvedResult.Item; Debug.Assert(SourceResult.Count > 0); foreach (IExpressionType ExpressionType in SourceResult) { ICompiledType ClonedType = ExpressionType.ValueType; ICSharpType Type = CSharpType.Create(context, ClonedType); TypeList.Add(Type); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.AspNetPager1.PageSize = NBasePage.pagesize; TypeList.BindDrop(this.dropPrjKindClass, "ProjectType", "", null, true); TypeList.BindDrop(this.dropPrjProperty, "ProjectProperty", "", null, true); this.bindGv(); string text = base.Request.UrlReferrer.ToString(); if (text.Contains("/TenderManage/InfoAdd.aspx?Action=Add") && !string.IsNullOrEmpty(base.Request["returnMsg"])) { string msg = base.Request["returnMsg"].ToString(); base.RegisterShow("系统提示", msg); } } }
public override string QueryResult() { JsonModel model = new JsonModel(); DataTable table = null; JsonData data = new JsonData(); List <TypeList> typeList = new List <TypeList>(); data.data = new InnerData(); data.data.TypeList = typeList; DataTable tblReading = null; ParamModel param = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(this.Data); TF.RunSafty.BLL.TAB_FileGroup bllGroup = new TF.RunSafty.BLL.TAB_FileGroup(); TF.RunSafty.BLL.TAB_ReadDocPlan bllPlan = new TF.RunSafty.BLL.TAB_ReadDocPlan(); try { string where = string.Format(" strTypeName='{0}'", "记名式传达"); table = bllGroup.GetList(where).Tables[0]; //table = bllGroup.GetAllList().Tables[0]; if (table != null) { foreach (DataRow row in table.Rows) { TypeList list = new TypeList(); list.strTypeGUID = row["strTypeGUID"].ToString(); list.strTypeName = row["strTypeName"].ToString(); tblReading = bllPlan.GetReadingHistoryOfTrainman(param.strTrainmanGUID, list.strTypeGUID); list.FileList = tblReading; typeList.Add(list); } } model.result = "0"; model.returnStr = "返回成功"; model.Data = data; } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); } Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string result = Newtonsoft.Json.JsonConvert.SerializeObject(model, timeConverter).Replace(":null", ":\"\""); return(result); }
/// <summary> /// Returns a BuiltinFunction bound to the provided type arguments. Returns null if the binding /// cannot be performed. /// </summary> public MethodGroup MakeGenericMethod(Type[] types) { TypeList tl = new TypeList(types); // check for cached method first... MethodGroup mg; if (_boundGenerics != null) { lock (_boundGenerics) { if (_boundGenerics.TryGetValue(tl, out mg)) { return(mg); } } } // Search for generic targets with the correct arity (number of type parameters). // Compatible targets must be MethodInfos by definition (constructors never take // type arguments). List <MethodTracker> targets = new List <MethodTracker>(Methods.Count); foreach (MethodTracker mt in Methods) { MethodInfo mi = mt.Method; if (mi.ContainsGenericParameters && mi.GetGenericArguments().Length == types.Length) { targets.Add((MethodTracker)MemberTracker.FromMemberInfo(mi.MakeGenericMethod(types))); } } if (targets.Count == 0) { return(null); } // Build a new MethodGroup that will contain targets with bound type arguments & cache it. mg = new MethodGroup(targets.ToArray()); EnsureBoundGenericDict(); lock (_boundGenerics) { _boundGenerics[tl] = mg; } return(mg); }
internal void Search(string Name) { if (TypeList == null) { TypeList = typeBusiness.Read(); } if (TypeDictionary == null) { TypeDictionary = TypeList.ToDictionary(tp => tp.Name, tp => tp); } var results = TypeDictionary.Where(typePlan => typePlan.Key.Contains(Name)).Select(typePlan => typePlan.Value); foreach (var item in results) { Console.WriteLine(item.ToString()); } }
public override void Init() { var converterInstance = (ComponentType) new VegetableConverter(); //Register the component var componentTypeList = TypeList <ComponentType, ComponentTypeList> .getInstance(); componentTypeList.add(converterInstance); //Add the component to the biodome. Unfortunately this also must be done with reflection var bioDome = TypeList <ModuleType, ModuleTypeList> .find <ModuleTypeBioDome>(); var newComponentList = bioDome.mComponentTypes.ToList(); newComponentList.Add(converterInstance); bioDome.mComponentTypes = newComponentList.ToArray(); }
/// <summary> /// This function is the loading function for the types /// </summary> protected virtual void LoadTypes() { TypeList.Add(new DBTypeMapEntry(typeof(bool), DbType.Boolean)); TypeList.Add(new DBTypeMapEntry(typeof(byte), DbType.Binary)); TypeList.Add(new DBTypeMapEntry(typeof(byte[]), DbType.Binary)); TypeList.Add(new DBTypeMapEntry(typeof(DateTime), DbType.DateTime2)); TypeList.Add(new DBTypeMapEntry(typeof(Decimal), DbType.Decimal)); TypeList.Add(new DBTypeMapEntry(typeof(double), DbType.Double)); TypeList.Add(new DBTypeMapEntry(typeof(Guid), DbType.Guid)); TypeList.Add(new DBTypeMapEntry(typeof(Int16), DbType.Int16)); TypeList.Add(new DBTypeMapEntry(typeof(Int32), DbType.Int32)); TypeList.Add(new DBTypeMapEntry(typeof(Int64), DbType.Int64)); TypeList.Add(new DBTypeMapEntry(typeof(long), DbType.Int64)); TypeList.Add(new DBTypeMapEntry(typeof(object), DbType.Object)); TypeList.Add(new DBTypeMapEntry(typeof(string), DbType.String)); TypeList.Add(new DBTypeMapEntry(typeof(DataTable), DbType.Object)); }
public virtual void BuildControllerList() { var h = XafTypesInfo.Instance.PersistentTypes.Where(pt => pt.FindAttribute <MergeableAttribute>() != null); foreach (ITypeInfo item in h) { Type t = item.Type; Type generic = typeof(Merger <>); Type genericType = generic.MakeGenericType(new System.Type[] { t }); Type genericBasicMergerVC = typeof(MergerViewController <>); Type genericMergerVC = genericBasicMergerVC.MakeGenericType(new System.Type[] { t }); TypeList.Add(genericMergerVC); Type genericBaseControllerType = typeof(MergerGenericViewController <,>); Type genericControllerType = genericBaseControllerType.MakeGenericType(new Type[] { t, genericType }); TypeList.Add(genericControllerType); } }
//This function loads the MySQL types protected override void LoadTypes() { TypeList.Add(new MySQLDBTypeMapEntry(typeof(bool), DbType.Boolean, MySqlDbType.Bit)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(byte), DbType.Binary, MySqlDbType.Byte)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(byte[]), DbType.Binary, MySqlDbType.VarBinary)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(DateTime), DbType.DateTime2, MySqlDbType.DateTime)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(Decimal), DbType.Decimal, MySqlDbType.Decimal)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(double), DbType.Double, MySqlDbType.Float)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(Guid), DbType.Guid, MySqlDbType.Guid)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(Int16), DbType.Int16, MySqlDbType.Int16)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(Int32), DbType.Int32, MySqlDbType.Int32)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(Int64), DbType.Int64, MySqlDbType.Int64)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(long), DbType.Int64, MySqlDbType.Int64)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(object), DbType.Object, MySqlDbType.Blob)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(string), DbType.String, MySqlDbType.VarChar)); TypeList.Add(new MySQLDBTypeMapEntry(typeof(DataTable), DbType.Object, MySqlDbType.Blob)); }
public AuthorizationConfiguration() { Providers = new TypeList<AuthorizationProvider>(); }
static JsonConverter() { SupportedTypeDefinitions = new TypeList(); SupportedTypeDefinitions.Add(typeof(Object)); }
/// <summary> /// Sets the ReportTypeList property /// </summary> /// <param name="reportTypeList">ReportTypeList property</param> /// <returns>this instance</returns> public CancelReportRequestsRequest WithReportTypeList(TypeList reportTypeList) { this.reportTypeListField = reportTypeList; return this; }
/// <summary> /// Returns a BuiltinFunction bound to the provided type arguments. Returns null if the binding /// cannot be performed. /// </summary> public MethodGroup MakeGenericMethod(Type[] types) { TypeList tl = new TypeList(types); // check for cached method first... MethodGroup mg; if (_boundGenerics != null) { lock (_boundGenerics) { if (_boundGenerics.TryGetValue(tl, out mg)) { return mg; } } } // Search for generic targets with the correct arity (number of type parameters). // Compatible targets must be MethodInfos by definition (constructors never take // type arguments). List<MethodTracker> targets = new List<MethodTracker>(Methods.Count); foreach (MethodTracker mt in Methods) { MethodInfo mi = mt.Method; if (mi.ContainsGenericParameters && mi.GetGenericArguments().Length == types.Length) targets.Add((MethodTracker)MemberTracker.FromMemberInfo(mi.MakeGenericMethod(types))); } if (targets.Count == 0) { return null; } // Build a new MethodGroup that will contain targets with bound type arguments & cache it. mg = new MethodGroup(targets.ToArray()); EnsureBoundGenericDict(); lock (_boundGenerics) { _boundGenerics[tl] = mg; } return mg; }
public TypeListNodeStore(TypeList tl) : base(typeof (TypeListTreeNode)) { this.tl = tl; for (int i = tl.Sizes.Length - 1; i >= 0; i --) AddNode (new TypeListTreeNode (tl, i)); }
public TypeGraphComponent(Profile p) { Profile = p; Title = "Type Graph"; box = new VBox (); box.Spacing = 12; paned = new HPaned (); Add (box); scroller = new HeapScroller (p); scroller.OnScrolled += delegate { t = null; d.UpdateCache (); d.QueueDraw (); }; box.PackStart (scroller, false, false, 0); tl = new TypeList (p); d = new TypeGrpah (tl, this); ScrolledWindow sw = new ScrolledWindow (); sw.Add (new TypeListNodeStore (tl).GetNodeView ()); paned.Pack1 (d, true, true); paned.Pack2 (sw, false, true); box.PackStart (paned, true, true, 0); }
/// <summary> /// Create List /// </summary> /// <param name="web"></param> /// <param name="title"></param> /// <param name="description"></param> /// <param name="typeList"></param> /// <param name="versionControl"></param> /// <returns></returns> public static bool CreateList(this SPWeb web, string title, string description, TypeList typeList, bool versionControl) { return CreateList(web, title, description, typeList, versionControl, null); }
/// <summary> /// Sets the FeedTypeList property /// </summary> /// <param name="feedTypeList">FeedTypeList property</param> /// <returns>this instance</returns> public GetFeedSubmissionCountRequest WithFeedTypeList(TypeList feedTypeList) { this.feedTypeListField = feedTypeList; return this; }
/// <summary> /// Sets the ReportTypeList property /// </summary> /// <param name="reportTypeList">ReportTypeList property</param> /// <returns>this instance</returns> public GetReportCountRequest WithReportTypeList(TypeList reportTypeList) { this.reportTypeListField = reportTypeList; return this; }
public SettingsConfiguration() { Providers = new TypeList<SettingProvider>(); }
public CCTypeFee() { CCTypes = new TypeList<string>(); }
public AuthorizationConfiguration() { Providers = new TypeList<AuthorizationProvider>(); IsEnabled = true; }
public TypeListTreeNode(TypeList tl, int idx) { this.tl = tl; this.idx = idx; }
/// <summary> /// Returns a BuiltinFunction bound to the provided type arguments. Returns null if the binding /// cannot be performed. /// </summary> internal BuiltinFunction MakeGenericMethod(Type[] types) { TypeList tl = new TypeList(types); // check for cached method first... BuiltinFunction bf; if(data.BoundGenerics != null){ lock(data.BoundGenerics){ if(data.BoundGenerics.TryGetValue(tl, out bf)) return bf; } } // Search for generic targets with the correct arity (number of type parameters). // Compatible targets must be MethodInfos by definition (constructors never take // type arguments). List<MethodBase> targets = new List<MethodBase>(Targets.Count); foreach(MethodBase mb in Targets){ MethodInfo mi = mb as MethodInfo; if(mi == null) continue; if(mi.ContainsGenericParameters && mi.GetGenericArguments().Length == types.Length) targets.Add(mi.MakeGenericMethod(types)); } if(targets.Count == 0) return null; // Build a new ReflectedMethod that will contain targets with bound type arguments & cache it. bf = new BuiltinFunction(Name, targets.ToArray(), DeclaringType, FunctionType.Method); EnsureBoundGenericDict(); lock(data.BoundGenerics) data.BoundGenerics[tl] = bf; return bf; }
public void ExtensionsTypeIsNumericTest() { TypeList numericTypesToCheck = new TypeList(); TypeList typesToCheck = new TypeList(); numericTypesToCheck.AddRange(typeof(char), typeof(int), typeof(decimal), typeof(double), typeof(Single), typeof(long), typeof(byte)); typesToCheck.AddRange(typeof(object), typeof(string), typeof(TypeList)); foreach (Type typeToCheck in numericTypesToCheck) { Assert.IsTrue(typeToCheck.IsNumeric()); Assert.IsFalse(typeToCheck.IsNotNumeric()); } foreach (Type typeToCheck in typesToCheck) { Assert.IsFalse(typeToCheck.IsNumeric()); Assert.IsTrue(typeToCheck.IsNotNumeric()); } }
public void TypeListConstructor() { TypeList list = new TypeList(); Assert.IsTrue(list.IsUniqueList, "List Uniqueness Failure"); }
public TypeGrpah(TypeList tl, TypeGraphComponent parent) { Events |= Gdk.EventMask.ButtonPressMask; this.tl = tl; this.parent = parent; SetSizeRequest (700, 700); }
public NavigationConfiguration() { Providers = new TypeList<NavigationProvider>(); }
/// <summary> /// Sets the FeedTypeList property /// </summary> /// <param name="feedTypeList">FeedTypeList property</param> /// <returns>this instance</returns> public CancelFeedSubmissionsRequest WithFeedTypeList(TypeList feedTypeList) { this.feedTypeListField = feedTypeList; return this; }