本文整理汇总了C#中Lib类的典型用法代码示例。如果您正苦于以下问题:C# Lib类的具体用法?C# Lib怎么用?C# Lib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lib类属于命名空间,在下文中一共展示了Lib类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CalculateRenewalDate
/// <summary>
/// Based on the current date, calculates the next time a certification will need
/// to be renewed.
/// </summary>
/// <param name="drug">The Drug to look-up. Only the Drug.ID is needed.</param>
/// <param name="base_date">The DateTime to base the calculate off of.</param>
/// <returns>DateTime reflecting the base_date plus the Drugs renewal period.</returns>
public static DateTime CalculateRenewalDate(Lib.Data.Drug drug, DateTime base_date)
{
// MJL 2013-11-05
// TODO: Implement the method
return (base_date + GetRenewalPeriod(drug));
}
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:14,代码来源:Drugs.cs
示例2: HasPendingChanges
public static bool HasPendingChanges(Lib.Data.Drug drug)
{
if( drug == null || !drug.ID.HasValue )
return false;
return HasPendingChanges(drug.ID);
}
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:7,代码来源:Drugs.cs
示例3: ContextMenuOpening
public void ContextMenuOpening(Lib.Control Control)
{
Control.GetContextMenuItem<ToolStripTextBox>("Minimum Text Box").Text = Control.Settings["minimum"];
Control.GetContextMenuItem<ToolStripTextBox>("Maximum Text Box").Text = Control.Settings["maximum"];
Control.GetContextMenuItem<ToolStripTextBox>("Increment Text Box").Text = Control.Settings["increment"];
Control.GetContextMenuItem<ToolStripTextBox>("Decimal Places Text Box").Text = Control.Settings["decimal_places"];
Control.GetContextMenuItem<ToolStripTextBox>("Set Command Text Box").Text = Control.Settings["set_command"];
}
开发者ID:ngpitt,项目名称:OpenLab,代码行数:8,代码来源:Spinner.cs
示例4: frmPointCommandHistory
public frmPointCommandHistory(Lib.Manager Manager, Outstation O, Point P)
{
InitializeComponent();
_manager = Manager;
_o = O;
_p = P;
}
开发者ID:robrhce,项目名称:Tulip,代码行数:8,代码来源:frmPointCommandHistory.cs
示例5: Run
/// <summary>
/// Run the code example.
/// </summary>
/// <param name="user">The DFP user object running the code example.</param>
public override void Run(Lib.DfpUser user) {
// Get the ContentMetadataKeyHierarchy service.
ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService =
(ContentMetadataKeyHierarchyService) user.GetService(
DfpService.v201405.ContentMetadataKeyHierarchyService);
// Set the ID of the content metadata key hierarchy to update.
long contentMetadataKeyHierarchyId =
long.Parse(_T("INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE"));
// Set the ID of the custom targeting key to be added as a hierarchy level
long customTargetingKeyId = long.Parse(_T("INSERT_CUSTOM_TARGETING_KEY_ID_HERE"));
// Create a statement to get content metadata key hierarchies.
StatementBuilder statementBuilder = new StatementBuilder()
.Where("WHERE id = :id")
.OrderBy("id ASC")
.Limit(1)
.AddValue("id", contentMetadataKeyHierarchyId);
try {
ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService
.getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement());
ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = page.results[0];
// Update the content metadata key hierarchy by adding a hierarchy level.
ContentMetadataKeyHierarchyLevel[] hierarchyLevels = contentMetadataKeyHierarchy
.hierarchyLevels;
ContentMetadataKeyHierarchyLevel hierarchyLevel = new ContentMetadataKeyHierarchyLevel();
hierarchyLevel.customTargetingKeyId = customTargetingKeyId;
hierarchyLevel.hierarchyLevel = hierarchyLevels.Length + 1;
List<ContentMetadataKeyHierarchyLevel> updatedHieratchyLevels =
new List<ContentMetadataKeyHierarchyLevel>();
updatedHieratchyLevels.AddRange(hierarchyLevels);
updatedHieratchyLevels.Add(hierarchyLevel);
contentMetadataKeyHierarchy.hierarchyLevels = updatedHieratchyLevels.ToArray();
// Update the content hierarchy on the server.
ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies =
contentMetadataKeyHierarchyService.updateContentMetadataKeyHierarchies(
new ContentMetadataKeyHierarchy[] {contentMetadataKeyHierarchy});
foreach (ContentMetadataKeyHierarchy updatedContentMetadataKeyHierarchy in
contentMetadataKeyHierarchies) {
Console.WriteLine("Content metadata key hierarchy with ID \"{0}\", name " +
"\"{1}\" was updated.", updatedContentMetadataKeyHierarchy.id,
updatedContentMetadataKeyHierarchy.name);
}
} catch (Exception ex) {
Console.WriteLine("Failed to update content metadata key hierarchies. Exception " +
"says \"{0}\"", ex.Message);
}
}
开发者ID:hoodapecan,项目名称:googleads-dotnet-lib,代码行数:61,代码来源:UpdateContentMetadataKeyHierarchies.cs
示例6: Create
public void Create(Lib.Control Control)
{
var label = new Label();
label.AutoSize = true;
Control.Controls.Add(label);
Control.Settings.Add("get_command", string.Empty);
}
开发者ID:ngpitt,项目名称:OpenLab,代码行数:9,代码来源:Meter.cs
示例7: GetEOCData
public string GetEOCData(Lib.Data.Drug d)
{
StringBuilder eocData = new StringBuilder();
foreach(Eoc eoc in _complianceSvc.GetByDrug(d.ID ?? 0))
{
eocData.Append(String.Format("data-{0}=\"1\" ", eoc.Name));
}
return eocData.ToString();
}
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:11,代码来源:list.ascx.cs
示例8: GetContextMenuItems
public ToolStripItem[] GetContextMenuItems(Lib.Control Control)
{
var getCommandMenuItem = new ToolStripMenuItem("Get Command");
var getCommandTextBox = new ToolStripTextBox("Get Command Text Box");
getCommandMenuItem.DropDownItems.Add(getCommandTextBox);
getCommandTextBox.TextChanged += new EventHandler(GetCommandToolStripTextBox_TextChanged);
getCommandTextBox.Tag = Control;
return new ToolStripItem[] { getCommandMenuItem };
}
开发者ID:ngpitt,项目名称:OpenLab,代码行数:11,代码来源:Meter.cs
示例9: UpdatePackageReference
public void UpdatePackageReference(Lib.PackageReference packageReference)
{
if (packageReference == null)
{
throw new ArgumentNullException("packageReference");
}
this._packageReference = packageReference;
this.Line = packageReference.StartLine;
this.Column = packageReference.StartPos;
}
开发者ID:OSSIndex,项目名称:audit.net,代码行数:12,代码来源:VulnerabilityTask.cs
示例10: VulnerabilityTask
public VulnerabilityTask(Lib.PackageReference packageReference, Lib.OSSIndex.Vulnerability vulnerability)
{
if (packageReference == null)
{
throw new ArgumentNullException("packageReference");
}
if (vulnerability == null)
{
throw new ArgumentNullException("vulnerability");
}
this._packageReference = packageReference;
this._vulnerability = vulnerability;
}
开发者ID:OSSIndex,项目名称:audit.net,代码行数:15,代码来源:VulnerabilityTask.cs
示例11: Login
public int Login(LoginModel loginModel, out Lib.BResult result)
{
result = new BResult();
var user = _userProfileRepo.Get().Where(x => x.UserName.Equals(loginModel.UserName, StringComparison.CurrentCultureIgnoreCase));
if (user == null || user.Count() != 1)
{
result.AddError("error", "not found");
return -1;
}
else
{
return user.First().Id;
}
}
开发者ID:sambruggeman,项目名称:test-dbdit,代码行数:15,代码来源:Security.cs
示例12: CanViewReport
public static bool CanViewReport(Lib.Data.Report report)
{
if( string.IsNullOrWhiteSpace( report.ForRoles ) )
return Framework.Security.Manager.HasRole( "dev" );
var roles = report.ForRoles.Split( new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries );
foreach( var role in roles )
{
if( Framework.Security.Manager.HasRole( role ) )
{
return true;
}
}
return false;
}
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:17,代码来源:Reports.cs
示例13: IsCertified
public static bool IsCertified( Lib.Data.UserProfile up, Lib.Data.Eoc eoc, Lib.Data.Drug drug, ref DateTime date_certified )
{
if( up == null || eoc == null )
return false;
var ut = up.UserType;
if( !eoc.HasUserType( ut ) )
return false;
if( ut.Name == "prescriber" )
{
var user_eocs = Lib.Data.UserEoc.FindByUserandDrug(up.ID.Value, drug.ID.Value);
foreach( var ue in user_eocs )
{
if( ue.EocID == eoc.ID.Value )
{
date_certified = ue.DateCompleted;
return true;
}
}
}
else if( ut.Name == "provider" )
{
var pu = Lib.Systems.Security.GetCurrentProviderUser();
if( pu == null || pu.PrimaryFacilityID == null )
return false;
var facility_eocs = Lib.Data.FacilityEoc.FindByFacilityandDrug( pu.PrimaryFacilityID.Value, drug.ID.Value );
foreach( var fe in facility_eocs )
{
if( fe.EocID == eoc.ID.Value )
{
date_certified = fe.DateCompleted;
return true;
}
}
}
else
return false;
return false;
}
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:45,代码来源:EOC.cs
示例14: Run
/// <summary>
/// Run the code example.
/// </summary>
/// <param name="user">The DFP user object running the code example.</param>
public override void Run(Lib.DfpUser user) {
// Get the ContentMetadataKeyHierarchy service.
ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService =
(ContentMetadataKeyHierarchyService) user.GetService(
DfpService.v201403.ContentMetadataKeyHierarchyService);
// Set the IDs of the custom targeting keys for the hierarchy.
long customTargetingKeyId1 = long.Parse(_T("INSERT_LEVEL_ONE_CUSTOM_TARGETING_KEY_ID_HERE"));
long customTargetingKeyId2 = long.Parse(_T("INSERT_LEVEL_TWO_CUSTOM_TARGETING_KEY_ID_HERE"));
List<ContentMetadataKeyHierarchyLevel> hierarchyLevels =
new List<ContentMetadataKeyHierarchyLevel>();
ContentMetadataKeyHierarchyLevel hierarchyLevel1 = new ContentMetadataKeyHierarchyLevel();
hierarchyLevel1.customTargetingKeyId = customTargetingKeyId1;
hierarchyLevel1.hierarchyLevel = 1;
hierarchyLevels.Add(hierarchyLevel1);
ContentMetadataKeyHierarchyLevel hierarchyLevel2 = new ContentMetadataKeyHierarchyLevel();
hierarchyLevel2.customTargetingKeyId = customTargetingKeyId2;
hierarchyLevel2.hierarchyLevel = 2;
hierarchyLevels.Add(hierarchyLevel2);
ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = new ContentMetadataKeyHierarchy();
contentMetadataKeyHierarchy.name = "Content hierarchy #" + new Random().Next(int.MaxValue);
contentMetadataKeyHierarchy.hierarchyLevels = hierarchyLevels.ToArray();
try {
// Create the content metadata key hierarchy on the server.
ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies =
contentMetadataKeyHierarchyService.createContentMetadataKeyHierarchies(
new ContentMetadataKeyHierarchy[] {contentMetadataKeyHierarchy});
foreach (ContentMetadataKeyHierarchy createdContentMetadataKeyHierarchy in
contentMetadataKeyHierarchies) {
Console.WriteLine("A content metadata key hierarchy with ID \"{0}\", name " +
"\"{1}\" and {2} levels was created.", createdContentMetadataKeyHierarchy.id,
createdContentMetadataKeyHierarchy.name,
createdContentMetadataKeyHierarchy.hierarchyLevels.Length);
}
} catch (Exception ex) {
Console.WriteLine("Failed to create content metadata key hierarchies. Exception says " +
"\"{0}\"", ex.Message);
}
}
开发者ID:hoodapecan,项目名称:googleads-dotnet-lib,代码行数:49,代码来源:CreateContentMetadataKeyHierarchies.cs
示例15: Run
/// <summary>
/// Run the code example.
/// </summary>
/// <param name="user">The DFP user object running the code example.</param>
public override void Run(Lib.DfpUser user) {
// Get the ContentMetadataKeyHierarchy service.
ContentMetadataKeyHierarchyService contentMetadataKeyHierarchyService =
(ContentMetadataKeyHierarchyService) user.GetService(
DfpService.v201408.ContentMetadataKeyHierarchyService);
// Set the ID of the content metadata key hierarchy to delete.
long contentMetadataKeyHierarchyId =
long.Parse(_T("INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE"));
// Create a statement to select a content metadata key hierarchy.
StatementBuilder statementBuilder = new StatementBuilder()
.Where("WHERE id = :id")
.OrderBy("id ASC")
.Limit(1)
.AddValue("id", contentMetadataKeyHierarchyId);
try {
// Get content metadata key hierarchies by statement.
ContentMetadataKeyHierarchyPage page = contentMetadataKeyHierarchyService
.getContentMetadataKeyHierarchiesByStatement(statementBuilder.ToStatement());
ContentMetadataKeyHierarchy contentMetadataKeyHierarchy = page.results[0];
Console.WriteLine("Content metadata key hierarchy with ID \"{0}\" will be deleted.",
contentMetadataKeyHierarchy.id);
statementBuilder.RemoveLimitAndOffset();
// Create action.
Google.Api.Ads.Dfp.v201408.DeleteContentMetadataKeyHierarchies action =
new Google.Api.Ads.Dfp.v201408.DeleteContentMetadataKeyHierarchies();
// Perform action.
UpdateResult result = contentMetadataKeyHierarchyService
.performContentMetadataKeyHierarchyAction(action, statementBuilder.ToStatement());
Console.WriteLine("Number of content metadata key hierarchies deleted: {0}",
result.numChanges);
} catch (Exception ex) {
Console.WriteLine("Failed to delete content metadata key hierarchies. " +
"Exception says \"{0}\"", ex.Message);
}
}
开发者ID:psmacchia,项目名称:googleads-dotnet-lib,代码行数:48,代码来源:DeleteContentMetadataKeyHierarchies.cs
示例16: Run
void Run (String[] args) {
Lib = new Lib ();
NodeToNamespace = new Dictionary<Node, Namespace> ();
if (ParseArguments (args) != 0) {
Environment.Exit (1);
}
Node root = LoadXml (InputFileName);
if (FilterFile != null)
Filters = Filter.Load (XDocument.Load (FilterFile), out default_filter_mode);
CreateTypes (root);
CreateMembers ();
GenerateCode ();
}
开发者ID:ctguxp,项目名称:cxxi,代码行数:19,代码来源:Generator.cs
示例17: AddEvent
public void AddEvent(Lib.DataRecord dr)
{
var ds = GetDataSeriesInfo(dr.Series);
if (ds == null) throw new Exception("Invalid data series id");
if (dr.DataMap != null && dr.DataMap.Count > 0)
{
if (ds.Fields.Count != dr.DataMap.Count) throw new Exception("Invalid number of fields in data map - expected " + ds.Fields.Count);
var lst = ds.Fields.Select(x =>
{
if (!dr.DataMap.ContainsKey(x.Name)) throw new Exception("Missing data field: " + x.Name);
return Convert.ToInt32(dr.DataMap[x.Name]);
});
this.AddEvent(dr.Series, dr.Ts, lst);
}
else
{
if (dr.Data == null || dr.Data.Length == 0) throw new Exception("Missing event data");
if (dr.Data.Length != ds.Fields.Count) throw new Exception("Invalid number of data fields - expected " + ds.Fields.Count);
this.AddEvent(dr.Series, dr.Ts, dr.Data.Select(x => Convert.ToInt32(x)));
}
}
开发者ID:lafar6502,项目名称:cogmon,代码行数:21,代码来源:EventAggregator.cs
示例18: GetById
public UserProfileModel GetById(int id, out Lib.BResult result)
{
result = new BResult();
var userDal = _userProfileRepo.Find(id);
if (userDal == null)
{
result.AddError("error", "not found in db");
return null;
}
var user = new UserProfileModel(userDal);
if (user == null)
{
result.AddError("error", "error converting to bll");
return null;
}
else
{
return user;
}
}
开发者ID:sambruggeman,项目名称:test-dbdit,代码行数:21,代码来源:UserProfile.cs
示例19: Compare
public static void Compare(Table table, Lib.Models.TeamStats teamStats)
{
if (1 != table.RowCount)
Assert.Fail("Expected one total team stats row for comparison but got {0}", table.RowCount);
var row = table.Rows[0];
if (row.ContainsKey("ABs"))
Assert.AreEqual(int.Parse(row["ABs"]), teamStats.TotalAtBats);
if (row.ContainsKey("Runs"))
Assert.AreEqual(int.Parse(row["Runs"]), teamStats.TotalRuns);
if (row.ContainsKey("Hits"))
Assert.AreEqual(int.Parse(row["Hits"]), teamStats.TotalHits);
if (row.ContainsKey("Doubles"))
Assert.AreEqual(int.Parse(row["Doubles"]), teamStats.TotalDoubles);
if (row.ContainsKey("Triples"))
Assert.AreEqual(int.Parse(row["Triples"]), teamStats.TotalTriples);
if (row.ContainsKey("HomeRuns"))
Assert.AreEqual(int.Parse(row["HomeRuns"]), teamStats.TotalHomeRuns);
if (row.ContainsKey("RBIs"))
Assert.AreEqual(int.Parse(row["RBIs"]), teamStats.TotalRunsBattedIn);
if (row.ContainsKey("Walks"))
Assert.AreEqual(int.Parse(row["Walks"]), teamStats.TotalWalks);
if (row.ContainsKey("StrikeOuts"))
Assert.AreEqual(int.Parse(row["StrikeOuts"]), teamStats.TotalStrikeOuts);
if (row.ContainsKey("Average"))
Assert.AreEqual(double.Parse(row["Average"]), teamStats.TotalAverage);
if (row.ContainsKey("OnBasePercentage"))
Assert.AreEqual(double.Parse(row["OnBasePercentage"]), teamStats.TotalOnBasePercentage);
}
开发者ID:alanstump,项目名称:Baseball,代码行数:40,代码来源:TeamStatsHelper.cs
示例20: Create
public void Create(Lib.Control Control)
{
var label = new Label();
var padding = new Padding();
var numericUpDown = new NumericUpDown();
padding.Top = 6;
label.Padding = padding;
label.AutoSize = true;
Control.Controls.Add(label);
numericUpDown.Tag = Control;
numericUpDown.Size = new Size(100, 20);
numericUpDown.ValueChanged += new EventHandler(NumericUpDown_ValueChanged);
Control.Controls.Add(numericUpDown);
Control.Settings.Add("minimum", "0");
Control.Settings.Add("maximum", "100");
Control.Settings.Add("increment", "1");
Control.Settings.Add("decimal_places", "0");
Control.Settings.Add("set_command", string.Empty);
}
开发者ID:ngpitt,项目名称:OpenLab,代码行数:22,代码来源:Spinner.cs
注:本文中的Lib类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论