private void LoadFromKey(RegistryKey key) { object name = key.GetValue(null); if ((name != null) && (name.ToString().Length > 0)) { Name = name.ToString(); } else { Name = String.Format("{{{0}}}", Iid.ToString()); } ProxyClsid = COMUtilities.ReadGuidFromKey(key, "ProxyStubCLSID32", null); NumMethods = COMUtilities.ReadIntFromKey(key, "NumMethods", null); if (NumMethods < 3) { NumMethods = 3; } TypeLib = COMUtilities.ReadGuidFromKey(key, "TypeLib", null); TypeLibVersion = COMUtilities.ReadStringFromKey(key, "TypeLib", "Version"); Base = COMUtilities.ReadStringFromKey(key, "BaseInterface", null); if (Base.Length == 0) { Base = "IUnknown"; } }
public override string ToString() { if (!string.IsNullOrWhiteSpace(Module)) { return(string.Format("{0},{1},{2}", Iid, Module, VTableOffset)); } return(Iid.ToString()); }
private void LoadResults(SqlConnection cn) { Results.Clear(); SqlDataReader rdr; SqlCommand cmd = new SqlCommand(); cmd.Connection = cn; try { cmd.CommandText = #if FULL "SELECT l.round, lr.resText, lr.posText, l.style, l.iid l_id " + "FROM lists l(NOLOCK) " + "JOIN routeResults lr(NOLOCK) ON l.iid=lr.list_id " + "WHERE (lr.climber_id = " + Iid.ToString() + ") " + "AND (lr.posText IS NOT NULL) " + "AND style = 'Трудность' " + "AND lr.preQf = 0 " + "UNION " + #endif "SELECT l.round, lr.resText, lr.posText, l.style, l.iid l_id FROM lists l(NOLOCK) INNER JOIN speedResults lr(NOLOCK) " + "ON l.iid=lr.list_id WHERE (lr.climber_id = " + Iid.ToString() + ") AND " + "(lr.posText IS NOT NULL) AND (lr.preQf=0) ORDER BY style DESC, l_id"; rdr = cmd.ExecuteReader(); try { while (rdr.Read()) { Results.Add(new ResData(rdr["style"].ToString(), rdr["round"].ToString(), rdr["posText"].ToString(), rdr["resText"].ToString())); } } finally { rdr.Close(); } #if FULL cmd.CommandText = @"select l.round, lb.nya, lb.disq, lb.tops, lb.topAttempts, lb.bonuses, lb.bonusAttempts, lb.posText, l.style from lists l(nolock) join boulderResults lb(nolock) on lb.list_id = l.iid where lb.preQf = 0 and lb.posText is not null and lb.climber_id = " + Iid.ToString() + " ORDER BY l.iid"; rdr = cmd.ExecuteReader(); string round, style, res, pos; try { while (rdr.Read()) { round = rdr["round"].ToString(); pos = rdr["postext"].ToString(); style = rdr["style"].ToString(); if (Convert.ToBoolean(rdr["nya"])) { res = "н/я"; } else if (Convert.ToBoolean(rdr["disq"])) { res = "дискв."; } else { res = rdr["tops"].ToString() + "/" + rdr["topAttempts"].ToString() + " " + rdr["bonuses"].ToString() + "/" + rdr["bonusAttempts"].ToString(); } Results.Add(new ResData(style, round, pos, res)); } } finally { rdr.Close(); } cmd.CommandText = @"select l.round, r.resText, r.posText, l.style from lists l(nolock) join routeResults r(nolock) on r.list_id = l.iid where l.style = 'Боулдеринг' and r.preQf = 0 and r.posText is not null and r.climber_id = " + Iid.ToString() + " order by l.iid"; rdr = cmd.ExecuteReader(); try { while (rdr.Read()) { pos = rdr["posText"].ToString(); res = rdr["resText"].ToString(); round = rdr["round"].ToString(); style = rdr["style"].ToString(); Results.Add(new ResData(style, round, pos, res)); } } finally { rdr.Close(); } #endif } catch { } }