本文整理汇总了C#中Persistence.GetEntities方法的典型用法代码示例。如果您正苦于以下问题:C# Persistence.GetEntities方法的具体用法?C# Persistence.GetEntities怎么用?C# Persistence.GetEntities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Persistence
的用法示例。
在下文中一共展示了Persistence.GetEntities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application_Startup
private void Application_Startup(object sender, StartupEventArgs e)
{
SystemEvents.SessionSwitch += SystemEventsOnSessionSwitch;
SystemEvents.SessionEnded += SystemEventsOnSessionEnded;
swriter = new StringWriter();
Console.SetOut(swriter);
XmlConfigurator.Configure();
RegistrarLog("<b>Inicializando la aplicación...</b>");
RegistrarLog("<b>Cargando opciones de la aplicación...</b>");
LoadOpciones();
SonarActivo = true;
Sonar = new Dictionary<int, BackgroundWorker>();
try
{
IPersistence<FileInspector> servInspF = new Persistence<FileInspector>();
var inspFilterF = new FileInspector();
var rastreadoresF = servInspF.GetEntities(inspFilterF);
foreach (var insp in rastreadoresF)
{
AddWork(insp);
}
IPersistence<ServiceInspector> servInspV = new Persistence<ServiceInspector>();
var inspFilterV = new ServiceInspector();
var rastreadoresV = servInspV.GetEntities(inspFilterV);
foreach (var insp in rastreadoresV)
{
AddWork(insp);
}
}
catch (Exception ex)
{
RegistrarLog("<b>Error al inicializar la aplicación: </b>" + ex.Message);
}
RegistrarLog("<b>Inicialización de la aplicación Finalizada</b>");
}
示例2: InspectorsRefresh
private void InspectorsRefresh(Inspector inspector, Boolean added = false)
{
var lstInspectors = new List<Inspector>();
if (inspector == null)
{
IPersistence<FileInspector> servInspF = new Persistence<FileInspector>();
lstInspectors.AddRange(servInspF.GetEntities(new FileInspector(){Enable = null}));
lstInspectors.ForEach(FillRulesAux);
IPersistence<ServiceInspector> servInspV = new Persistence<ServiceInspector>();
lstInspectors.AddRange(servInspV.GetEntities());
}
else
{
lstInspectors = (List<Inspector>)lstVInspectors.ItemsSource;
if (added)
{
FillRulesAux(inspector);
lstInspectors.Add(inspector);
}
else
lstInspectors.Remove(inspector);
}
lstVInspectors.ItemsSource = null;
lstVInspectors.ItemsSource = lstInspectors;
}