public TypeMap CreateTypeMap(Type sourceType, Type destinationType, ProfileMap options, MemberList memberList) { var sourceTypeInfo = options.CreateTypeDetails(sourceType); var destTypeInfo = options.CreateTypeDetails(destinationType); var typeMap = new TypeMap(sourceTypeInfo, destTypeInfo, memberList, options); foreach (var destProperty in destTypeInfo.PublicWriteAccessors) { var resolvers = new LinkedList<MemberInfo>(); if (MapDestinationPropertyToSource(options, sourceTypeInfo, destProperty.DeclaringType, destProperty.GetMemberType(), destProperty.Name, resolvers)) { typeMap.AddPropertyMap(destProperty, resolvers); } } if (!destinationType.IsAbstract() && destinationType.IsClass()) { foreach (var destCtor in destTypeInfo.Constructors.OrderByDescending(ci => ci.GetParameters().Length)) { if (MapDestinationCtorToSource(typeMap, destCtor, sourceTypeInfo, options)) { break; } } } return typeMap; }
//internal static ICollection<IChildMemberConfiguration> sourceToDestinationMemberMappers = new Collection<IChildMemberConfiguration> //{ // // Need to do it fixie way for prefix and postfix to work together + not specify match explicitly // // Have 3 properties for Members, Methods, And External Methods // // Parent goes to all // new MemberConfiguration().AddMember<NameSplitMember>().AddName<PrePostfixName>(_ => _.AddStrings(p => p.Prefixes, "Get")).SetMemberInfo<AllMemberInfo>(), // //new CustomizedSourceToDestinationMemberMapper().MemberNameMatch().ExtensionNameMatch().ExtensionPrefix("Get").MethodPrefix("Get").MethodNameMatch(), //}; //internal static readonly ICollection<IChildMemberConfiguration> def = sourceToDestinationMemberMappers.ToList(); public TypeMap CreateTypeMap(Type sourceType, Type destinationType, IProfileConfiguration options, MemberList memberList) { var sourceTypeInfo = GetTypeInfo(sourceType, options); var destTypeInfo = GetTypeInfo(destinationType, options); var typeMap = new TypeMap(sourceTypeInfo, destTypeInfo, memberList); foreach (var destProperty in destTypeInfo.PublicWriteAccessors) { var members = new LinkedList<MemberInfo>(); if (MapDestinationPropertyToSource(options, sourceTypeInfo, destProperty.GetType(), destProperty.Name, members)) { var resolvers = members.Select(mi => ReflectionHelper.ToMemberGetter(mi)); var destPropertyAccessor = ReflectionHelper.ToMemberAccessor(destProperty); typeMap.AddPropertyMap(destPropertyAccessor, resolvers.Cast<IValueResolver>()); } } if (!TypeExtensions.IsAbstract(destinationType) && TypeExtensions.IsClass(destinationType)) { foreach (var destCtor in destTypeInfo.Constructors.OrderByDescending(ci => ci.GetParameters().Length)) { if (MapDestinationCtorToSource(typeMap, destCtor, sourceTypeInfo, options)) { break; } } } return typeMap; }
void SymbolTableUpdateEventHandler(Compilation updatedSymbolTable, UpdateSpecification updateSpecification, MemberList changedMembers){ lock(this){ Thread savedCurrentThread = this.currentThread; if (Thread.CurrentThread == this.currentThread) Console.WriteLine("Update event called on same thread as the one causing the update"); if (!Thread.CurrentThread.IsThreadPoolThread) Console.WriteLine("Updated event called from a non thread pool thread"); if (!Thread.CurrentThread.IsBackground) Console.WriteLine("Updated event called from a non background thread"); this.currentThread = Thread.CurrentThread; if (updatedSymbolTable == null){Console.WriteLine("SymbolTable update with null value for updatedSymbolTable"); return;} if (updatedSymbolTable.TargetModule == null){Console.WriteLine("SymbolTable update with null value for updatedSymbolTable.TargetModule"); return;} Console.WriteLine("Received update event on symbol table: {0}", ((Compilation)updateSpecification.Original).TargetModule.Name); for (int i = 0, n = changedMembers == null ? 0 : changedMembers.Count; i < n; i++){ Member mem = changedMembers[i]; if (mem == null) Console.WriteLine("changedMembers[{0}] == null", i); else Console.WriteLine("changedMembers[{0}].FullName == {1}", i, mem.FullName); } for (int i = 0, n = this.compilations.Count; i < n; i++){ Compilation compilation = this.compilations[i]; if (compilation == null || compilation == updateSpecification.Original) continue; for (int j = 0, m = compilation.ReferencedCompilations == null ? 0 : compilation.ReferencedCompilations.Count; j < m; j++){ Compilation rComp = compilation.ReferencedCompilations[j]; if (rComp != updateSpecification.Original) continue; Compilation upd = this.compiler.UpdateSymbolTable(compilation, (Compilation)updateSpecification.Original, updatedSymbolTable, changedMembers, this.errors); if (upd == null){ Console.WriteLine("Referenced compilation {0} was not updated", j); }else this.CheckUpdatedCompilation(compilation, upd); } } this.currentThread = savedCurrentThread; } }
public TypeMap CreateTypeMap(Type sourceType, Type destinationType, IMappingOptions options, MemberList memberList) { var sourceTypeInfo = GetTypeInfo(sourceType, options); var destTypeInfo = GetTypeInfo(destinationType, options.ShouldMapProperty, options.ShouldMapField, new MethodInfo[0]); var typeMap = new TypeMap(sourceTypeInfo, destTypeInfo, memberList); foreach (var destProperty in destTypeInfo.PublicWriteAccessors) { var members = new LinkedList<MemberInfo>(); if (MapDestinationPropertyToSource(members, sourceTypeInfo, destProperty.Name, options)) { var resolvers = members.Select(mi => mi.ToMemberGetter()); var destPropertyAccessor = destProperty.ToMemberAccessor(); typeMap.AddPropertyMap(destPropertyAccessor, resolvers.Cast<IValueResolver>()); } } if (!destinationType.IsAbstract() && destinationType.IsClass()) { foreach (var destCtor in destTypeInfo.Constructors.OrderByDescending(ci => ci.GetParameters().Length)) { if (MapDestinationCtorToSource(typeMap, destCtor, sourceTypeInfo, options)) { break; } } } return typeMap; }
public override MemberList Process(WebClient client) { MemberList ml = new MemberList(); String content = client.DownloadString(GetUrl()); MatchCollection mc = Regex.Matches(content, "<option value=\"(\\d+)\">(.+?)</option>"); foreach (Match m in mc) { String id = m.Groups[1].Value; String name = m.Groups[2].Value; if (id != "0") { CategoryTop c = new CategoryTop(); c.Name = name; c.Id = id; Children.Add(c); ml.Add(c); } } Unprocessed = false; return ml; }
public void showChildWindow(AdminService.MemberList info) { UserID = info.UserID; org = info; memList = ModelCopy.CopyValueForModel<MemberList>(info); base.Show(); }
public TypeMap(TypeInfo sourceType, TypeInfo destinationType, MemberList memberList) { _sourceType = sourceType; _destinationType = destinationType; Profile = ConfigurationStore.DefaultProfileName; ConfiguredMemberList = memberList; }
public TypeMap CreateTypeMap(Type sourceType, Type destinationType, IProfileConfiguration options, MemberList memberList) { var sourceTypeInfo = GetTypeInfo(sourceType, options); var destTypeInfo = GetTypeInfo(destinationType, options); var typeMap = new TypeMap(sourceTypeInfo, destTypeInfo, memberList, options.ProfileName); foreach (var destProperty in destTypeInfo.PublicWriteAccessors) { var resolvers = new LinkedList<IValueResolver>(); if (MapDestinationPropertyToSource(options, sourceTypeInfo, destProperty.GetMemberType(), destProperty.Name, resolvers)) { var destPropertyAccessor = destProperty.ToMemberAccessor(); typeMap.AddPropertyMap(destPropertyAccessor, resolvers); } } if (!destinationType.IsAbstract() && destinationType.IsClass()) { foreach (var destCtor in destTypeInfo.Constructors.OrderByDescending(ci => ci.GetParameters().Length)) { if (MapDestinationCtorToSource(typeMap, destCtor, sourceTypeInfo, options)) { break; } } } return typeMap; }
public TypeMap(TypeDetails sourceType, TypeDetails destinationType, MemberList memberList) { _sourceType = sourceType; _destinationType = destinationType; Types = new TypePair(sourceType.Type, destinationType.Type); Profile = ConfigurationStore.DefaultProfileName; ConfiguredMemberList = memberList; }
public TypeMap(TypeDetails sourceType, TypeDetails destinationType, MemberList memberList, ProfileMap profile) { SourceTypeDetails = sourceType; DestinationTypeDetails = destinationType; Types = new TypePair(sourceType.Type, destinationType.Type); Profile = profile; ConfiguredMemberList = memberList; }
public MemberList GetUnprocessedChildren() { MemberList ml = new MemberList(); Children.ForEach(delegate(AbstractMember m) { ml.AddRange(m.GetUnprocessedChildren()); }); return ml; }
public override MemberList Process(WebClient client) { MemberList ml = new MemberList(); String content = client.DownloadString(GetUrl()); MatchCollection mc = Regex.Matches(content, "<a href=\"http://baki\\.info/subcat/(\\d+)\" class=\"sc_listone\">.*?<span class=\"csc_sub_name\"><div class=\"title_inner\">(.+?)</div>", RegexOptions.Singleline); if (mc.Count > 0) { // process sub categories foreach (Match m in mc) { CategorySub c = new CategorySub(); c.Id = m.Groups[1].Value; c.Name = m.Groups[2].Value.Replace(" ", " ").Replace("&", "&").Trim(); Children.Add(c); ml.Add(c); } Unprocessed = false; } else { // process products content = client.DownloadString(ProductsUrl(page)); MatchCollection mc1 = Regex.Matches(content, "<div class=\"cop_title\"><h3><a href=\"(.+?)\">(.+?)</a></h3></div>"); foreach (Match m in mc1) { Product p = new Product(); p.Name = m.Groups[2].Value.Replace(" ", " ").Replace("&", "&").Trim(); p.Url = m.Groups[1].Value; Children.Add(p); ml.Add(p); } MatchCollection mc2 = Regex.Matches(content, "new Paginator\\('paginator1', (\\d+?), \\d+, (\\d+?), \"#\"\\);"); String total = mc2[0].Groups[1].Value; String current = mc2[0].Groups[2].Value; if (page < Int16.Parse(total)) { Page++; ml.Add(this); } else { Unprocessed = false; } } return ml; }
public Facede(Bll.Facede Application) { column = new Column(Application); corporationList = new CorporationList(Application); list = new List(Application); listColumn = new ListColumn(Application); listItem = new ListItem(Application); memberList = new MemberList(Application); }
public TypeMap(TypeDetails sourceType, TypeDetails destinationType, MemberList memberList, IProfileConfiguration profile) { SourceTypeDetails = sourceType; DestinationTypeDetails = destinationType; Types = new TypePair(sourceType.Type, destinationType.Type); Profile = profile; ConfiguredMemberList = memberList; IgnorePropertiesStartingWith = profile.GlobalIgnores; }
public virtual MemberList GetNestedNamespaces(Identifier name, Scope scope) { MemberList fullList = this.GetNestedNamespacesAndTypes(name, scope); MemberList result = new MemberList(); for (int i = 0, n = fullList == null ? 0 : fullList.Count; i < n; i++){ Namespace ns = fullList[i] as Namespace; if (ns == null) continue; result.Add(ns); } return result; }
public override MemberList VisitMemberList(MemberList members){ if (members == null) return null; for (int i = 0, n = members.Count; i < n; i++){ Member mem = members[i]; if (mem == null) continue; if (this.Line != int.MinValue){ if (!mem.SourceContext.Encloses(this.Line, this.Column)) continue; }else{ if (!mem.SourceContext.Encloses(this.SourceContext)) continue; } this.Visit(mem); break; } return members; }
public override MemberList GetTypesNamespacesAndPrefixes(Scope scope, bool constructorMustBeVisible, bool listAllUnderRootNamespace) { MemberList result = new MemberList(); while (scope != null && !(scope is TypeScope || scope is NamespaceScope)) scope = scope.OuterScope; if (scope == null) return result; TypeNode currentType = scope is TypeScope ? ((TypeScope)scope).Type : null; if (!(scope is NamespaceScope) && (currentType == null || currentType.DeclaringModule == null)) return result; ErrorHandler errorHandler = new ErrorHandler(new ErrorNodeList(0)); TrivialHashtable ambiguousTypes = new TrivialHashtable(); TrivialHashtable referencedLabels = new TrivialHashtable(); Looker looker = new Looker(null, errorHandler, null, ambiguousTypes, referencedLabels); looker.currentType = currentType; looker.currentModule = this.currentSymbolTable; looker.currentAssembly = looker.currentModule as AssemblyNode; result = looker.GetVisibleTypesNamespacesAndPrefixes(scope, constructorMustBeVisible, listAllUnderRootNamespace); return result; }
protected void BindMemberList(int index) { int count = 0; string where = getWhere(); SqlHelper conn = LocalSqlHelper.WH; SqlHelper helper = LocalSqlHelper.WH; AspNetPager1.PageSize = 20; string table = "(select a.txm,isnull(sum(productcount),0) as pcount,isnull(sum(case when productcount<0 then productcount else 0 end),0) as return_count,pro_name,pro_code,pro_spec,pro_model,supplierName=cast(pro_supplierid as nvarchar(50)),shortSupplierName='',a.danjia,pro_inprice from Direct_OrderDetail a left join Direct_OrderMain b on a.dingdan=b.dingdan left join Prolist p on a.txm=p.pro_txm where " + where + " group by a.txm,pro_name,pro_code,pro_supplierid,pro_spec,pro_model,a.danjia,pro_inprice) as sales"; if (groupby == "huohao") { table = "(select txm='',isnull(sum(productcount),0) as pcount,isnull(sum(case when productcount<0 then productcount else 0 end),0) as return_count,pro_name,pro_code,pro_spec,pro_model='',supplierName=cast(pro_supplierid as nvarchar(50)),shortSupplierName='',a.danjia,pro_inprice from Direct_OrderDetail a left join Direct_OrderMain b on a.dingdan=b.dingdan left join Prolist p on a.txm=p.pro_txm where " + where + " group by pro_code,pro_name,pro_supplierid,pro_spec,a.danjia,pro_inprice) as sales"; DD_GroupBy.Text = groupby; } //Response.Write(table); //Response.End(); DataTable dt = conn.TablesPageNew(table, "*", "pcount desc,txm asc", true, AspNetPager1.PageSize, index, "", out count); // DataTable dt = PublicHelper.TablesPage(conn, table, "*", "pcount desc", AspNetPager1.PageSize, index, "", "txm", out count); for (int i = 0; i < dt.Rows.Count; i++) { if (my_warehouse_id == 0) { dt.Rows[i]["supplierName"] = StorageHelper.getSupplierName(Convert.ToInt32(dt.Rows[i]["supplierName"])); dt.Rows[i]["shortSupplierName"] = Convert.ToString(dt.Rows[i]["supplierName"]).Length > 4 ? Convert.ToString(dt.Rows[i]["supplierName"]).Substring(0, 4) + ".." : Convert.ToString(dt.Rows[i]["supplierName"]); } } MemberList.DataShow(dt); AspNetPager1.RecordCount = count; AspNetPager1.UrlRewritePattern = "ProductSales.aspx?page={0}&" + queryStr; string totalSql = "select isnull(sum(productcount),0) as pcount,isnull(sum(case when productcount<0 then productcount else 0 end),0) as rcount,isnull(sum(danjia*productcount),0) as sales,isnull(sum(p.pro_inprice*productcount),0) as sales_in from Direct_OrderDetail a left join Direct_OrderMain b on a.dingdan=b.dingdan left join Prolist p on a.txm=p.pro_txm where " + where; helper.Params.Clear(); DataTable tdt = helper.ExecDataTable(totalSql); totalCount = Convert.ToInt32(tdt.Rows[0]["pcount"]); totalSales = Convert.ToDouble(tdt.Rows[0]["sales"]); totalSales_in = Convert.ToDouble(tdt.Rows[0]["sales_in"]); totalCount_return = Convert.ToInt32(tdt.Rows[0]["rcount"]); }
protected void BindMemberList(int index) { int count = 0; string where = getWhere(); SqlHelper conn = LocalSqlHelper.WH; AspNetPager1.PageSize = 20; DataTable dt = conn.TablesPageNew("Prolist", "*,'' as supplierName,'' as shortSupplierName", "pro_id desc", true, AspNetPager1.PageSize, index, where, out count); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["supplierName"] = Warehousing.Business.StorageHelper.getSupplierName(Convert.ToInt32(dt.Rows[i]["pro_supplierid"])); dt.Rows[i]["shortSupplierName"] = Convert.ToString(dt.Rows[i]["supplierName"]).Length > 4 ? Convert.ToString(dt.Rows[i]["supplierName"]).Substring(0, 4) + ".." : Convert.ToString(dt.Rows[i]["supplierName"]); } MemberList.DataShow(dt); AspNetPager1.RecordCount = count; AspNetPager1.UrlRewritePattern = "ProductList.aspx?page={0}&" + queryStr; }
void AddPartyMember(string b) { PartyPacket partyPacket = JsonUtility.FromJson <PartyPacket>(b); GameObject PartyPanel = GameObject.Find("PartyPanel"); MemberList memberList = new MemberList(); memberList.nickname = partyPacket.member; memberList.hp = partyPacket.memberHP; PartyMembers.Add(memberList); for (int i = 1; i < PartyMembers.Count + 1; i++) { PartyPanel.transform.FindChild("User" + i.ToString()).gameObject.SetActive(true); } Transform member = GameObject.Find("User" + (PartyMembers.Count).ToString()).transform; member.FindChild("HPBar").GetComponent <Slider>().value = partyPacket.memberHP / 100; member.FindChild("Text").GetComponent <Text>().text = partyPacket.member; }
public void CheckForShadowDeclaration(LocalDeclaration decl) { Field f = decl.Field; if (f == null) { return; } Scope scope = f.DeclaringType as BlockScope; if (scope == null) { return; } scope = scope.OuterScope; // Start search in previous scope while (scope != null) { if (scope is TypeScope) { break; } if (scope is NamespaceScope) { break; } if (scope == null) { return; } MemberList members = scope.GetMembersNamed(f.Name); for (int i = 0, n = members == null ? 0 : members.Count; i < n; i++) { Field outer = members[i] as Field; if (outer == null) { continue; } this.HandleError(decl, Error.LocalShadowsOuterDeclaration, f.Name.Name); return; } scope = scope.OuterScope; } }
public void PopulateTypeList(TypeNodeList types, TypeNode t) { if (types == null || t == null) { Debug.Assert(false); return; } types.Add(t); MemberList members = t.Members; for (int i = 0, n = members == null ? 0 : members.Length; i < n; i++) { t = members[i] as TypeNode; if (t == null) { continue; } this.PopulateTypeList(types, t); } }
public IEnumerable <ResultRowModel> GetResultRows() { List <IRacingResultRow> resultRows = new List <IRacingResultRow>(); var culture = System.Globalization.CultureInfo.GetCultureInfo("de-EN"); foreach (var line in DataLines) { IRacingResultRow row = new IRacingResultRow { //FinalPosition = int.Parse(line["FinPos"]), StartPosition = int.Parse(line["StartPos"]), IRacingId = line["CustID"], FinishPosition = int.Parse(line["FinPos"]), CarNumber = int.Parse(line["Car#"]), ClassId = int.Parse(line["CarClassID"]), Car = line["Car"], CarClass = line["CarClass"], CompletedLaps = int.Parse(line["LapsComp"]), LeadLaps = int.Parse(line["LapsLed"]), FastLapNr = int.TryParse(line["FastLap#"], out int fastLapNr) ? fastLapNr : 0, Incidents = int.Parse(line["Inc"]), Status = (RaceStatusEnum)Enum.Parse(typeof(RaceStatusEnum), line["Out"]), QualifyingTime = new LapTime(TimeSpan.Zero) }; //if (!LeagueClient.LeagueMembers.ToList().Exists(x => x.IRacingId == row.IRacingId)) if (MemberList.Any(x => x.IRacingId == line["CustID"])) { row.Member = MemberList.SingleOrDefault(x => x.IRacingId == line["CustID"]); } //row.Interval = new LapInterval( // TimeSpan.TryParse("0:" + line["Interval"].Replace("-",""), culture, out TimeSpan intvTime) ? intvTime : TimeSpan.Zero, // int.TryParse(line["Interval"].Replace("L", ""), out int intvLaps) ? intvLaps : 0); var teststrt = line["Interval"]; var test = int.TryParse(line["Interval"].Replace("L", ""), out int intvtest) ? intvtest : 0; row.Interval = new LapInterval(GetTimeSpanFromString(line["Interval"]), int.TryParse(line["Interval"].Replace("L", ""), out int intvLaps) ? intvLaps : 0); row.AvgLapTime = new LapTime(TimeSpan.TryParse(PrepareTimeString(line["AverageLapTime"]), culture, out TimeSpan avgLap) ? avgLap : TimeSpan.Zero); row.FastestLapTime = new LapTime(TimeSpan.TryParse(PrepareTimeString(line["FastestLapTime"]), culture, out TimeSpan fastLap) ? fastLap : TimeSpan.Zero); //row.PositionChange = row.StartPosition - row.FinishPosition; resultRows.Add(row); } return(resultRows); }
private void SortAndGroupMemberList(MemberList memberList, MemberGroups memberGroups) { memberList.Members = memberList.Members .OrderBy(m => m.MemberName) .ThenBy(m => m.Badge) .ToList(); var grp = from Member in memberList.Members group Member by Member.NameIndex into grouped orderby grouped.Key select new MemberList { NameIndex = grouped.Key, Members = grouped.ToList() }; memberGroups.MemberCollection = grp.ToList(); }
protected void BindMemberList(int index) { string where = getWhere(); int count = 0; SqlHelper conn = LocalSqlHelper.WH; SqlHelper helper = LocalSqlHelper.WH; AspNetPager1.PageSize = 20; DataTable dt = conn.TablesPageNew("Tb_storage_main with(nolock)", "Tb_storage_main.*,pvolume=0.00,procount=isnull((select sum(p_quantity) from Tb_storage_product with(nolock) where sm_id=Tb_storage_main.sm_id),0),sku=isnull((select count(p_quantity) from Tb_storage_product with(nolock) where sm_id=Tb_storage_main.sm_id),0) ", "sm_id desc", true, AspNetPager1.PageSize, index, where, out count); for (int i = 0; i < dt.Rows.Count; i++) { helper.Params.Clear(); dt.Rows[i]["pvolume"] = helper.ExecScalar("select isnull(sum(p_quantity*p_price),0) from Tb_storage_product a with(nolock) where sm_id=" + dt.Rows[i]["sm_id"].ToString()); } MemberList.DataShow(dt); AspNetPager1.RecordCount = count; AspNetPager1.UrlRewritePattern = "ProductOut.aspx?page={0}&" + queryStr; }
public IEnumerable<LeagueMember> GetNewMemberList() { var newMemberList = new List<LeagueMember>(); var heatResults = ((IEnumerable)HeatResults).OfType<dynamic>(); foreach (var result in heatResults.SelectMany(x => ((IEnumerable)x.results).OfType<dynamic>())) { IRacingResultRow row = new IRacingResultRow(); if (!MemberList.Any(x => x.IRacingId == (string)result.cust_id)) { if (MemberList.Any(x => x.IRacingId == "" && x.FullName == (string)result.display_name)) { var member = MemberList.SingleOrDefault(x => x.FullName == (string)result.display_name); member.IRacingId = (string)result.cust_id; } else if (newMemberList.Any(x => x.IRacingId == (string)result.cust_id)) { var member = newMemberList.SingleOrDefault(x => x.IRacingId == (string)result.cust_id); var names = ((string)result.display_name).Split(' '); member.Firstname = names.First(); member.Lastname = names.Skip(1).Aggregate((x, y) => x + " " + y); } else { //var newMember = LeagueClient.AddNewMember(line["Name"].Split(' ').First(), line["Name"].Split(' ').Last()); var newMember = new LeagueMember(0, ((string)result.display_name).Split(' ').First(), ((string)result.display_name).Split(' ').Skip(1).Aggregate((x, y) => x + " " + y)); //LeagueContext.MemberList.Add(newMember); newMember.IRacingId = (string)result.cust_id; //row.MemberId = newMember.MemberId; row.Member = newMember; newMemberList.Add(newMember); } } else { var member = MemberList.SingleOrDefault(x => x.IRacingId == (string)result.cust_id); var names = ((string)result.display_name).Split(' '); member.Firstname = names.First(); member.Lastname = names.Skip(1).Aggregate((x, y) => x + " " + y); } } return newMemberList; }
public void RemoveMemberFromLobby(User user) { foreach (var bet in this.Bets) { foreach (var outcome in bet.Outcomes) { foreach (var participant in outcome.Participants) { if (user.Username == participant.Username) { outcome.Participants.Remove(participant); } } } } MemberList.Remove(user); user.MemberOfLobbies.Remove(this); }
public static void ReloadMembers() { if (MemberList.Count > 0) { MemberList.RemoveAll(v => true); } JObject config = JObject.Parse(File.ReadAllText("permissions.json")); foreach (JProperty userId in ((JObject)config.SelectToken("Members")).Properties()) { Member newMember = new Member(userId.Name); foreach (JToken role in config.SelectToken($"Members.{userId.Name}")) { newMember.Roles.Add(role.ToString()); } MemberList.Add(newMember); } }
protected void BindMemberList(int index, string where) { int count = 0; SqlHelper conn = LocalSqlHelper.WH; AspNetPager1.PageSize = 20; // Response.Write(strTable); // Response.End(); DataTable dt = conn.TablesPageNew(strTable, "*,plus_num=check_num-kc_num", "pro_id", true, AspNetPager1.PageSize, index, where, out count); if (dt.Rows.Count == 0) { norecord = 1; } MemberList.DataShow(dt); AspNetPager1.RecordCount = count; AspNetPager1.UrlRewritePattern = "CheckStockResult.aspx?page={0}&id=" + main_id; }
public int RowsInSection(UITableView tableView, int section) { if ((MemberList != null) && !String.IsNullOrEmpty(searchString)) { int searchId; if (int.TryParse(searchString, out searchId)) { return(MemberList.Where(x => x.Id == searchId).Count() + 1); } else { return(MemberList.Where(x => x.Name.ToUpper().Contains(searchString.ToUpper())).Count() + 1); } } else { return(1); } }
public static bool IsDefaultMember(Member member) { if (member == null) { throw new ArgumentNullException("member"); } TypeNode type = member.DeclaringType; MemberList defaultMembers = type.DefaultMembers; for (int i = 0; i < defaultMembers.Count; i++) { Member defaultMember = defaultMembers[i]; if (member == defaultMember) { return(true); } } return(false); }
/// <summary> /// Method that add member to department list /// </summary> /// <param name="person">Member which needed to add</param> public virtual void AddMember(Person person) { bool check = true; foreach (var member in MemberList) { if (member.Equals(person)) { check = false; break; } } if (check) { MemberList.Add(person); } EventAddedMember?.Invoke(Name, person.ToString()); }
public static void GetAllMembers(string file) { XmlSerializer serializer = new XmlSerializer(typeof(MemberList)); // FileStream fileStream = new FileStream("register.xml", FileMode.Open); // member members = (member)serializer.Deserialize(fileStream); // XmlSerializer ser = new XmlSerializer(typeof(Cars)); // Cars cars; using (FileStream fileStream = new FileStream("register.xml", FileMode.Open)) { MemberList cars = (MemberList)serializer.Deserialize(fileStream); var a = cars.Members .First(); Console.WriteLine(a.MemberId); Console.WriteLine(a.Name); } }
/// <summary> /// Find shadow field in given type corresponding to field. /// </summary> public static Field FindShadow(this TypeNode parent, Field field) { if (field == null || field.Name == null) { return(null); } MemberList members = parent.GetMembersNamed(field.Name); for (int i = 0, n = members == null ? 0 : members.Count; i < n; i++) { Field f = members[i] as Field; if (f != null) { return(f); } } return(null); }
private void _parent_NewconversationMembers(object sender, ConversationMembersAddedEventArgs e) { ConversationList.SelectedConversation.OnDataChanged(); if (ConversationList.SelectedConversation.Id == e.ConversationId) { PersonModel person = _parent.Persons.Find(obj => obj.Id == e.PersonId); MemberList.AddMemberToList(person, ConversationList.SelectedConversation.ColorDictionary[person]); if (MemberList.Members.Count > 1) { _newPhoneButton.Visibility = Visibility.Visible; if (_parent.EmailClients != null && _parent.EmailClients.Any(obj => obj.ImapClient != null)) { _newEmailButton.Visibility = Visibility.Visible; } } } }
public async Task StartMemberAsync(Cluster cluster) { var memberList = cluster.MemberList; var clusterName = cluster.Config.ClusterName; var(host, port) = cluster.System.GetAddress(); var kinds = cluster.GetClusterKinds(); _cluster = cluster; _memberList = memberList; _clusterName = clusterName; _host = host; _port = port; _kinds = kinds; _address = host + ":" + port; StartClusterMonitor(); await RegisterMemberAsync(); MonitorMemberStatusChanges(); }
public bool AddMember(Member memberAdd) { int i = 0; foreach (Member member in MemberList) { if (member.CompareTo(memberAdd) == 0) { return(false); } if (member.CompareTo(memberAdd) < 0) { MemberList.Insert(i, memberAdd); return(true); } i++; } MemberList.Add(memberAdd); return(true); }
private void StoreType(TypeNode type) { //Console.WriteLine("type: {0} ", type.Name); /* * if (type.Name == null) { * // CCI seems to occasionally construct corrupted, phantom types, which we should reject * // Console.WriteLine("unidentified type rejected"); * return; * } */ string spaceName = GetNamespaceName(type); //Console.WriteLine("in space: {0}", spaceName); Namespace space; if (!catalog.TryGetValue(spaceName, out space)) { space = new Namespace(new Identifier(spaceName)); catalog.Add(spaceName, space); } if (space.Types == null) { Console.WriteLine("null type list"); } space.Types.Add(type); //Console.WriteLine("getting members"); MemberList members = type.Members; //Console.WriteLine("got {0} members", members.Count); for (int i = 0; i < members.Count; i++) { TypeNode nestedType = members[i] as TypeNode; if (nestedType != null) { //Console.WriteLine("nested type {0}", type.FullName); StoreType(nestedType); } } //Console.WriteLine("done storing type"); }
public void VerifyServiceRecords() { var providerList = new ProviderList(); var memberList = new MemberList(); var providerDirectory = new ProviderDirectory(); var serviceRecordList = new ServiceRecordList(); var providers = providerList.GetAllProviders(); var members = memberList.GetAllMembers(); var services = providerDirectory.GetServices(); var providerId = null != providers && providers.Any() ? providers.First().ID : new int?(); var memberId = null != members && members.Any() ? members.First().ID : new int?(); var serviceCode = null != services && services.Any() ? services.First().ServiceCode : new int?(); Assert.IsTrue(providerId.HasValue, "unable to get provider ID"); Assert.IsTrue(memberId.HasValue, "unable to get member ID"); Assert.IsTrue(serviceCode.HasValue, "unable to get service code"); var newServiceRecord = new ServiceRecord(serviceCode.Value, DateTime.Now, DateTime.Today, providerId.Value, memberId.Value, "test"); var serviceRecordId = serviceRecordList.InsertServiceRecord(newServiceRecord); Assert.IsTrue(serviceRecordId.HasValue, "unable to add service record"); var feeVerification = true; var serviceVerification = true; var success = serviceRecordList.VerifyServiceRecords(providerId.Value, DateTime.Today.AddDays(-1), DateTime.Today.AddDays(1), feeVerification, serviceVerification); Assert.IsTrue(success, "failed to verify service record"); var serviceRecord = serviceRecordList.GetServiceRecord(serviceRecordId.Value); Assert.IsTrue(null != serviceRecord, "unable to get service record"); Assert.AreEqual(serviceRecord.FeeVerified, feeVerification, "fee verification are not equal"); Assert.AreEqual(serviceRecord.ServiceVerified, serviceVerification, "service verification are not equal"); }
private void BuildTestMembers(MemberList memberList) { memberList.Members = new List <Models.Member> { new Models.Member { MemberName = "Ibos,Robert", Badge = 289, Activities = new ObservableCollection <TrainingActivity> { new TrainingActivity { TrainingDate = new DateTime(2016, 1, 15), TrainingName = "Hearing Conservation", Passed = true }, new TrainingActivity { TrainingDate = new DateTime(2017, 8, 31), TrainingName = "SCBA Refresher", Passed = true }, new TrainingActivity { TrainingDate = new DateTime(2017, 10, 01), TrainingName = "SCBA Annual Fit Test", Passed = true } } }, new Models.Member { MemberName = "Stewart, Timothy", Badge = 999 }, new Models.Member { MemberName = "Ibos,Robert", Badge = 286 }, new Models.Member { MemberName = "Stewart, Craig", Badge = 366 }, new Models.Member { MemberName = "Olson, John", Badge = 100 } }; }
public ActionResult MemberList() { var db = new StudentDBEntities(); List <Member> dbInfo = db.Member.ToList(); var viewModelList = new List <MemberList>(); foreach (Member info in dbInfo) { var tmpInfo = new MemberList() { Account = info.Account, Password = info.Password, UserName = info.UserName, Identity = info.Identity, Memo = info.Memo, RealMember = info.RealMember, }; viewModelList.Add(tmpInfo); } return(View(viewModelList)); }
private static FTL.AST.Message Parse(CharStream cs, Context ctx, FTL.AST.StringPrimitive identifier) { WhiteSpace.Parse(cs); cs.SkipCharacter('='); WhiteSpace.Parse(cs); FTL.AST.Pattern pattern = null; // check if we have a Pattern available bool hasPattern = Pattern.PeekAndParse(cs, out pattern); FTL.AST.MemberList memberList; bool parsedMemberList = MemberList.PeekAndParse(cs, out memberList); if (!parsedMemberList && !hasPattern) { throw cs.CreateException( "member-list was expected, as no pattern was found", null); } return(new FTL.AST.Message(identifier, pattern, memberList)); }
public async Task <List <TblMembers> > CurrentMem(string ShMelli) { List <TblMembers> lst = new List <TblMembers>(); try { var mem = await _context.TblMembers.SingleOrDefaultAsync(u => u.کدملی == ShMelli); ParvandeState = mem.وضعیتپرونده; MemberList.Add(mem); if (mem.کدملی == ShMelli) { lst.Add(mem); } } catch (Exception ex) { throw ex; } return(lst); }
public override MemberList Process(WebClient client) { MemberList ml = new MemberList(); String content = client.DownloadString(GetUrl()); MatchCollection mc = Regex.Matches(content, "<a href=\"http://baki\\.info/subcat/(\\d+)\" class=\"sc_listone\">.*?<span class=\"csc_sub_name\"><div class=\"title_inner\">(.+?)</div>", RegexOptions.Singleline); foreach (Match m in mc) { CategorySub c = new CategorySub(); c.Id = m.Groups[1].Value; c.Name = m.Groups[2].Value; Children.Add(c); ml.Add(c); } Unprocessed = false; return ml; }
/// <summary> /// Gets a new member for the list. /// </summary> /// <param name="m">The member to add. The message denotes how it is added. /// "Update" replaces at the specified index, "Add" adds it to the list.</param> public void ReceiveMember(MessageMember m) { if (m.Message == "Update") { /* Another method for update * SelectedMember.FirstName = m.FirstName; * SelectedMember.LastName = m.LastName; * SelectedMember.Email = m.Email; * _database.SaveMemberships(); * _members = _database.GetMemberships(); * RaisePropertyChanged("MemberList"); */ MemberList[MemberList.IndexOf(SelectedMember)] = new Member(m.FirstName, m.LastName, m.Email); } else if (m.Message == "Add") { MemberList.Add(new Member(m.FirstName, m.LastName, m.Email)); } _database.SaveMemberships(); }
private void navMemberList_Click(object sender, EventArgs e) { MemberList curForm = new MemberList(); mdiStatusMsg.Text = curForm.Name + " opening"; // Check for open instance of selected form for (int idx = 0; idx < this.MdiChildren.Length; idx++) { if (((Form)this.MdiChildren[idx]).Name == curForm.Name) { ((Form)this.MdiChildren[idx]).Activate(); return; } } // Set the Parent Form and display requested form curForm.MdiParent = this; curForm.Show(); mdiStatusMsg.Text = curForm.Name + " open"; }
public void UpdatedRoomMember(string list) { MemberList memberList = JsonSerializer.Deserialize <MemberList>(list); if (memberList.members.Count == 2) { Debug.Log(memberList.members[0].name); Debug.Log(memberList.members[1].name); if (memberList.members[0].name.Equals(Core.settings.userName)) { myInfo.ChangeTurn(); encounterInfo.setName(memberList.members[1].name); } else { encounterInfo.ChangeTurn(); encounterInfo.setName(memberList.members[0].name); } board.state = GameState.Uninit; } }
public void GetMember() { var list = new MemberList(); var member = new Member(); member.Name = "Cheng luo"; member.StreetAddress = "123 77th Ave S"; member.State = "MN"; member.City = "Saint Cloud"; member.ZipCode = "12345"; var newmemberID = list.InsertMember(member); Assert.IsTrue(null != newmemberID, "Adding Member Failed!"); var result = list.GetMember(newmemberID.Value); Assert.IsTrue(null != result, "Returned member does not exist"); var deleteResult = list.DeleteMember(newmemberID.Value); Assert.IsTrue(deleteResult, "Delete Fail"); }
public override void VisitMemberList(MemberList members) { if (members == null) return; for (int i = 0, n = members.Count; i < n; i++) { var type = members[i] as TypeNode; if (type == null) continue; Class c = type as Class; if (c != null && HelperMethods.IsContractTypeForSomeOtherType(c)) { members[i] = null; } else { // for nested types this.VisitTypeNode(type); } } }
public void OnEventHandling(int node, NetEventState state) { string str = "Node:" + node + " type:" + state.type.ToString() + " State:" + state.type + "[" + state.result + "]"; Debug.Log("OnEventHandling called"); Debug.Log(str); switch (state.type) { case NetEventType.Connect: { MemberList member = new MemberList(); member.node = node; member.endPoint = network_.GetEndPoint(node); m_members.Add(node, member); } break; case NetEventType.Disconnect: { if (m_members.ContainsKey(node)) { int roomId = m_members[node].roomId; if (rooms_.ContainsKey(roomId)) { for (int i = 0; i < rooms_[roomId].members.Length; ++i) { if (rooms_[roomId].members[i] == node) { rooms_[roomId].members[i] = -1; break; } } } m_members.Remove(node); } } break; } }
/// <summary> /// Gather the invariant methods before we visit the children so we have populated them for all visible parts (which are only the type /// and it's nested types due to the privacy of invariant methods) /// </summary> private void GatherInvariantMethods(MemberList memberList) { for (int i = 0; i < memberList.Count; i++) { var method = memberList[i] as Method; if (method == null) continue; if (this.contractNodes.IsObjectInvariantMethod(method)) { this.invariantMethods[method.UniqueKey] = method; } } }
public override MemberList VisitMemberList(MemberList members) { if (members == null) return null; for (int i = 0, n = members.Count; i < n; i++) { Member mem = members[i]; if (mem == null) continue; this.Visit(mem); if (this.options.BlankLinesBetweenMembers && (i + 1) < n) WriteLine(string.Empty); } return members; }
public virtual MemberList VisitMemberList(MemberList members, MemberList changes, MemberList deletions, MemberList insertions){ if (members == null) return changes; if (changes != null){ if (deletions == null || insertions == null) Debug.Assert(false); else{ } }else if (deletions != null) return null; return members; }
private void init(string fileName) { Package = ""; Module = ""; FileName = fileName ?? ""; haXe = (FileName.Length > 3) ? FileInspector.IsHaxeFile(FileName, Path.GetExtension(FileName)) : false; // Namespaces = new Dictionary<string, Visibility>(); // Imports = new MemberList(); Classes = new List<ClassModel>(); Members = new MemberList(); Regions = new MemberList(); }
/// <summary> /// Return the full project classes list /// </summary> /// <returns></returns> public override MemberList GetAllProjectClasses() { // from cache if (!completionCache.IsDirty && completionCache.AllTypes != null) return completionCache.AllTypes; MemberList fullList = new MemberList(); MemberModel item; // public & internal classes string package = CurrentModel.Package; foreach (PathModel aPath in classPath) if (aPath.IsValid && !aPath.Updating) { aPath.ForeachFile((aFile) => { if (!aFile.HasPackage) return true; // skip foreach(ClassModel aClass in aFile.Classes) if (!aClass.IsVoid() && aClass.IndexType == null) { if (aClass.Access == Visibility.Public || (aClass.Access == Visibility.Internal && aFile.Package == package)) { item = aClass.ToMemberModel(); item.Name = item.Type; fullList.Add(item); } } if (aFile.Package.Length > 0 && aFile.Members.Count > 0) { foreach (MemberModel member in aFile.Members) { item = member.Clone() as MemberModel; item.Name = aFile.Package + "." + item.Name; fullList.Add(item); } } else if (aFile.Members.Count > 0) { foreach (MemberModel member in aFile.Members) { item = member.Clone() as MemberModel; fullList.Add(item); } } return true; }); } // void fullList.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0)); // private classes fullList.Add(GetPrivateClasses()); // in cache fullList.Sort(); completionCache.AllTypes = fullList; return fullList; }
/// <summary> /// This is used to visit a list of members /// </summary> /// <param name="members">The list of members to visit</param> protected virtual void VisitMembers(MemberList members) { // Visit the members in sorted order foreach(Member member in members.OrderBy(m => m.FullName)) { // Don't visit nested types either as they are already visited if(!(member is TypeNode) && filter.IsExposedMember(member)) this.VisitMember(member); } }
/// <summary> /// Return a sorted list of the file /// </summary> /// <returns></returns> internal MemberList GetSortedMembersList() { MemberList items = new MemberList(); items.Add(Members); items.Sort(); return items; }
public virtual Differences VisitTypeNodeList(TypeNodeList list1, TypeNodeList list2, out TypeNodeList changes, out TypeNodeList deletions, out TypeNodeList insertions){ changes = list1 == null ? null : list1.Clone(); deletions = list1 == null ? null : list1.Clone(); insertions = list1 == null ? new TypeNodeList() : list1.Clone(); //^ assert insertions != null; Differences differences = new Differences(); //Compare definitions that have matching key attributes TrivialHashtable matchingPosFor = new TrivialHashtable(); TrivialHashtable matchedNodes = new TrivialHashtable(); for (int j = 0, n = list2 == null ? 0 : list2.Count; j < n; j++){ //^ assert list2 != null; TypeNode nd2 = list2[j]; if (nd2 == null || nd2.Name == null) continue; string fullName = nd2.FullName; if (fullName == null) continue; matchingPosFor[Identifier.For(fullName).UniqueIdKey] = j; insertions.Add(null); } for (int i = 0, n = list1 == null ? 0 : list1.Count; i < n; i++){ //^ assert list1 != null && changes != null && deletions != null; TypeNode nd1 = list1[i]; if (nd1 == null || nd1.Name == null) continue; string fullName = nd1.FullName; if (fullName == null) continue; object pos = matchingPosFor[Identifier.For(fullName).UniqueIdKey]; if (!(pos is int)) continue; //^ assert pos != null; //^ assume list2 != null; //since there was entry int matchingPosFor int j = (int)pos; TypeNode nd2 = list2[j]; //^ assume nd2 != null; //nd1 and nd2 have the same key attributes and are therefore treated as the same entity matchedNodes[nd1.UniqueKey] = nd1; matchedNodes[nd2.UniqueKey] = nd2; //nd1 and nd2 may still be different, though, so find out how different Differences diff = this.VisitTypeNode(nd1, nd2); if (diff == null){Debug.Assert(false); continue;} if (diff.NumberOfDifferences != 0){ changes[i] = diff.Changes as TypeNode; deletions[i] = diff.Deletions as TypeNode; insertions[i] = diff.Insertions as TypeNode; insertions[n+j] = nd1; //Records the position of nd2 in list2 in case the change involved a permutation //Debug.Assert(diff.Changes == changes[i] && diff.Deletions == deletions[i] && diff.Insertions == insertions[i]); differences.NumberOfDifferences += diff.NumberOfDifferences; differences.NumberOfSimilarities += diff.NumberOfSimilarities; if (nd1.DeclaringModule == this.OriginalModule || (nd1.DeclaringType != null && nd1.DeclaringType.DeclaringModule == this.OriginalModule)){ if (this.MembersThatHaveChanged == null) this.MembersThatHaveChanged = new MemberList(); this.MembersThatHaveChanged.Add(nd1); } continue; } changes[i] = null; deletions[i] = null; insertions[i] = null; insertions[n+j] = nd1; //Records the position of nd2 in list2 in case the change involved a permutation } //Find deletions for (int i = 0, n = list1 == null ? 0 : list1.Count; i < n; i++){ //^ assert list1 != null && changes != null && deletions != null; TypeNode nd1 = list1[i]; if (nd1 == null) continue; if (matchedNodes[nd1.UniqueKey] != null) continue; changes[i] = null; deletions[i] = nd1; insertions[i] = null; differences.NumberOfDifferences += 1; if (nd1.DeclaringModule == this.OriginalModule || (nd1.DeclaringType != null && nd1.DeclaringType.DeclaringModule == this.OriginalModule)){ if (this.MembersThatHaveChanged == null) this.MembersThatHaveChanged = new MemberList(); this.MembersThatHaveChanged.Add(nd1); } } //Find insertions for (int j = 0, n = list1 == null ? 0 : list1.Count, m = list2 == null ? 0 : list2.Count; j < m; j++){ //^ assert list2 != null; TypeNode nd2 = list2[j]; if (nd2 == null) continue; if (matchedNodes[nd2.UniqueKey] != null) continue; insertions[n+j] = nd2; //Records nd2 as an insertion into list1, along with its position in list2 differences.NumberOfDifferences += 1; //REVIEW: put the size of the tree here? } if (differences.NumberOfDifferences == 0){ changes = null; deletions = null; insertions = null; } return differences; }
private static void AddDocComments(MemberList members, BaseModel[] docMembers) { foreach (BaseModel docMember in docMembers) { MemberModel member = members.Search(docMember.Name, 0, 0); if (member == null) continue; member.Comments = docMember.Comment; } }
private static void AddDocumentation(MemberList members, BlockModel docModel) { AddDocComments(members, docModel.Properties.ToArray()); AddDocComments(members, docModel.Methods.ToArray()); }