コード例 #1
0
ファイル: Map.cs プロジェクト: AlexAbramov/gis
//        Style GetStyle(Style style, StyleTypes styleType) { }
//		Pen GetPen(Style style){return style!=null && style.pen!=null ? style.pen : lib.DefaultStyle.Pen;}
//		Brush GetBrush(Style style){return style!=null && style.brush!=null ? style.brush:lib.DefaultStyle.Brush;}
//		TextStyle GetTextStyle(Style style){return style!=null && style.textStyle!=null ? style.textStyle : lib.DefaultStyle.TextStyle;}
        public void Draw()
        {
            graphics.ResetTransform();
            graphics.Clear(Color.White);
            using (context = lib.GetContext())
            {
                lib.Draw(this);
            }
            selection.Draw(this);
        }
コード例 #2
0
        public static void SqlSearch(GLib lib, string text, int typeId, DataTable dataTable)
        {
            text = text.ToLower();
            string query = string.Format("select top {0} o.Name, t.Name as Type, o.Caption, o.RangeId, o.Id from Objects o left join Types t on TypeId=t.Id where o.Name like '%{1}%' or Caption like '%{1}%' ", Constants.maxSearchCount, text);

            if (typeId != 0)
            {
                query += " and t.Id=" + typeId.ToString();
            }
            using (Context context = lib.GetContext())
            {
                using (DbDataAdapter dataAdapter = context.Conn.CreateDataAdapter(query))
                {
                    dataAdapter.Fill(dataTable);
                }
            }
        }