本文整理汇总了C#中IData类的典型用法代码示例。如果您正苦于以下问题:C# IData类的具体用法?C# IData怎么用?C# IData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IData类属于命名空间,在下文中一共展示了IData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataTableDataAdd
public static void DataTableDataAdd(DataTable Table, IData Data, string FName)
{
DataRow row = Table.NewRow();
string str = "";
if (Data.Status == DataStatus.Recept)
{
str = Resources.ResourceManager.GetString("CORE108");
if (Data.UserFolder.Trim().Length > 0)
{
str = Data.UserFolder.Substring(6);
}
}
else if (Data.Status == DataStatus.Sent)
{
str = Resources.ResourceManager.GetString("CORE109");
}
row["clFolder"] = str;
row["clAirSea"] = UDataView.GetASType(Data);
row["clJobCode"] = Data.JobCode;
row["clOutCode"] = Data.OutCode;
row["clInputNo"] = Data.Header.InputInfo;
row["clJobInfo"] = Data.Header.Subject;
row["clTimeStamp"] = Data.TimeStamp.ToString("dd/MM/yyyy HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
row["clFileName"] = FName;
Table.Rows.Add(row);
}
示例2: DebugData
private static void DebugData(IData data)
{
foreach (var a in data.Data)
{
Console.WriteLine(Resources.Program_Main__0_____1_, a.Value, a.Count);
}
}
示例3: ViewCounter
public ViewCounter(IData data, Dictionary<string, string> preValues)
{
_data = data;
if (preValues != null)
{
if (preValues.ContainsKey("hideCounter"))
_hideCounter = (preValues["hideCounter"] == "1" ? true : false);
if (preValues.ContainsKey("enableHistory"))
_enableHistory = (preValues["enableHistory"] == "1" ? true : false);
if (preValues.ContainsKey("disableReset"))
_disableReset = (preValues["disableReset"] == "1" ? true : false);
if (preValues.ContainsKey("category"))
_category = preValues["category"];
else
_category = string.Empty;
}
int.TryParse(HttpContext.Current.Request["id"], out _nodeId);
_currentViewCount = ViewCount.GetViewCount(_nodeId, _category);
}
示例4: Create
public static StateExpression<IData, IData[], IData> Create(IExpression arg, DataInteger lagOffset, IData argDefault)
{
//return new StateExpression<IData, Tuple<IData, IData>, IData>(
// (a) => new Tuple<IData, IData>(DataTypeUtil.GetDefaultFromDataType(arg.GetResultType()), a),
// delegate (Tuple<IData, IData> s, IData a) { s = new Tuple<IData, IData>(s.Item2, a); return s; },
// (s) => s.Item1,
// ConvertExpression.CreateData(arg)
// );
return new StateExpression<IData, IData[], IData>(
delegate (IData a)
{
var s = new IData[lagOffset + 1];
for (int i = 0; i < lagOffset; i++)
s[i] = argDefault;
s[lagOffset] = a;
return s;
},
delegate (IData[] s, IData a)
{
for (int i = 0; i < lagOffset; i++)
s[i] = s[i + 1];
s[lagOffset] = a;
return s;
},
(s) => s[0],
ConvertExpression.CreateData(arg)
);
}
示例5: Process
public override IData Process(IData data)
{
DispatcherHelper.RunAsync(() =>
{
if (_dataStats.All(s => s.Type != data.GetType()))
{
var stat = new Stat
{
Type = data.GetType(),
Count = 1
};
stat.Watch.Start();
DataStats.Add(stat);
}
else
{
var stat = _dataStats.Single(s => s.Type == data.GetType());
stat.Fps = 1000.0 / stat.Watch.ElapsedMilliseconds;
stat.Watch.Restart();
stat.Count++;
}
});
return data;
}
示例6: GetParent
/// <exclude />
public IData GetParent(IData data)
{
if (data == null) throw new ArgumentNullException("data");
Entry entry = GetEntry(data.GetType());
object propertyValue = entry.PropertyValueMethodInfo.Invoke(data, null);
if (entry.PropertyValueMethodInfo.ReturnType == typeof(Guid))
{
if (Equals(propertyValue, Guid.Empty)) return null;
}
else
{
if (Equals(propertyValue, entry.NullValue)) return null;
}
using (DataScope dataScope = new DataScope(data.DataSourceId.DataScopeIdentifier))
{
List<object> queryResult = GetQueryResult(entry.ParentDataType, entry.ParentIdPropertyName, propertyValue);
if (queryResult.Count == 0) throw new InvalidOperationException(string.Format("The parent of the type {0} with the id ({1}) value of {2} was not found", entry.ParentDataType, entry.ParentIdPropertyName, propertyValue));
if (queryResult.Count > 1) throw new InvalidOperationException(string.Format("More than one parent of the type {0} with the id ({1}) value of {2} was found", entry.ParentDataType, entry.ParentIdPropertyName, propertyValue));
return (IData)queryResult[0];
}
}
示例7: Process
public List<State> Process(IData data)
{
var currentStates = GetPersistedOrInitial(data);
bool allSet = true;
foreach (var currentStateTemp in currentStates)
{
var currentState = currentStateTemp;
currentState.Execute(data);
RuleElement ruleElement = _rules.Select(x => x.GetRuleElement(currentState.GetType())).FirstOrDefault(x => x != null);
if (ruleElement == null)
Debug.Fail("Should always have an event or machine will never stop processing");
bool currentSet = (from FieldInfo fieldInfo in ruleElement.SourceEvents select (Event) fieldInfo.GetValue(currentState)).All(@event => @event.IsSet);
if (!currentSet)
{
allSet = false;
}
}
if (allSet)
{
Rule rule = _rules.FirstOrDefault(r => r.RuleElements.Any(x => x.SourceType == currentStates.First().GetType()));
var newStates = _stateFactory.GetStates().Where(x => rule.DestinationTypes.Any(dest => dest == x.GetType()));
currentStates = newStates.ToList();
}
_persister.Set(data.Id, currentStates);
return currentStates;
}
示例8: CreateRecvData
public static RecvData CreateRecvData(IData data)
{
RecvData data2;
data2.ResultData = null;
data2.OtherData = null;
data2.MData = null;
if (data.Header.DataType == "M")
{
data2.MData = data;
data2.ResultData = (IData) data.Clone();
if (data2.ResultData.ItemCount > 1)
{
data2.ResultData.Items.RemoveRange(1, data2.ResultData.ItemCount - 1);
}
data2.ResultData.Header.DataType = "R";
data2.ResultData.Header.Div = "000";
data2.ResultData.Header.EndFlag = " ";
data2.ResultData.CalcLength();
data2.OtherData = (IData) data.Clone();
data2.OtherData.Items.RemoveAt(0);
data2.OtherData.Header.DataType = "C";
data2.OtherData.Header.Div = "001";
data2.OtherData.Header.EndFlag = "E";
data2.OtherData.CalcLength();
return data2;
}
if (data.Header.DataType == "R")
{
data2.ResultData = data;
return data2;
}
data2.OtherData = data;
return data2;
}
示例9: BuildDefaultData
public override void BuildDefaultData(IData data)
{
base.BuildDefaultData(data);
data[DataElements.Pan] = 0.0;
data[DataElements.Tilt] = 0.0;
}
示例10: StoreItemId
private void StoreItemId(IData Data)
{
if (_data != null && _data.Value != null && !String.IsNullOrEmpty(_data.Value.ToString()))
{
int.TryParse(_data.Value.ToString(), out StoredItemId);
}
}
示例11: OnAfterBuildNew
public bool OnAfterBuildNew(IData data)
{
ILocalizedControlled localizedData = data as ILocalizedControlled;
if (localizedData != null)
{
if (!LocalizationScopeManager.IsEmpty)
{
localizedData.SourceCultureName = LocalizationScopeManager.CurrentLocalizationScope.Name;
}
else
{
CultureInfo cultureInfo = null;
if (UserValidationFacade.IsLoggedIn())
{
cultureInfo = UserSettings.ActiveLocaleCultureInfo;
}
if (cultureInfo == null)
{
cultureInfo = DataLocalizationFacade.DefaultLocalizationCulture;
}
if (cultureInfo != null)
{
localizedData.SourceCultureName = cultureInfo.Name;
}
}
}
return false;
}
示例12: OrderStatusSectionDataEditor
public OrderStatusSectionDataEditor(IData data)
{
_data = data;
_orderOverview = new OrderOverview();
_orderOverview.OnOrderSelected += orderGuid =>
{
try
{
Guid guid;
Guid.TryParse(orderGuid, out guid);
if (guid == Guid.Empty)
{
Log.Instance.LogError("Trying to open an order with a broken guid: " + orderGuid);
return;
}
API.CMS.CreateOrderDocument(guid);
}
catch (Exception ex)
{
Log.Instance.LogError(ex, "When opening order");
}
};
if (int.TryParse(HttpContext.Current.Request["id"], out _containingDocumentId))
{
// !Page.IsPostBack && werkt niet
//var orderSection = string.Empty;
//var property = new Document(_containingDocumentId).getProperty("orderSection");
//if (property != null)
// orderSection = property.Value.ToString();
//_orderOverview.SetStatusFilter(orderSection); dit kan niet, geeft raar effect na wisselen
}
}
示例13: EncodeRequest
public static ClientMessage EncodeRequest(string name, long startSequence, int minCount, int maxCount,
IData filter)
{
var requiredDataSize = RequestParameters.CalculateDataSize(name, startSequence, minCount, maxCount, filter);
var clientMessage = ClientMessage.CreateForEncode(requiredDataSize);
clientMessage.SetMessageType((int) RequestType);
clientMessage.SetRetryable(Retryable);
clientMessage.Set(name);
clientMessage.Set(startSequence);
clientMessage.Set(minCount);
clientMessage.Set(maxCount);
bool filter_isNull;
if (filter == null)
{
filter_isNull = true;
clientMessage.Set(filter_isNull);
}
else
{
filter_isNull = false;
clientMessage.Set(filter_isNull);
clientMessage.Set(filter);
}
clientMessage.UpdateFrameLength();
return clientMessage;
}
示例14: Create
public Primitives.Container Create( IData data, Settings settings )
{
if( data == null )
{
throw new ArgumentNullException( "data" );
}
if( settings == null )
{
throw new ArgumentNullException( "settings" );
}
Primitives.Container container = new Primitives.Container();
Primitives.BoundsMarker bounds = new Primitives.BoundsMarker( new Types.Rectangle( 0, 0, settings.Width, settings.Height ) );
bounds.Style.Add( "GraphContainer" );
container.AddBack( bounds );
double minVertData = double.MaxValue;
double maxVertData = double.MinValue;
for( int i = 0; i < data.RowCount; ++i )
{
for( int j = 0; j < data.ColumnCount; ++j )
{
double v = data[i, j];
minVertData = Math.Min( minVertData, v );
maxVertData = Math.Max( maxVertData, v );
}
}
return container;
}
示例15: CalculateDataSize
public static int CalculateDataSize(string name, IData value)
{
var dataSize = ClientMessage.HeaderSize;
dataSize += ParameterUtil.CalculateDataSize(name);
dataSize += ParameterUtil.CalculateDataSize(value);
return dataSize;
}