本文整理汇总了C#中GridPanel类的典型用法代码示例。如果您正苦于以下问题:C# GridPanel类的具体用法?C# GridPanel怎么用?C# GridPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridPanel类属于命名空间,在下文中一共展示了GridPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public override void Run()
{
if (this.Owner is GridPanel)
{
object focusRow = (this.Owner as GridPanel).GetFocusRow();
if (focusRow != null)
{
PropertyInfo property = focusRow.GetType().GetProperty(this.PropertyName);
if (property != null)
{
GridAttribute ga = null;
DisplayNameAttribute attribute2 = null;
foreach (Attribute attribute3 in property.GetCustomAttributes(false))
{
if (attribute3 is GridAttribute)
{
ga = (GridAttribute) attribute3;
}
if (attribute3 is DisplayNameAttribute)
{
attribute2 = (DisplayNameAttribute) attribute3;
}
}
if (ga != null)
{
GridPanel gp = new GridPanel(ga, property.GetValue(focusRow, null));
GridDialog dialog = new GridDialog(gp);
dialog.Text = attribute2.DisplayName;
dialog.Show();
}
}
}
}
}
示例2: CreateControls
private void CreateControls(Item item, string fields = "")
{
var textfields = GetTextFields(item);
Fields.Controls.Clear();
foreach (var field in textfields)
{
var border = new GridPanel()
{
Width = Unit.Percentage(90),
Columns = 2
};
var checkbox = new Checkbox()
{
Header = field.DisplayName,
HeaderStyle = "font-weight:bold",
ID = Control.GetUniqueID("ctl_cb"),
Checked = fields.Contains(string.Concat("|", field.Name, "|"))
};
border.Controls.Add(checkbox);
border.Controls.Add(new Literal { Text = "<br/>" });
border.Controls.Add(new HtmlTextArea()
{
ID = checkbox.ID.Replace("cb","ta"),
Rows = 5,
Cols = 27,
Value = field.Value,
}
);
Fields.Controls.Add(border);
}
}
示例3: GetFilterData
///<summary>
/// GetFilterData
///</summary>
///<returns></returns>
static public List<UserFilterData> GetFilterData(GridPanel gridPanel)
{
if (_filterData != null)
return (_filterData);
return (LoadFilterData(gridPanel));
}
示例4: EditValue
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
IWindowsFormsEditorService service = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
if (service != null)
{
GridAttribute ga = null;
DisplayNameAttribute attribute2 = null;
foreach (Attribute attribute3 in context.PropertyDescriptor.Attributes)
{
if (attribute3 is GridAttribute)
{
ga = (GridAttribute) attribute3;
}
if (attribute3 is DisplayNameAttribute)
{
attribute2 = (DisplayNameAttribute) attribute3;
}
}
if (ga != null)
{
GridPanel gp = new GridPanel(ga, value);
GridDialog dialog = new GridDialog(gp);
dialog.Text = attribute2.DisplayName;
service.ShowDialog(dialog);
}
}
return value;
}
示例5: BuildGrid
public void BuildGrid(System.Web.UI.Control parent)
{
Assert.ArgumentNotNull(parent, "parent");
LayoutDefinition layout = null;
var gridPanel = new GridPanel
{
RenderAs = RenderAs.Literal,
Width = Unit.Parse("100%")
};
gridPanel.Attributes["Class"] = Class;
gridPanel.Attributes["CellSpacing"] = "2";
gridPanel.Attributes["id"] = ID;
parent.Controls.Add(gridPanel);
string @string = StringUtil.GetString(Value);
if (@string.Length > 0)
{
layout = LayoutDefinition.Parse(@string);
}
foreach (DeviceItem deviceItem in Client.ContentDatabase.Resources.Devices.GetAll())
{
BuildDevice(gridPanel, layout, deviceItem);
}
}
示例6: GridSquare
public GridSquare(Point Location, Colors TileColor, Status Occupied)
{
panel = new GridPanel(this);
this.Location = Location;
this.TileColor = TileColor;
this.Occupied = Occupied;
this.Size = defaultTileSize;
}
示例7: RenderBorder
protected override void RenderBorder(Graphics g,
GridPanel panel, GridPanelVisualStyle pstyle, Rectangle r)
{
using (Pen pen = new Pen(pstyle.HeaderLineColor))
{
r.Height--;
g.DrawLine(pen, r.X, r.Bottom, r.Right - 1, r.Bottom);
}
}
示例8: EEval
private EEval(GridCell cell, string source, List<GridCell> usedCells)
{
_Cell = cell;
_UsedCells = usedCells;
if (_Cell != null)
_GridPanel = cell.GridPanel;
Source = source;
}
示例9: CustomFilter
///<summary>
/// CustomFilter
///</summary>
public CustomFilter(GridPanel gridPanel, GridColumn gridColumn, string filterText)
{
_GridPanel = gridPanel;
_GridColumn = gridColumn;
InitializeComponent();
InitializeText();
InitializeFilter(filterText);
PositionWindow(_GridPanel.SuperGrid);
}
示例10: CreateSubPanel
private GridPanel CreateSubPanel(int begin, int end)
{
GridPanel backgroundPanel = new GridPanel(Simulator.Scene, Vector3.Zero, new Vector2(500, 500), Preferences.PrioriteGUIPanneauGeneral, Color.White)
{
NbColumns = 4,
OnlyShowWidgets = true
};
for (int i = begin; i <= end; i++)
backgroundPanel.AddWidget("background" + i, new ImageWidget("background" + i, 0.1f));
return backgroundPanel;
}
示例11: FilterPopup
/// <summary>
/// Constructor
/// </summary>
public FilterPopup(GridPanel panel)
{
_Panel = panel;
_PopupControl = new PopupControl();
_PopupControl.Opened += PopupControlOpened;
_PopupControl.Closed += PopupControlClosed;
_PopupControl.UserResize += PopupControlUserResize;
_PopupControl.PreRenderGripBar += PopupControlPreRenderGripBar;
_PopupControl.PostRenderGripBar += PopupControlPostRenderGripBar;
}
示例12: LevelsPanel
public LevelsPanel(Scene scene, Vector3 position, Vector2 size, double visualPriority, Color color)
: base(scene, position, size, visualPriority, color)
{
SelectedLevelLabel = new Label(new Text("Selected level: none", @"Pixelite") { SizeX = 2 });
PushButtons = new Dictionary<LevelDescriptor, PushButton>();
Levels = new GridPanel(scene, position, size, visualPriority, color)
{
NbColumns = 10
};
Levels.OnlyShowWidgets = true;
AddWidget("SelectedLevel", SelectedLevelLabel);
AddWidget("Levels", Levels);
}
示例13: BuildRelatedCategories
private void BuildRelatedCategories(IOrderedEnumerable<RelationInfo> categories, GridPanel categoriesPanel, RelationInfo originCategory)
{
IEnumerable<RelationInfo> calculatedCategories = (from category in categories
where
(
(category.RelatedCategory.IndexOf(originCategory.Category) > -1))
select category);
foreach (RelationInfo calculatedCategory in calculatedCategories)
{
categoriesPanel.Controls.Add(GetSeparator());
categoriesPanel.Controls.Add(GetCategoryPanel(calculatedCategory));
BuildRelatedCategories(categories, categoriesPanel, calculatedCategory);
}
}
示例14: GetCategoryPanel
private static GridPanel GetCategoryPanel(RelationInfo link)
{
CategoryItem categoryItem = new CategoryItem(Client.ContentDatabase.GetItem(link.Category));
GridPanel categoryPanel = new GridPanel();
string categoryFullName = categoryItem.CategoryName;
string categoryName = categoryItem.DisplayName;
categoryPanel.Controls.Add(new Literal(string.Format("{0} ({1:F0}%)", categoryName, link.Weight))
{Class = "categoryName"});
categoryPanel.Controls.Add(
new Literal(string.Format("{0}",
categoryFullName.Substring(0, categoryFullName.Length - categoryName.Length - 1)))
{Class = "categoryPath"});
categoryPanel.Attributes["class"] = "categoryPanel";
return categoryPanel;
}
示例15: CustomFilterEx
///<summary>
/// CustomFilter
///</summary>
public CustomFilterEx(GridPanel gridPanel,
GridColumn gridColumn, string filterText)
{
_GridPanel = gridPanel;
_GridColumn = gridColumn;
InitializeComponent();
InitializeText();
InitializeFilter(filterText);
PositionWindow(_GridPanel.SuperGrid);
FormClosing += CustomFilterExFormClosing;
filterExprEdit1.InputTextChanged += FilterExprEdit1InputTextChanged;
}