本文整理汇总了C#中GridData类的典型用法代码示例。如果您正苦于以下问题:C# GridData类的具体用法?C# GridData怎么用?C# GridData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridData类属于命名空间,在下文中一共展示了GridData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridData
public ActionResult GridData(string entityName)
{
GridRequest request = new GridRequest(Request);
var query = (from a in FlowContract.FlowArchives where a.CreatorUserId==Operator.UserId
join i in FlowContract.FlowItems on a.FlowItemId equals i.Id
join r in FlowContract.FlowRelateForms on i.FlowDesignId equals r.FlowDesignId
join f in FlowContract.FlowForms on r.FlowFormId equals f.Id
join d in CommonContract.Dictionarys on f.TypeVal equals d.Value
select new FlowFormDto
{
Id = a.Id,
FormName = i.EntityName,
TypeVal = f.TypeVal,
TypeName = d.Name,
CreatorUserName = a.CreatorUserName,
CreatTime = a.CreatedTime
})
.WhereIf(c => c.FormName.Contains(entityName), !entityName.IsNullOrEmpty());
var total = query.Count();
if (request.PageCondition.SortConditions.Length > 0)
{
foreach (var item in request.PageCondition.SortConditions)
{
query = query.OrderBy(item.SortField, item.ListSortDirection);
}
}
else
query = query.OrderBy("CreatTime", ListSortDirection.Descending);
var list = query.Skip((request.PageCondition.PageIndex - 1) * request.PageCondition.PageSize).Take(request.PageCondition.PageSize).ToList();
var data = new GridData<FlowFormDto>(list, total);
return Json(data, JsonRequestBehavior.AllowGet);
}
示例2: GetGridDataWithPagingBandejaNotificaciones
public static GridData GetGridDataWithPagingBandejaNotificaciones(
string colName, string sortOrder, int numPage, int numRows, string searchField, string searchString, string searchOper, bool isSearch)
{
GridData gridData = new GridData();
gridData = _getListListConPaginacionServicios(numPage, numRows, numPage, isSearch, searchField, searchString, searchOper);
return gridData;
}
示例3: DataToMap
public Map DataToMap(JsonData Data)
{
mapname = Data ["Name"].ToString ();
PerfectMove = int.Parse (Data ["Step"].ToString ());
width= int.Parse (Data ["Width"].ToString ());
height= int.Parse (Data ["Height"].ToString ());
for(int i=0;i<Data["Grid"].Count;i++) {
JsonData jd=Data["Grid"][i];
GridPos.Add (new Vector2(float.Parse (jd["x"].ToString ()),float.Parse (jd["y"].ToString ())));
GridData d=new GridData(int.Parse(jd["data"][0].ToString ()),int.Parse(jd["data"][1].ToString ()),int.Parse(jd["data"][2].ToString ()));
GData.Add (d);
}
for(int i=0;i<Data["Block"].Count;i++)
{
JsonData jd=Data["Block"][i];
if(jd==null)
break;
AllBlock.Add (new Vector2(float.Parse (jd["x"].ToString ()),float.Parse (jd["y"].ToString ())));
}
GPD = new Dictionary<Vector2, GridData> ();
for (int i=0; i<GridPos.Count; i++) {
GPD.Add (GridPos[i],GData[i]);
}
return this;
}
示例4: GetGridDataWithPagingHistorial
public static GridData GetGridDataWithPagingHistorial(
string colName, string sortOrder, int numPage, int numRows, string searchField, string searchString, string searchOper, bool isSearch, int Paciented)
{
GridData gridData = new GridData();
gridData = _getListListConPaginacionHistorial(numPage, numRows, numPage, isSearch, searchField, searchString, searchOper);
return gridData;
}
示例5: GridData
public ActionResult GridData()
{
GridRequest request = new GridRequest(Request);
if (request.PageCondition.SortConditions.Length == 0)
{
request.PageCondition.SortConditions = new[]
{
new SortCondition("Area"),
new SortCondition("Controller"),
new SortCondition("Name")
};
}
Expression<Func<Function, bool>> predicate = FilterHelper.GetExpression<Function>(request.FilterGroup);
var page = SecurityContract.Functions.ToPage(predicate,
request.PageCondition,
m => new
{
m.Id,
m.Name,
m.Url,
m.FunctionType,
m.OperateLogEnabled,
m.DataLogEnabled,
m.CacheExpirationSeconds,
m.IsCacheSliding,
m.Area,
m.Controller,
m.Action,
m.IsController,
m.IsAjax,
m.IsChild,
m.IsLocked,
m.IsTypeChanged,
m.IsCustom
});
GridData<object> gridData = new GridData<object>() { Total = page.Total };
gridData.Rows = page.Data.Select(m => new
{
m.Id,
m.Name,
m.Url,
m.FunctionType,
m.OperateLogEnabled,
m.DataLogEnabled,
m.CacheExpirationSeconds,
m.IsCacheSliding,
m.Area,
m.Controller,
m.Action,
ModuleName = m.Area + "-" + m.Controller,
m.IsController,
m.IsAjax,
m.IsChild,
m.IsLocked,
m.IsTypeChanged,
m.IsCustom
}).ToArray();
return Json(gridData, JsonRequestBehavior.AllowGet);
}
示例6: GetGridDataWithPagingDocumentosAdjuntos
public static GridData GetGridDataWithPagingDocumentosAdjuntos(
string colName, string sortOrder, int numPage, int numRows, string searchField,
string searchString, string searchOper, bool isSearch, decimal idNotificacion)
{
GridData gridData = new GridData();
gridData = _getLisAdjuntosPaginacion(numPage, numRows, numPage, isSearch, searchField, searchString, searchOper, idNotificacion);
return gridData;
}
示例7: CustomerVisitInvolvedPeople
//Customer Visit Involved People
public string CustomerVisitInvolvedPeople()
{
string VisitID = Request["VisitID"];
DataTable dt = CustomerVisitManager.GetVisitInvolvedPeopleData(VisitID);
GridData gd = new GridData();
gd.Page = "0";
gd.DataTable = dt;
return gd.ToJson();
}
示例8: CalculateMagnitudeDistance
public byte CalculateMagnitudeDistance(GridData grid0, GridData grid1, bool isTwoCamp)
{
if (isTwoCamp)
{
return (byte)(Mathf.Pow(grid0.XGrid - grid1.XGrid, 2) + Mathf.Pow(grid0.ZGrid + grid1.ZGrid + 1, 2));
}
else
{
return (byte)(Mathf.Pow(grid0.XGrid - grid1.XGrid, 2) + Mathf.Pow(grid0.ZGrid - grid1.ZGrid, 2));
}
}
示例9: registerObject
public void registerObject(GameObject obj, float x, float y, float width, float height, int cost)
{
GridData d = new GridData();
d.cost = cost;
d.xOffset = obj.transform.position.x - x;
d.yOffset = obj.transform.position.y - y;
getGridCoords(x - width/2, y - height/2, out d.fromX, out d.fromY);
getGridCoords(x + width/2, y + height/2, out d.toX, out d.toY);
objectToGridData[obj.GetHashCode()] = d;
this.updateGrid(d.fromX, d.fromY, d.toX, d.toY, cost);
//Debug.Log(string.Format("Registered object: {0} at ({1},{2}) ({3}, {4})", obj.GetHashCode(), d.fromX, d.fromY, d.toX, d.toY));
}
示例10: GetFiles
public string GetFiles()
{
string FileID = Request["FileID"];
DataTable dt = null;
if (!String.IsNullOrWhiteSpace(FileID))
{
dt = FileHelper.GetFilesData(FileID, null);
}
GridData gd = new GridData();
gd.Page = "0";
gd.DataTable = dt;
return gd.ToJson(new TableFormatString("CreateTime", "{0:yyyy-MM-dd hh:mm}"));
}
示例11: Should_map_the_constructor_parameters_to_the_right_properties
public void Should_map_the_constructor_parameters_to_the_right_properties()
{
var gridColumns = new List<IGridColumn>
{
new GridColumn(GridColumnType.Sortable, "Header", "Field", AlignAttribute.Left, false, true, "", ActionName, _rows)
};
var filters = new List<DropDownListData>();
var pagedGridData = new GridData(null, ControllerName, ".mvc", ActionName, gridColumns, gridColumns.Count, filters, _rows.Count);
pagedGridData.PagedListParameters.ShouldBeEqualTo(null);
pagedGridData.ControllerName.ShouldBeEqualTo(ControllerName);
pagedGridData.ActionName.ShouldBeEqualTo(ActionName);
Assert.AreSame(gridColumns, pagedGridData.GridColumns);
pagedGridData.Total.ShouldBeEqualTo(gridColumns.Count);
pagedGridData.Filters.ShouldBeEqualTo(filters);
pagedGridData.RowCount.ShouldBeEqualTo(_rows.Count);
}
示例12: SaveMapToFile
public void SaveMapToFile (string pmFileName)
{
BinaryFormatter lvFormater = new BinaryFormatter ();
FileStream lvFile = File.Open (Application.persistentDataPath + "/" + pmFileName + ".dat", FileMode.OpenOrCreate);
GridData lvData = new GridData ();
lvData.x = GridDrawer.instance.gridWidth;
lvData.z = GridDrawer.instance.gridHeight;
lvData.graphicsStyle = FloorCreator.instance.GraphicsStyle;
lvData.obstacles = CollectObstacleData ();
lvData.players = CollectPlayersData ();
lvData.enemies = CollectEnemiesData ();
lvFormater.Serialize (lvFile, lvData);
lvFile.Close ();
}
示例13: FindTarget
private ActorBevBase FindTarget(GridData gridData, List<ActorBevBase> actorList)
{
byte minDistance = FightMgr.Instance.GetMaxMagnitudeDistance();
byte minIndex = FightMgr.Instance.GetMaxIndex();
ActorBevBase target = null;
foreach (ActorBevBase actor in actorList)
{
byte distance = FightMgr.Instance.CalculateMagnitudeDistance(gridData, actor.GridData, true);
if (distance < minDistance ||
(distance == minDistance && actor.Index < minIndex))
{
target = actor;
minIndex = target.Index;
minDistance = distance;
}
}
return target;
}
示例14: createControl
Control createControl(Composite parent) {
PixelConverter converter = new PixelConverter(parent);
var composite = new Composite(parent, SWT.NONE);
composite.setFont(parent.getFont());
var layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
//
// Label
//
var label = new Label(composite, SWT.LEFT | SWT.WRAP);
label.setFont(composite.getFont());
label.setText(Messages.librariesPreferencesLabelText);
var gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 2;
gd.verticalAlignment = GridData.BEGINNING;
label.setLayoutData(gd);
//
// Table
//
var tableComposite = new Composite(composite, SWT.NONE);
tableComposite.setFont(composite.getFont());
var tableColumnLayout = new TableColumnLayout();
tableComposite.setLayout(tableColumnLayout);
var table = new Table(tableComposite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK);
table.setFont(composite.getFont());
table.setHeaderVisible(false);
table.setLinesVisible(false);
var column = new TableColumn(table, SWT.NONE);
tableColumnLayout.setColumnData(column, new ColumnWeightData(100, false));
// Table viewer
tableViewer = new CheckboxTableViewer(table);
tableViewer.setContentProvider(tableContentProvider);
tableViewer.setCheckStateProvider(tableCheckStateProvider);
tableViewer.setLabelProvider(tableLabelProvider);
tableViewer.addCheckStateListener(tableCheckStateListener);
tableViewer.addSelectionChangedListener(event => {
示例15: Parse
/// <summary>
/// Parse grid data from R host and return <see cref="GridData"/>
/// </summary>
/// <param name="input">serialized string from R host</param>
/// <returns>parsed data</returns>
public static GridData Parse(string input) {
input = CleanEscape(input);
//
// the implementation here is virtually hard-coded
// R routine uses dput of list that contains four children in order; dimnames, row.names, col.names, data
// row.names is character vector, col.names is character vector, and data contains is list of columns, which is in turn a named character vector
// This is for performance, as generic formatting such as json is too expensive
//
int current = 0;
current = input.IndexOf("structure", current, StringComparison.OrdinalIgnoreCase);
current = input.IndexOf('(', current);
current = input.IndexOf("list", current, StringComparison.OrdinalIgnoreCase);
current = input.IndexOf('(', current);
current = input.IndexOf("dimnames", current, StringComparison.OrdinalIgnoreCase);
current = input.IndexOf('=', current);
string dimnamesValue;
current = FirstQuotedString(input, current, out dimnamesValue);
var validHeaderNames = (GridData.HeaderNames) Enum.Parse(typeof(GridData.HeaderNames), dimnamesValue);
List<string> rowNames = new List<string>();
current = NamedValue(input, "row.names", rowNames, current, true);
current = input.IndexOf(',', current);
List<string> columnNames = new List<string>();
current = NamedValue(input, "col.names", columnNames, current, true);
current = input.IndexOf(',', current);
current = input.IndexOf("data", current, StringComparison.OrdinalIgnoreCase);
current = input.IndexOf('=', current);
current = input.IndexOf("structure", current, StringComparison.OrdinalIgnoreCase);
current = input.IndexOf('(', current);
List<string> values = new List<string>();
current = Vector(input, values, current);
GridData data = new GridData(rowNames, columnNames, values);
data.ValidHeaderNames = validHeaderNames;
return data;
}