content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
using System;
using System.Runtime.InteropServices;
using ManagedShell.Common.Enums;
namespace ManagedShell.Common.Interfaces
{
[ComImport, Guid("6584CE6B-7D82-49C2-89C9-C6BC02BA8C38"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAppVisibilityEvents
{
long AppVisibilityOnMonitorChanged(
[In] IntPtr hMonitor,
[In] MONITOR_APP_VISIBILITY previousMode,
[In] MONITOR_APP_VISIBILITY currentMode);
long LauncherVisibilityChange([In] bool currentVisibleState);
}
}
| 31 | 114 | 0.734767 | [
"Apache-2.0"
] | cairoshell/ManagedShell | src/ManagedShell.Common/Interfaces/IAppVisibilityEvents.cs | 560 | C# |
using NUnit.Framework;
using XFS = System.IO.Abstractions.TestingHelpers.MockUnixSupport;
namespace System.IO.Abstractions.TestingHelpers.Tests
{
[TestFixture]
public class MockFileSystemWatcherFactoryTests
{
[Test]
public void MockFileSystemWatcherFactory_CreateNew_ShouldThrowNotImplementedException()
{
var factory = new MockFileSystemWatcherFactory();
Assert.Throws<NotImplementedException>(() => factory.CreateNew());
}
[Test]
public void MockFileSystemWatcherFactory_FromPath_ShouldThrowNotImplementedException()
{
var path = XFS.Path(@"y:\test");
var factory = new MockFileSystemWatcherFactory();
Assert.Throws<NotImplementedException>(() => factory.FromPath(path));
}
}
}
| 32.92 | 95 | 0.678007 | [
"MIT"
] | BADF00D/System.IO.Abstractions | System.IO.Abstractions.TestingHelpers.Tests/MockFileSystemWatcherFactoryTests.cs | 825 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
using Verse;
namespace QEthics
{
public class RecipeWorker_GenomeSequencing : RecipeWorker
{
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
if (pawn.IsValidGenomeSequencingTarget())
{
yield return null;
}
yield break;
}
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill)
{
RecipeOutcomeProperties props = ingredients?.FirstOrDefault()?.def.GetModExtension<RecipeOutcomeProperties>() ?? null;
if(props != null)
{
Thing genomeSequence = GenomeUtility.MakeGenomeSequence(pawn, props.outputThingDef);
GenPlace.TryPlaceThing(genomeSequence, billDoer.Position, billDoer.Map, ThingPlaceMode.Near);
}
}
}
}
| 31.84375 | 130 | 0.64475 | [
"MIT"
] | Danikuh/QuestionableEthicsEnhanced | QEE/Workers/RecipeWorker_GenomeSequencing.cs | 1,021 | C# |
using RexConnectClient.Core;
using RexConnectClient.Core.Result;
using RexConnectClient.Core.Transfer;
namespace RexConnectClient.Test.Common {
/*================================================================================================*/
public class TestResponseResult : ResponseResult {
////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------*/
public TestResponseResult(IRexConnContext pContext) : base(pContext) {}
////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------*/
public virtual void SetTestResponse(Response pResponse) {
Response = pResponse;
}
}
} | 36.25 | 101 | 0.335632 | [
"Apache-2.0"
] | inthefabric/RexConnectClient | Solution/RexConnectClient.Test/Common/TestResponseResult.cs | 872 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Amazon Kinesis Client Library .NET")]
[assembly: AssemblyDescription("Amazon Kinesis Client Library for .NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyProduct("Amazon Kinesis Client Library .NET")]
[assembly: AssemblyCopyright("Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
// Required for Substitutes in tests
[assembly:InternalsVisibleTo("DynamicProxyGenAssembly2")]
[assembly:InternalsVisibleTo("ClientLibrary.Test")] | 43.290323 | 104 | 0.763785 | [
"MIT"
] | ciaranodonnell/KinesisDotNet | Code/Amazon/ClientLibrary/Properties/AssemblyInfo.cs | 1,344 | C# |
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Fluid;
using Fluid.Values;
namespace OrchardCore.Liquid.Filters
{
public class LiquidFilter : ILiquidFilter
{
private readonly ILiquidTemplateManager _liquidTemplateManager;
private readonly HtmlEncoder _htmlEncoder;
public LiquidFilter(ILiquidTemplateManager liquidTemplateManager, HtmlEncoder htmlEncoder)
{
_liquidTemplateManager = liquidTemplateManager;
_htmlEncoder = htmlEncoder;
}
public async ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArguments arguments, TemplateContext ctx)
{
var content = await _liquidTemplateManager.RenderAsync(input.ToStringValue(), _htmlEncoder, arguments.At(0));
return new StringValue(content, false);
}
}
}
| 32.923077 | 121 | 0.71729 | [
"BSD-3-Clause"
] | 3bit/OrchardCore | src/OrchardCore.Modules/OrchardCore.Liquid/Filters/LiquidFilter.cs | 856 | C# |
namespace MeasurementUnitsManagement.Models.Entities
{
public class FormularizedUnitModel : BaseUnit
{
public string FormulatedFromTheBaseUnit { get; set; }
public string FormulatedToTheBaseUnit { get; set; }
}
} | 30.5 | 63 | 0.709016 | [
"MIT"
] | omidhosseini/MeasurementUnitsManagement | MeasurementUnitsManagement.Models/Entities/FormularizedUnitModel.cs | 244 | C# |
using Augury.Lucene;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Augury.Test.Serialization
{
[TestClass]
public class SpellCheckSerializationTest : SerializationTestBase<SpellCheck>
{
protected override SpellCheck CreateInstance()
{
const string files = @"..\..\SampleTexts\The lost world.txt";
return new SpellCheck(CorpusProcessor.ParseWords(files), new JaroWinkler());
}
}
}
| 28.875 | 88 | 0.690476 | [
"MIT",
"Unlicense"
] | jeanbern/Augury | Augury.Tests/Serialization/SpellCheckSerializationTest.cs | 464 | C# |
using FluentMigrator;
using Ridics.Authentication.Database.Migrations.TagTypes;
using Ridics.DatabaseMigrator.Shared.TagsAttributes;
namespace Ridics.Authentication.Database.Migrations.Migrations.Authentication
{
[DatabaseTags(DatabaseTagTypes.VokabularAuthDB)]
[MigrationTypeTags(MigrationTypeTagTypes.Structure, MigrationTypeTagTypes.All)]
[Migration(059)]
public class M_059_ResourcePermissionActions : ForwardOnlyMigration
{
public M_059_ResourcePermissionActions()
{
}
public override void Up()
{
Create.Table("ResourcePermissionTypeAction")
.WithColumn("Id").AsInt32().NotNullable().PrimaryKey("PK_ResourcePermissionTypeAction(Id)").Identity()
.WithColumn("Name").AsString(50).NotNullable()
.WithColumn("Description").AsString(500).Nullable()
.WithColumn("ResourcePermissionTypeId").AsInt32().NotNullable()
.ForeignKey("FK_ResourcePermissionTypeAction(ResourcePermissionType)", "ResourcePermissionType", "Id");
Create.UniqueConstraint("UQ_ResourcePermissionTypeAction(Name)(ResourcePermissionTypeId)")
.OnTable("ResourcePermissionTypeAction")
.Columns("Name", "ResourcePermissionTypeId");
Delete.UniqueConstraint("UQ_ResourcePermission(ResourceId)(ResourcePermissionTypeId)").FromTable("ResourcePermission");
Delete.ForeignKey("FK_ResourcePermission(ResourcePermissionType)").OnTable("ResourcePermission");
Delete.Column("ResourcePermissionTypeId").FromTable("ResourcePermission");
Alter.Table("ResourcePermission")
.AddColumn("ResourcePermissionTypeActionId").AsInt32().NotNullable()
.ForeignKey("FK_ResourcePermission(ResourcePermissionTypeAction)", "ResourcePermissionTypeAction", "Id");
Create.UniqueConstraint("UQ_ResourcePermission(ResourceId)(ResourcePermissionTypeActionId)")
.OnTable("ResourcePermission")
.Columns("ResourceId", "ResourcePermissionTypeActionId");
Delete.UniqueConstraint("UQ_User_ResourcePermissionType(UserId)(ResourcePermissionTypeId)").FromTable("User_ResourcePermissionType");
Delete.Table("User_ResourcePermissionType");
Create.Table("User_ResourcePermissionTypeAction")
.WithColumn("UserId").AsInt32().NotNullable()
.ForeignKey("FK_User_ResourcePermissionTypeAction(UserId)", "User", "Id")
.WithColumn("ResourcePermissionTypeActionId").AsInt32().NotNullable()
.ForeignKey("FK_User_ResourcePermissionTypeAction(ResourcePermissionTypeActionId)", "ResourcePermissionTypeAction", "Id");
Create.UniqueConstraint("UQ_User_ResourcePermissionTypeAction(UserId)(ResourcePermissionTypeActionId)")
.OnTable("User_ResourcePermissionTypeAction")
.Columns("UserId", "ResourcePermissionTypeActionId");
Delete.UniqueConstraint("UQ_Role_ResourcePermissionType(RoleId)(ResourcePermissionTypeId)").FromTable("Role_ResourcePermissionType");
Delete.Table("Role_ResourcePermissionType");
Create.Table("Role_ResourcePermissionTypeAction")
.WithColumn("RoleId").AsInt32().NotNullable()
.ForeignKey("FK_Role_ResourcePermissionTypeAction(RoleId)", "Role", "Id")
.WithColumn("ResourcePermissionTypeActionId").AsInt32().NotNullable()
.ForeignKey("FK_Role_ResourcePermissionTypeAction(ResourcePermissionTypeActionId)", "ResourcePermissionTypeAction", "Id");
Create.UniqueConstraint("UQ_Role_ResourcePermissionTypeAction(RoleId)(ResourcePermissionTypeActionId)")
.OnTable("Role_ResourcePermissionTypeAction")
.Columns("RoleId", "ResourcePermissionTypeActionId");
}
}
} | 56.042857 | 145 | 0.704563 | [
"BSD-3-Clause"
] | RIDICS/Authentication | Solution/Ridics.Authentication.Database.Migrations/Migrations/Authentication/M_059_ResourcePermissionActions.cs | 3,925 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.ContainerRegistry.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The properties for updating encoded task step.
/// </summary>
[Newtonsoft.Json.JsonObject("EncodedTask")]
public partial class EncodedTaskStepUpdateParameters : TaskStepUpdateParameters
{
/// <summary>
/// Initializes a new instance of the EncodedTaskStepUpdateParameters
/// class.
/// </summary>
public EncodedTaskStepUpdateParameters()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the EncodedTaskStepUpdateParameters
/// class.
/// </summary>
/// <param name="contextPath">The URL(absolute or relative) of the
/// source context for the task step.</param>
/// <param name="encodedTaskContent">Base64 encoded value of the
/// template/definition file content.</param>
/// <param name="encodedValuesContent">Base64 encoded value of the
/// parameters/values file content.</param>
/// <param name="values">The collection of overridable values that can
/// be passed when running a task.</param>
public EncodedTaskStepUpdateParameters(string contextPath = default(string), string encodedTaskContent = default(string), string encodedValuesContent = default(string), IList<SetValue> values = default(IList<SetValue>))
: base(contextPath)
{
EncodedTaskContent = encodedTaskContent;
EncodedValuesContent = encodedValuesContent;
Values = values;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets base64 encoded value of the template/definition file
/// content.
/// </summary>
[JsonProperty(PropertyName = "encodedTaskContent")]
public string EncodedTaskContent { get; set; }
/// <summary>
/// Gets or sets base64 encoded value of the parameters/values file
/// content.
/// </summary>
[JsonProperty(PropertyName = "encodedValuesContent")]
public string EncodedValuesContent { get; set; }
/// <summary>
/// Gets or sets the collection of overridable values that can be
/// passed when running a task.
/// </summary>
[JsonProperty(PropertyName = "values")]
public IList<SetValue> Values { get; set; }
}
}
| 37.402439 | 227 | 0.637757 | [
"MIT"
] | AnanyShah/azure-sdk-for-net | src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStepUpdateParameters.cs | 3,067 | C# |
using CodeModel.Graphs;
using CodeModel.RuleEngine;
using CodeModel.Symbols;
namespace CodeModel.Rules
{
public class UsesDateTimeNowViolation : Violation, IViolationWithSourceLocation, INodeViolation
{
public SourceLocation? SourceLocation { get; private set; }
public Node Node { get; private set; }
public UsesDateTimeNowViolation(Node node, SourceLocation? sourceLocation)
{
this.Node = node;
this.SourceLocation = sourceLocation;
}
}
} | 28.777778 | 99 | 0.69112 | [
"Apache-2.0"
] | Novakov/HighLevelCodeAnalysis | src/CodeModel/Rules/UsesDateTimeNowViolation.cs | 518 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.WebSites.Models
{
using Azure;
using Management;
using WebSites;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Object representing a metric for any resource .
/// </summary>
public partial class ResourceMetric
{
/// <summary>
/// Initializes a new instance of the ResourceMetric class.
/// </summary>
public ResourceMetric() { }
/// <summary>
/// Initializes a new instance of the ResourceMetric class.
/// </summary>
/// <param name="name">Name of metric.</param>
/// <param name="unit">Metric unit.</param>
/// <param name="timeGrain">Metric granularity. E.g PT1H, PT5M,
/// P1D</param>
/// <param name="startTime">Metric start time.</param>
/// <param name="endTime">Metric end time.</param>
/// <param name="resourceId">Metric resource Id.</param>
/// <param name="id">Resource Id.</param>
/// <param name="metricValues">Metric values.</param>
/// <param name="properties">Properties.</param>
public ResourceMetric(ResourceMetricName name = default(ResourceMetricName), string unit = default(string), string timeGrain = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string resourceId = default(string), string id = default(string), IList<ResourceMetricValue> metricValues = default(IList<ResourceMetricValue>), IList<ResourceMetricProperty> properties = default(IList<ResourceMetricProperty>))
{
Name = name;
Unit = unit;
TimeGrain = timeGrain;
StartTime = startTime;
EndTime = endTime;
ResourceId = resourceId;
Id = id;
MetricValues = metricValues;
Properties = properties;
}
/// <summary>
/// Gets name of metric.
/// </summary>
[JsonProperty(PropertyName = "name")]
public ResourceMetricName Name { get; protected set; }
/// <summary>
/// Gets metric unit.
/// </summary>
[JsonProperty(PropertyName = "unit")]
public string Unit { get; protected set; }
/// <summary>
/// Gets metric granularity. E.g PT1H, PT5M, P1D
/// </summary>
[JsonProperty(PropertyName = "timeGrain")]
public string TimeGrain { get; protected set; }
/// <summary>
/// Gets metric start time.
/// </summary>
[JsonProperty(PropertyName = "startTime")]
public System.DateTime? StartTime { get; protected set; }
/// <summary>
/// Gets metric end time.
/// </summary>
[JsonProperty(PropertyName = "endTime")]
public System.DateTime? EndTime { get; protected set; }
/// <summary>
/// Gets metric resource Id.
/// </summary>
[JsonProperty(PropertyName = "resourceId")]
public string ResourceId { get; protected set; }
/// <summary>
/// Gets resource Id.
/// </summary>
[JsonProperty(PropertyName = "id")]
public string Id { get; protected set; }
/// <summary>
/// Gets metric values.
/// </summary>
[JsonProperty(PropertyName = "metricValues")]
public IList<ResourceMetricValue> MetricValues { get; protected set; }
/// <summary>
/// Gets properties.
/// </summary>
[JsonProperty(PropertyName = "properties")]
public IList<ResourceMetricProperty> Properties { get; protected set; }
}
}
| 36.267857 | 489 | 0.599212 | [
"MIT"
] | DiogenesPolanco/azure-sdk-for-net | src/ResourceManagement/WebSites/Microsoft.Azure.Management.Websites/Generated/Models/ResourceMetric.cs | 4,062 | C# |
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Licensed under the MIT License.
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
namespace Datasync.Common.Test.Models
{
/// <summary>
/// Deserialize everything into the Data object.
/// </summary>
[ExcludeFromCodeCoverage]
public class ClientObject
{
[JsonExtensionData]
public Dictionary<string, object> Data { get; set; }
}
}
| 25.15 | 61 | 0.703777 | [
"MIT"
] | fileman/azure-mobile-apps | sdk/dotnet/test/Datasync.Common.Test/Models/ClientObject.cs | 505 | C# |
using System;
using Android.Runtime;
using Android.Webkit;
namespace QuilljsCross.Android.Quilljs
{
public class ValueCallback
: Java.Lang.Object, IValueCallback
{
private readonly Action<string> _callback;
public ValueCallback(Action<string> callback)
{
_callback = callback;
}
public void OnReceiveValue(Java.Lang.Object value)
{
_callback?.Invoke(value.ToString());
}
protected ValueCallback(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
}
}
}
| 22.392857 | 82 | 0.62201 | [
"MIT"
] | MrClockOff/QuilljsCross | QuilljsCross.Android/Quilljs/ValueCallback.cs | 629 | C# |
// ======================================================================
//
// filename : ExportTestData.cs
// description :
//
// created by 雪雁 at 2019-11-05 20:02
// 文档官网:https://docs.xin-lai.com
// 公众号教程:麦扣聊技术
// QQ群:85318032(编程交流)
// Blog:http://www.cnblogs.com/codelove/
//
// ======================================================================
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
namespace Magicodes.ExporterAndImporter.Tests.Models.Export
{
/// <summary>
/// 在Excel导出中,Name将为Sheet名称
/// 在HTML、Pdf、Word导出中,Name将为标题
/// </summary>
[Exporter(Name = "通用导出测试")]
public class ExportTestData
{
/// <summary>
/// </summary>
[Display(Name = "列1")]
public string Name1 { get; set; }
[ExporterHeader(DisplayName = "列2")] public string Name2 { get; set; }
public string Name3 { get; set; }
public string Name4 { get; set; }
}
} | 29.222222 | 78 | 0.489544 | [
"MIT"
] | JacksonWang2016/Magicodes.IE | src/Magicodes.ExporterAndImporter.Tests/Models/Export/ExportTestData.cs | 1,164 | C# |
/*
* NiFi Rest Api
*
* The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, definitions of the expected input and output, potential response codes, and the authorizations required to invoke each service.
*
* OpenAPI spec version: 1.9.1
* Contact: dev@nifi.apache.org
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
namespace NiFi.Swagger.Model
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
/// <summary>
/// LineageResultsDTO
/// </summary>
[DataContract]
public partial class LineageResultsDTO : IEquatable<LineageResultsDTO>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="LineageResultsDTO" /> class.
/// </summary>
/// <param name="errors">Any errors that occurred while generating the lineage..</param>
/// <param name="nodes">The nodes in the lineage..</param>
/// <param name="links">The links between the nodes in the lineage..</param>
public LineageResultsDTO(List<string> errors = default(List<string>), List<ProvenanceNodeDTO> nodes = default(List<ProvenanceNodeDTO>), List<ProvenanceLinkDTO> links = default(List<ProvenanceLinkDTO>))
{
this.Errors = errors;
this.Nodes = nodes;
this.Links = links;
}
/// <summary>
/// Any errors that occurred while generating the lineage.
/// </summary>
/// <value>Any errors that occurred while generating the lineage.</value>
[DataMember(Name="errors", EmitDefaultValue=false)]
public List<string> Errors { get; set; }
/// <summary>
/// The nodes in the lineage.
/// </summary>
/// <value>The nodes in the lineage.</value>
[DataMember(Name="nodes", EmitDefaultValue=false)]
public List<ProvenanceNodeDTO> Nodes { get; set; }
/// <summary>
/// The links between the nodes in the lineage.
/// </summary>
/// <value>The links between the nodes in the lineage.</value>
[DataMember(Name="links", EmitDefaultValue=false)]
public List<ProvenanceLinkDTO> Links { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class LineageResultsDTO {\n");
sb.Append(" Errors: ").Append(this.Errors).Append("\n");
sb.Append(" Nodes: ").Append(this.Nodes).Append("\n");
sb.Append(" Links: ").Append(this.Links).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as LineageResultsDTO);
}
/// <summary>
/// Returns true if LineageResultsDTO instances are equal
/// </summary>
/// <param name="input">Instance of LineageResultsDTO to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(LineageResultsDTO input)
{
if (input == null)
return false;
return
(
this.Errors == input.Errors ||
this.Errors != null &&
this.Errors.SequenceEqual(input.Errors)
) &&
(
this.Nodes == input.Nodes ||
this.Nodes != null &&
this.Nodes.SequenceEqual(input.Nodes)
) &&
(
this.Links == input.Links ||
this.Links != null &&
this.Links.SequenceEqual(input.Links)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Errors != null)
hashCode = hashCode * 59 + this.Errors.GetHashCode();
if (this.Nodes != null)
hashCode = hashCode * 59 + this.Nodes.GetHashCode();
if (this.Links != null)
hashCode = hashCode * 59 + this.Links.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 38.212903 | 478 | 0.550734 | [
"Apache-2.0"
] | mendonca-andre/NiFi.Swagger | NiFi.Swagger/Model/LineageResultsDTO.cs | 5,923 | C# |
using CssTemplatesForFree.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace CssTemplatesForFree.Controllers
{
public class CsstemplatesController : ApiController
{
DBContext db = new DBContext();
// GET api/csstemplates
public object Get()
{
return Get(1);
}
// GET api/csstemplates
public object Get(int? p)
{
if (!p.HasValue)
p = 1;
int pagesize = 9;
var list = db.cssTemplates.Select(c => c).OrderBy(r => r.id).Skip((p.Value - 1) * pagesize).Take(pagesize);
return new { list = list.ToList().Select(c => c.toCssTemplateDto()), total = db.cssTemplates.Count(), pagesize = pagesize};
}
// GET api/csstemplates
public object GetByTemplateName(string name)
{
if (!string.IsNullOrEmpty(name))
{
var list = db.cssTemplates.Where(c => c.name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
return new { list = list.ToList().Select(c => c.toCssTemplateDto()) };
}
return null;
}
// POST api/values
public void Post([FromBody]string value)
{
}
// PUT api/values/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
public void Delete(int id)
{
}
}
}
| 25.770492 | 135 | 0.548346 | [
"BSD-2-Clause"
] | victorantos/css-templates-website | Controllers/CsstemplatesController.cs | 1,574 | C# |
using JetBrains.Annotations;
using System;
using System.Data;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace CK.Sprite.Framework
{
public interface IDomainService : ITransientDependency
{
}
}
| 19.466667 | 58 | 0.787671 | [
"MIT"
] | kuangqifu/CK.Sprite.Job | 01_framework/CK.Sprite/CK.Sprite.Framework/Domain/IDomainService.cs | 294 | C# |
/**
* Copyright 2015 Canada Health Infoway, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author: $LastChangedBy: jmis $
* Last modified: $LastChangedDate: 2015-09-15 11:07:32 -0400 (Tue, 15 Sep 2015) $
* Revision: $LastChangedRevision: 9795 $
*/
/* This class was auto-generated by the message builder generator tools. */
namespace Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Interaction {
using Ca.Infoway.Messagebuilder.Annotation;
using Ca.Infoway.Messagebuilder.Model;
using Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Mcci_mt002300ca;
using Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Quqi_mt120006ca;
using Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Pharmacy.Porx_mt060160ca;
using Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Pharmacy.Porx_mt060170ca;
/**
* <summary>Business Name: PORX_IN060380CA: Medication profile
* detail query response</summary>
*
* <p>Returns detailed information about a patient's
* prescriptions, dispenses and other medications for a
* specific patient optionally filtered by date.</p> Message:
* MCCI_MT002300CA.Message Control Act:
* QUQI_MT120006CA.ControlActEvent --> Payload:
* PORX_MT060160CA.MedicationRecord ----> Payload Choice:
* PORX_MT060160CA.CombinedMedicationRequest ----> Payload
* Choice: PORX_MT060160CA.OtherMedication --> Payload:
* PORX_MT060170CA.ParameterList
*/
[Hl7PartTypeMappingAttribute(new string[] {"PORX_IN060380CA"})]
public class MedicationProfileDetailQueryResponse : HL7Message<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Quqi_mt120006ca.TriggerEvent<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Pharmacy.Porx_mt060160ca.IMedicationRecord,Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Pharmacy.Porx_mt060170ca.GenericQueryParameters>>, IInteraction {
public MedicationProfileDetailQueryResponse() {
}
}
} | 49.865385 | 371 | 0.741998 | [
"ECL-2.0",
"Apache-2.0"
] | CanadaHealthInfoway/message-builder-dotnet | message-builder-release-r02_04_02/Main/Ca/Infoway/Messagebuilder/Model/Pcs_mr2009_r02_04_02/Interaction/MedicationProfileDetailQueryResponse.cs | 2,593 | C# |
namespace AppCalculadora2
{
partial class FrmCalculadora
{
/// <summary>
/// Variable del diseñador necesaria.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Limpiar los recursos que se estén usando.
/// </summary>
/// <param name="disposing">true si los recursos administrados se deben desechar; false en caso contrario.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Código generado por el Diseñador de Windows Forms
/// <summary>
/// Método necesario para admitir el Diseñador. No se puede modificar
/// el contenido de este método con el editor de código.
/// </summary>
private void InitializeComponent()
{
this.lblNumero1 = new System.Windows.Forms.Label();
this.txtNumero1 = new System.Windows.Forms.TextBox();
this.lblNumero2 = new System.Windows.Forms.Label();
this.txtNumero2 = new System.Windows.Forms.TextBox();
this.btnSumar = new System.Windows.Forms.Button();
this.lblResultado = new System.Windows.Forms.Label();
this.txtResultado = new System.Windows.Forms.TextBox();
this.btnMultiplicar = new System.Windows.Forms.Button();
this.btnDividir = new System.Windows.Forms.Button();
this.btnRestar = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.btnLimpiar = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblNumero1
//
this.lblNumero1.AutoSize = true;
this.lblNumero1.Location = new System.Drawing.Point(56, 72);
this.lblNumero1.Name = "lblNumero1";
this.lblNumero1.Size = new System.Drawing.Size(56, 13);
this.lblNumero1.TabIndex = 0;
this.lblNumero1.Text = "Número 1:";
//
// txtNumero1
//
this.txtNumero1.Location = new System.Drawing.Point(119, 72);
this.txtNumero1.Name = "txtNumero1";
this.txtNumero1.Size = new System.Drawing.Size(100, 20);
this.txtNumero1.TabIndex = 1;
//
// lblNumero2
//
this.lblNumero2.AutoSize = true;
this.lblNumero2.Location = new System.Drawing.Point(58, 110);
this.lblNumero2.Name = "lblNumero2";
this.lblNumero2.Size = new System.Drawing.Size(56, 13);
this.lblNumero2.TabIndex = 2;
this.lblNumero2.Text = "Número 2:";
//
// txtNumero2
//
this.txtNumero2.Location = new System.Drawing.Point(121, 110);
this.txtNumero2.Name = "txtNumero2";
this.txtNumero2.Size = new System.Drawing.Size(100, 20);
this.txtNumero2.TabIndex = 3;
//
// btnSumar
//
this.btnSumar.Location = new System.Drawing.Point(263, 62);
this.btnSumar.Name = "btnSumar";
this.btnSumar.Size = new System.Drawing.Size(41, 23);
this.btnSumar.TabIndex = 4;
this.btnSumar.Text = "+";
this.btnSumar.UseVisualStyleBackColor = true;
this.btnSumar.Click += new System.EventHandler(this.btnSumar_Click);
//
// lblResultado
//
this.lblResultado.AutoSize = true;
this.lblResultado.Location = new System.Drawing.Point(59, 210);
this.lblResultado.Name = "lblResultado";
this.lblResultado.Size = new System.Drawing.Size(58, 13);
this.lblResultado.TabIndex = 5;
this.lblResultado.Text = "Resultado:";
//
// txtResultado
//
this.txtResultado.Location = new System.Drawing.Point(124, 202);
this.txtResultado.Name = "txtResultado";
this.txtResultado.Size = new System.Drawing.Size(100, 20);
this.txtResultado.TabIndex = 6;
//
// btnMultiplicar
//
this.btnMultiplicar.Location = new System.Drawing.Point(263, 106);
this.btnMultiplicar.Name = "btnMultiplicar";
this.btnMultiplicar.Size = new System.Drawing.Size(41, 23);
this.btnMultiplicar.TabIndex = 8;
this.btnMultiplicar.Text = "*";
this.btnMultiplicar.UseVisualStyleBackColor = true;
//
// btnDividir
//
this.btnDividir.Location = new System.Drawing.Point(335, 108);
this.btnDividir.Name = "btnDividir";
this.btnDividir.Size = new System.Drawing.Size(41, 23);
this.btnDividir.TabIndex = 9;
this.btnDividir.Text = "/";
this.btnDividir.UseVisualStyleBackColor = true;
this.btnDividir.Click += new System.EventHandler(this.btnDividir_Click);
//
// btnRestar
//
this.btnRestar.Location = new System.Drawing.Point(335, 62);
this.btnRestar.Name = "btnRestar";
this.btnRestar.Size = new System.Drawing.Size(41, 23);
this.btnRestar.TabIndex = 10;
this.btnRestar.Text = "-";
this.btnRestar.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Location = new System.Drawing.Point(263, 147);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(41, 23);
this.button1.TabIndex = 11;
this.button1.Text = "x^2";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Location = new System.Drawing.Point(335, 147);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(41, 23);
this.button2.TabIndex = 12;
this.button2.Text = "x^n";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click_1);
//
// btnLimpiar
//
this.btnLimpiar.Location = new System.Drawing.Point(301, 232);
this.btnLimpiar.Name = "btnLimpiar";
this.btnLimpiar.Size = new System.Drawing.Size(75, 23);
this.btnLimpiar.TabIndex = 13;
this.btnLimpiar.Text = "Limpiar";
this.btnLimpiar.UseVisualStyleBackColor = true;
this.btnLimpiar.Click += new System.EventHandler(this.btnLimpiar_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(178, 147);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(41, 23);
this.button3.TabIndex = 14;
this.button3.Text = "n!";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// FrmCalculadora
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(547, 338);
this.Controls.Add(this.button3);
this.Controls.Add(this.btnLimpiar);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnRestar);
this.Controls.Add(this.btnDividir);
this.Controls.Add(this.btnMultiplicar);
this.Controls.Add(this.txtResultado);
this.Controls.Add(this.lblResultado);
this.Controls.Add(this.btnSumar);
this.Controls.Add(this.txtNumero2);
this.Controls.Add(this.lblNumero2);
this.Controls.Add(this.txtNumero1);
this.Controls.Add(this.lblNumero1);
this.Name = "FrmCalculadora";
this.Text = "Calculadora";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblNumero1;
private System.Windows.Forms.TextBox txtNumero1;
private System.Windows.Forms.Label lblNumero2;
private System.Windows.Forms.TextBox txtNumero2;
private System.Windows.Forms.Button btnSumar;
private System.Windows.Forms.Label lblResultado;
private System.Windows.Forms.TextBox txtResultado;
private System.Windows.Forms.Button btnMultiplicar;
private System.Windows.Forms.Button btnDividir;
private System.Windows.Forms.Button btnRestar;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button btnLimpiar;
private System.Windows.Forms.Button button3;
}
}
| 43.322581 | 122 | 0.573556 | [
"MIT"
] | remendozag/Plataformas2022-2 | AppCalculadora2/AppCalculadora2/Form1.Designer.cs | 9,413 | C# |
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.Design;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
namespace PackageManagement.Tests.Helpers
{
public class FakePackageManagementProjectFactory : IPackageManagementProjectFactory
{
public List<FakePackageManagementProject> FakeProjectsCreated =
new List<FakePackageManagementProject>();
public FakePackageManagementProject FirstFakeProjectCreated {
get { return FakeProjectsCreated[0]; }
}
public IPackageRepository FirstRepositoryPassedToCreateProject {
get { return RepositoriesPassedToCreateProject[0]; }
}
public List<IPackageRepository> RepositoriesPassedToCreateProject =
new List<IPackageRepository>();
public MSBuildBasedProject FirstProjectPassedToCreateProject {
get { return ProjectsPassedToCreateProject[0]; }
}
public List<MSBuildBasedProject> ProjectsPassedToCreateProject =
new List<MSBuildBasedProject>();
public IPackageManagementProject CreateProject(IPackageRepository sourceRepository, MSBuildBasedProject project)
{
RepositoriesPassedToCreateProject.Add(sourceRepository);
ProjectsPassedToCreateProject.Add(project);
var fakeProject = new FakePackageManagementProject();
FakeProjectsCreated.Add(fakeProject);
return fakeProject;
}
}
}
| 33.340426 | 114 | 0.804084 | [
"MIT"
] | denza/SharpDevelop | src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageManagementProjectFactory.cs | 1,569 | C# |
/****
* PMSM calculation - automate PMSM design process
* Created 2016 by Ngo Phuong Le
* https://github.com/lehn85/pmsm_calculation
* All files are provided under the MIT license.
****/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.Interpolation;
namespace calc_from_geometryOfMotor.motor.PMMotor
{
public class PMAnalyticalAnalyser : AbstractAnalyticalAnalyser
{
private VectorBuilder<double> mybuilder = Vector<double>.Build;
/**General magnet circuit is consisted of:
* Magnet
* Leak
* Airgap
* Stator: teeth and yoke
*
* */
// Magnet
public double PM { get; set; }//conductance
public double Fc { get; set; }//coercive force
public double phiR { get; set; }//redundant flux
// Leak: bridge and barrier
public double PFe { get; set; }
public double phiHFe { get; set; }
public double Pb { get; set; }
public double Pa { get; set; }//leak through airgap to nearby pole
// airgap
public double Pd { get; set; }//delta
// stator
// characterictic steel
public double[] Barray { get; set; }
public double[] Harray { get; set; }
public double Sz { get; set; }
public double lz { get; set; }
public double Sy { get; set; }
public double ly { get; set; }
public double Pslot { get; set; }
// Other data for calculation of magnetic parameters like B, H (which not shown in magnetic circuit)
public double wm { get; set; }
public double lm { get; set; }
public double L { get; set; }
public double wd { get; set; }
public double delta { get; set; }
public double gammaM { get; set; }
public int p { get; set; }
public int Q { get; set; }
public int Nstrand { get; set; }
public double wm2 { get; set; }
// dq
public double PMd;
public double PMq;
public override void RunAnalysis()
{
int len = Barray.Length;
// table phid-fz
Vector<double> Fz_vector = mybuilder.Dense(len, i => Harray[i] * lz);
Vector<double> phid_Fz_vector = mybuilder.Dense(len, i => Barray[i] * Sz + Fz_vector[i] * Pslot);
// table phid-fy
Vector<double> Fy_vector = mybuilder.Dense(len, i => Harray[i] * ly);
Vector<double> phid_Fy_vector = mybuilder.Dense(len, i => Barray[i] * Sy);
// reshape phid-fy, using interpolation to create new vector corresponding with phid_fy = phid_fz
Vector<double> phid_vector = mybuilder.DenseOfVector(phid_Fz_vector);//same phid table for all
LinearSpline ls = LinearSpline.Interpolate(phid_Fy_vector.ToArray(), Fy_vector.ToArray());
Vector<double> eqvFy_vector = mybuilder.Dense(len, i => ls.Interpolate(phid_vector[i]));
// table f_phid
Vector<double> f_phid = mybuilder.Dense(len, i => phid_vector[i] / Pd + Fz_vector[i] + eqvFy_vector[i] - (phiR - phiHFe - phid_vector[i]) / (PM + PFe + Pb));
var Results = new PMAnalyticalResults();
Results.Analyser = this;
this.Results = Results;
// calc phiD
ls = LinearSpline.Interpolate(f_phid.ToArray(), phid_vector.ToArray());
double phiD = ls.Interpolate(0);
double FM = (phiR - phiHFe - phiD) / (PM + PFe + Pb);
double phib = FM * Pb;
double phiFe = phiHFe + FM * PFe;
double phiM = phiD + phib + phiFe;
ls = LinearSpline.Interpolate(phid_vector.ToArray(), Fz_vector.ToArray());
double Fz = ls.Interpolate(phiD);
ls = LinearSpline.Interpolate(phid_vector.ToArray(), eqvFy_vector.ToArray());
double Fy = ls.Interpolate(phiD);
double Bdelta = phiD / (L * wd * 1e-6);
double BM = phiM / (L * wm * 1e-6);
double HM = FM / (lm * 1e-3);
double pc = phiM / (PM * FM);
double Bz = phiD / Sz;
double By = phiD / Sy;
double Vz = Sz * lz;
double Vy = Sy * ly;
double ro_ = 7800;//kg/m^3 - specific weight
double kPMz = 1.3 * Bz * Bz * ro_ * Vz;
double kPMy = 1.3 * By * By * ro_ * Vy;
Results.kPMz = kPMz;
Results.kPMy = kPMy;
// assign results
Results.phiD = phiD;
Results.Bdelta = Bdelta;
Results.phiM = phiM;
Results.BM = BM;
Results.FM = FM;
Results.HM = HM;
Results.pc = pc;
Results.phib = phib;
Results.phiFe = phiFe;
Results.Fz = Fz;
Results.Fy = Fy;
Results.Bz = Bz;
Results.By = By;
Results.wd = wd;
Results.gammaM = gammaM;
// number of slot per pole per phase
int q = Q / 3 / p / 2;
// k winding
double kp = Math.Sin(Math.PI / (2 * 3)) / (q * Math.Sin(Math.PI / (2 * 3 * q)));
// Resistant
Stator3Phase stator = Motor.Stator as Stator3Phase;
Results.R = stator.resistancePhase;
// inductances
double delta2 = delta * 1.1;
double ns = 4 / Math.PI * kp * stator.NStrands * q;
double dmin = delta2;
double alphaM = Motor.Rotor is VPMRotor ? (Motor.Rotor as VPMRotor).alphaM : 180;
double dmax = delta2;
if (Motor.Rotor is VPMRotor)
dmax = delta2 + Constants.mu_0 * L * wd * 1e-3 * (1 / (PM + PFe + Pb) + Fy / phiD + Fz / phiD);//* wd / wm2 * ((VPMRotor)Motor.Rotor).mu_M;
double gm = gammaM * Math.PI / 180;
double a1 = 1 / Math.PI * (gm / dmax + (Math.PI - gm) / dmin) * 1e3;
double a2 = -2 / Math.PI * Math.Sin(gm) * (1 / dmax - 1 / dmin) * 1e3;
double L1 = (ns / 2) * (ns / 2) * Math.PI * Motor.Rotor.RGap * Motor.GeneralParams.MotorLength * 1e-6 * a1 * 4 * Math.PI * 1e-7;
double L2 = 0.5 * (ns / 2) * (ns / 2) * Math.PI * Motor.Rotor.RGap * Motor.GeneralParams.MotorLength * 1e-6 * a2 * 4 * Math.PI * 1e-7;
Results.dmin = dmin;
Results.dmax = dmax;
Results.L1 = L1;
Results.L2 = L2;
Results.Ld = 1.5 * (L1 - L2);
Results.Lq = 1.5 * (L1 + L2);
// psiM
double psim = 2 * Math.Sin(gammaM * Math.PI / 180 / 2) * ns * Bdelta * Motor.Rotor.RGap * Motor.GeneralParams.MotorLength * 1e-6;
Results.psiM = psim;
// current demagnetizing
//Results.Ikm = 2 * phiR / PM / (kp * Nstrand * q); //old
double hck = Motor.Rotor is VPMRotor ? (Motor.Rotor as VPMRotor).Hck : 0;
Results.Ikm = Math.PI * (hck - HM) * lm * 1e-3 / (2 * q * Nstrand * kp);
dataValid = (Results.Ld > 0 && Results.Lq > 0 && Results.psiM >= 0 && gm > 0);
}
private bool dataValid = false;
public override bool isDataValid()
{
return dataValid;
}
}
public class PMAnalyticalResults : AbstractAnalyticalResults
{
//result which readonly from outside
public double phiD { get; set; }
public double Bdelta { get; set; }//1e-6 since all length units are mm
public double phiM { get; set; }
public double BM { get; set; }
public double FM { get; set; }
public double HM { get; set; }
public double pc { get; set; }
public double phib { get; set; }
public double phiFe { get; set; }
public double Fz { get; set; }
public double Fy { get; set; }
public double Bz { get; set; }
public double By { get; set; }
public double kPMz { get; set; }
public double kPMy { get; set; }
public double wd { get; set; }
public double gammaM { get; set; }
public double psiM { get; set; }
public double Ld { get; set; }
public double Lq { get; set; }
public double LL { get; set; }
public double R { get; set; }
public double Ikm { get; set; }
public double L1 { get; set; }
public double L2 { get; set; }
public double dmin { get; set; }
public double dmax { get; set; }
//public double psiM2 { get; set; }
public override IDictionary<string, object> BuildResultsForDisplay()
{
var dict = base.BuildResultsForDisplay();
dict.Add("Bdelta", Bdelta);
dict.Add("phiD", phiD);
dict.Add("gammaM", gammaM);
dict.Add("phiM", phiM);
dict.Add("phib", phib);
dict.Add("phiFe", phiFe);
dict.Add("FM", FM);
dict.Add("BM", BM);
dict.Add("HM", HM);
dict.Add("PC", pc);
dict.Add("Fz", Fz);
dict.Add("Fy", Fy);
dict.Add("Bz", Bz);
dict.Add("By", By);
dict.Add("kPMz", kPMz);
dict.Add("kPMy", kPMy);
dict.Add("wd", wd);
dict.Add("psiM", psiM);
//dict.Add("psiM2", psiM2);
dict.Add("Ld", Ld);
dict.Add("Lq", Lq);
dict.Add("LL", LL);
dict.Add("R", R);
dict.Add("psiM/Ld", psiM / Ld);//maximum
Stator3Phase stator = Analyser.Motor.Stator as Stator3Phase;
if (stator != null)
{
double Jrequired = psiM / Ld / (stator.WireDiameter * stator.WireDiameter / 4 * Math.PI) / Math.Sqrt(2);
dict.Add("psiM/Ld/Swire (rms)", Jrequired);
dict.Add("length_one_turn", stator.wirelength_oneturn);
}
dict.Add("Ikm", Ikm);
dict.Add("L1", L1);
dict.Add("L2", L2);
dict.Add("dmin", dmin);
dict.Add("dmax", dmax);
double b1 = Bdelta * 4 / Math.PI * Math.Sin(gammaM * Math.PI / 180 / 2);
double b3 = Bdelta * 4 / (Math.PI * 3) * Math.Sin(3 * gammaM * Math.PI / 180 / 2);
dict.Add("Bd_1", b1);
dict.Add("Bd_3", b3);
return dict;
}
}
}
| 38.163636 | 178 | 0.518628 | [
"MIT"
] | lehn85/pmsm_calculation | PMSM_calculation/motor/PMMotor/PMAnalyticalAnalyser.cs | 10,497 | C# |
// War College - Copyright (c) 2017 James Allred (wildj79 at gmail dot com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
using System;
using WarCollege.Model;
using Xunit;
namespace WarCollege.Tests
{
public class CharacterTests
{
Character character;
public CharacterTests()
{
character = new Character()
{
PlayerName = "James",
HairColor = "Blond",
EyeColor = "Hazel",
Weight = 104.3f,
Height = 170.688f,
Age = 37,
Experience = new ExperiencePoints(5000),
Description = "It's me",
Notes = "Random random random",
CBills = 1000f,
Id = Guid.NewGuid(),
Name = "Some Dude"
};
var aff = new Affiliation()
{
Description = "",
ExperienceCost = 150,
Id = Guid.NewGuid(),
Name = "Marik Commonwealth",
Parent = new Affiliation()
{
Description = "",
Id = Guid.NewGuid(),
Name = "Free Worlds League",
PrimaryLanguage = "English",
SecondaryLanguages = new System.Collections.ObjectModel.ObservableCollection<string>()
{
"Greek",
"Hindi",
"Itailian",
"Mandarin",
"Mongolian",
"Romanian",
"Slovak",
"Spanish",
"Urdu"
},
ExperienceCost = 0,
FixedExperiencePoints = new System.Collections.ObjectModel.ObservableCollection<Domain.ExperienceAllotment>()
{
new Domain.ExperienceAllotment("Skill", "Language/Any Secondary", 15),
new Domain.ExperienceAllotment("Skill", "Art/Any", 10)
}
},
FixedExperiencePoints = new System.Collections.ObjectModel.ObservableCollection<Domain.ExperienceAllotment>()
{
new Domain.ExperienceAllotment("Trait", "Wealth", 100),
new Domain.ExperienceAllotment("Trait", "Equipped", 100),
new Domain.ExperienceAllotment("Trait", "Reputation", -100),
new Domain.ExperienceAllotment("Skill", "Appraisal", 5),
new Domain.ExperienceAllotment("Skill", "Negotiation", 10),
new Domain.ExperienceAllotment("Skill", "Protocol/Free Worlds", 10)
}
};
character.Affiliation = aff;
var str = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "STR",
Description = "",
Experience = new ExperiencePoints(425),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Streangth",
PhenotypeModifier = 0
};
var bod = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "BOD",
Description = "",
Experience = new ExperiencePoints(300),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Body",
PhenotypeModifier = 0
};
var dex = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "DEX",
Description = "",
Experience = new ExperiencePoints(515),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Dexterity",
PhenotypeModifier = 0
};
var rfl = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "RFL",
Description = "",
Experience = new ExperiencePoints(450),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Reflexes",
PhenotypeModifier = 0
};
var @int = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "INT",
Description = "",
Experience = new ExperiencePoints(325),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Inteligence",
PhenotypeModifier = 0
};
var wil = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "WIL",
Description = "",
Experience = new ExperiencePoints(430),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Willpower",
PhenotypeModifier = 0
};
var cha = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "CHA",
Description = "",
Experience = new ExperiencePoints(260),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Charisma",
PhenotypeModifier = 0
};
var edg = new CharacterAttribute()
{
Id = Guid.NewGuid(),
Abbreviation = "EDG",
Description = "",
Experience = new ExperiencePoints(125),
IsExceptionalAttribute = false,
LinkModifier = 0,
MaximumScoreAllowed = 8,
Name = "Edge",
PhenotypeModifier = 0
};
character.Attributes.Add(str);
character.Attributes.Add(bod);
character.Attributes.Add(dex);
character.Attributes.Add(rfl);
character.Attributes.Add(@int);
character.Attributes.Add(wil);
character.Attributes.Add(cha);
character.Attributes.Add(edg);
var trait = new Trait()
{
Id = Guid.NewGuid(),
Description = "",
Name = "Fit",
PageReference = "AToW p. 117",
TraitType = CharacterTraitType.Character,
Experience = new ExperiencePoints(200)
};
character.Traits.Add(trait);
var skill = new Skill()
{
Character = character,
ComplexityRating = "SB",
Description = "",
Experience = new ExperiencePoints(30),
Id = Guid.NewGuid(),
IsTiered = false,
Name = "Archery",
PageReference = "AToW p.143",
Specialty = "",
SubSkill = "",
TargetNumber = 7,
};
skill.LinkedAttributes.Add(dex);
character.Skills.Add(skill);
character.Phenotype = new Phenotype()
{
Id = Guid.NewGuid(),
Name = "Normal Human",
FieldAptitude = ""
};
character.Phenotype.AttributeMaximums.Add("STR", 8);
character.Phenotype.AttributeMaximums.Add("BOD", 8);
character.Phenotype.AttributeMaximums.Add("DEX", 8);
character.Phenotype.AttributeMaximums.Add("RFL", 8);
character.Phenotype.AttributeMaximums.Add("INT", 8);
character.Phenotype.AttributeMaximums.Add("WIL", 8);
character.Phenotype.AttributeMaximums.Add("CHA", 9);
character.Phenotype.AttributeMaximums.Add("EDG", 9);
character.Phenotype.AttributeModifiers.Add("STR", 0);
character.Phenotype.AttributeModifiers.Add("BOD", 0);
character.Phenotype.AttributeModifiers.Add("DEX", 0);
character.Phenotype.AttributeModifiers.Add("RFL", 0);
character.Phenotype.AttributeModifiers.Add("INT", 0);
character.Phenotype.AttributeModifiers.Add("WIL", 0);
character.Phenotype.AttributeModifiers.Add("CHA", 0);
character.Phenotype.AttributeModifiers.Add("EDG", 0);
}
[Fact(DisplayName = "Does Have Trait")]
public void DoesHaveTrait()
{
Assert.True(character.HasTrait("Fit"));
}
[Fact(DisplayName = "Does Not Have Trait")]
public void DoesNotHaveTrait()
{
Assert.False(character.HasTrait("Poor Vision"));
}
[Fact(DisplayName = "Does Have Skill")]
public void DoesHaveSkill()
{
Assert.True(character.HasSkill("Archery"));
}
[Fact(DisplayName = "Does Not Have Skill")]
public void DoesNotHaveSkill()
{
Assert.False(character.HasSkill("Running"));
}
[Fact(DisplayName = "Is In Affiliation")]
public void IsInAffiliation()
{
Assert.True(character.IsInAffiliation("Free Worlds League"));
Assert.True(character.IsInAffiliation("Marik Commonwealth"));
}
[Fact(DisplayName = "Is Not In Affiliation")]
public void IsNotInAffiliation()
{
Assert.False(character.IsInAffiliation("Lyran Alliance"));
}
[Fact(DisplayName = "Is RaisePropertyChagned Called")]
public void IsPropertyChagnedRaised()
{
Assert.PropertyChanged(character, nameof(Character.Age), () => character.Age = 22);
Assert.PropertyChanged(character, nameof(Character.CBills), () => character.CBills = 100000f);
Assert.PropertyChanged(character, nameof(Character.Description), () => character.Description = "This is a description");
Assert.PropertyChanged(character, nameof(Character.EyeColor), () => character.EyeColor = "Blue");
Assert.PropertyChanged(character, nameof(Character.HairColor), () => character.HairColor = "White");
Assert.PropertyChanged(character, nameof(Character.Height), () => character.Height = 4f);
Assert.PropertyChanged(character, nameof(Character.Name), () => character.Name = "Jim");
Assert.PropertyChanged(character, nameof(Character.Notes), () => character.Notes = "Some notes that should be different");
Assert.PropertyChanged(character, nameof(Character.PlayerName), () => character.PlayerName = "Jim");
Assert.PropertyChanged(character, nameof(Character.Weight), () => character.Weight = 185f);
}
}
}
| 38.911392 | 134 | 0.520982 | [
"MIT"
] | wildj79/WarCollege | src/WarCollege.Tests/CharacterTests.cs | 12,298 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace lab_60_asp_northwind
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
| 24.5 | 99 | 0.593537 | [
"MIT"
] | jaspreetkaur28/CSharpLabsTraining | lab_60_asp_northwind/App_Start/RouteConfig.cs | 590 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void CompareGreaterThanOrEqualScalar_Vector64_Single()
{
var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if (
(alignment != 16 && alignment != 8)
|| (alignment * 2) < sizeOfinArray1
|| (alignment * 2) < sizeOfinArray2
|| (alignment * 2) < sizeOfoutArray
)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(
ref Unsafe.AsRef<byte>(inArray1Ptr),
ref Unsafe.As<Single, byte>(ref inArray1[0]),
(uint)sizeOfinArray1
);
Unsafe.CopyBlockUnaligned(
ref Unsafe.AsRef<byte>(inArray2Ptr),
ref Unsafe.As<Single, byte>(ref inArray2[0]),
(uint)sizeOfinArray2
);
}
public void* inArray1Ptr =>
Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr =>
Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr =>
Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Single> _fld1;
public Vector64<Single> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++)
{
_data1[i] = TestLibrary.Generator.GetSingle();
}
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld1),
ref Unsafe.As<Single, byte>(ref _data1[0]),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
for (var i = 0; i < Op2ElementCount; i++)
{
_data2[i] = TestLibrary.Generator.GetSingle();
}
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld2),
ref Unsafe.As<Single, byte>(ref _data2[0]),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
return testStruct;
}
public void RunStructFldScenario(
SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single testClass
)
{
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(
SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single testClass
)
{
fixed (Vector64<Single>* pFld1 = &_fld1)
fixed (Vector64<Single>* pFld2 = &_fld2)
{
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
AdvSimd.LoadVector64((Single*)(pFld1)),
AdvSimd.LoadVector64((Single*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount =
Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static readonly int Op2ElementCount =
Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static readonly int RetElementCount =
Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static Single[] _data1 = new Single[Op1ElementCount];
private static Single[] _data2 = new Single[Op2ElementCount];
private static Vector64<Single> _clsVar1;
private static Vector64<Single> _clsVar2;
private Vector64<Single> _fld1;
private Vector64<Single> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single()
{
for (var i = 0; i < Op1ElementCount; i++)
{
_data1[i] = TestLibrary.Generator.GetSingle();
}
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar1),
ref Unsafe.As<Single, byte>(ref _data1[0]),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
for (var i = 0; i < Op2ElementCount; i++)
{
_data2[i] = TestLibrary.Generator.GetSingle();
}
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar2),
ref Unsafe.As<Single, byte>(ref _data2[0]),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
}
public SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++)
{
_data1[i] = TestLibrary.Generator.GetSingle();
}
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Vector64<Single>, byte>(ref _fld1),
ref Unsafe.As<Single, byte>(ref _data1[0]),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
for (var i = 0; i < Op2ElementCount; i++)
{
_data2[i] = TestLibrary.Generator.GetSingle();
}
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Vector64<Single>, byte>(ref _fld2),
ref Unsafe.As<Single, byte>(ref _data2[0]),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
for (var i = 0; i < Op1ElementCount; i++)
{
_data1[i] = TestLibrary.Generator.GetSingle();
}
for (var i = 0; i < Op2ElementCount; i++)
{
_data2[i] = TestLibrary.Generator.GetSingle();
}
_dataTable = new DataTable(
_data1,
_data2,
new Single[RetElementCount],
LargestVectorSize
);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Single>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64)
.GetMethod(
nameof(AdvSimd.Arm64.CompareGreaterThanOrEqualScalar),
new Type[] { typeof(Vector64<Single>), typeof(Vector64<Single>) }
)
.Invoke(
null,
new object[]
{
Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Single>>(_dataTable.inArray2Ptr)
}
);
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64)
.GetMethod(
nameof(AdvSimd.Arm64.CompareGreaterThanOrEqualScalar),
new Type[] { typeof(Vector64<Single>), typeof(Vector64<Single>) }
)
.Invoke(
null,
new object[]
{
AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr))
}
);
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(_clsVar1, _clsVar2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Single>* pClsVar1 = &_clsVar1)
fixed (Vector64<Single>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
AdvSimd.LoadVector64((Single*)(pClsVar1)),
AdvSimd.LoadVector64((Single*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray2Ptr);
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr));
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single();
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqualScalar_Vector64_Single();
fixed (Vector64<Single>* pFld1 = &test._fld1)
fixed (Vector64<Single>* pFld2 = &test._fld2)
{
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
AdvSimd.LoadVector64((Single*)(pFld1)),
AdvSimd.LoadVector64((Single*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Single>* pFld1 = &_fld1)
fixed (Vector64<Single>* pFld2 = &_fld2)
{
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
AdvSimd.LoadVector64((Single*)(pFld1)),
AdvSimd.LoadVector64((Single*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.CompareGreaterThanOrEqualScalar(
AdvSimd.LoadVector64((Single*)(&test._fld1)),
AdvSimd.LoadVector64((Single*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(
Vector64<Single> op1,
Vector64<Single> op2,
void* result,
[CallerMemberName] string method = ""
)
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] inArray2 = new Single[Op2ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Single, byte>(ref outArray[0]),
ref Unsafe.AsRef<byte>(result),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(
void* op1,
void* op2,
void* result,
[CallerMemberName] string method = ""
)
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] inArray2 = new Single[Op2ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Single, byte>(ref inArray1[0]),
ref Unsafe.AsRef<byte>(op1),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Single, byte>(ref inArray2[0]),
ref Unsafe.AsRef<byte>(op2),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
Unsafe.CopyBlockUnaligned(
ref Unsafe.As<Single, byte>(ref outArray[0]),
ref Unsafe.AsRef<byte>(result),
(uint)Unsafe.SizeOf<Vector64<Single>>()
);
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(
Single[] left,
Single[] right,
Single[] result,
[CallerMemberName] string method = ""
)
{
bool succeeded = true;
if (
BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[0], right[0]))
!= BitConverter.SingleToInt32Bits(result[0])
)
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (BitConverter.SingleToInt32Bits(result[i]) != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation(
$"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.CompareGreaterThanOrEqualScalar)}<Single>(Vector64<Single>, Vector64<Single>): {method} failed:"
);
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation(
$" result: ({string.Join(", ", result)})"
);
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| 37.902108 | 164 | 0.550125 | [
"MIT"
] | belav/runtime | src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/CompareGreaterThanOrEqualScalar.Vector64.Single.cs | 25,167 | C# |
namespace RiotSharp.LeagueEndpoint
{
/// <summary>
/// Tier of the league (League API).
/// </summary>
public enum Tier
{
/// <summary>
/// Master tier.
/// </summary>
Master,
/// <summary>
/// Challenger tier.
/// </summary>
Challenger,
/// <summary>
/// Diamon tier.
/// </summary>
Diamond,
/// <summary>
/// Platinum tier.
/// </summary>
Platinum,
/// <summary>
/// Gold tier.
/// </summary>
Gold,
/// <summary>
/// Silver tier.
/// </summary>
Silver,
/// <summary>
/// Bronze tier.
/// </summary>
Bronze,
/// <summary>
/// Unranked.
/// </summary>
Unranked
}
}
| 17.571429 | 40 | 0.38676 | [
"MIT"
] | TRangeman/RSharp | RiotSharp/LeagueEndpoint/Converters/Tier.cs | 863 | C# |
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Reflection;
/// <summary>
/// This attribute can only be applied to fields because its
/// associated PropertyDrawer only operates on fields (either
/// public or tagged with the [SerializeField] attribute) in
/// the target MonoBehaviour.
/// </summary>
[System.AttributeUsage(System.AttributeTargets.Field)]
public class InspectorButtonAttribute : PropertyAttribute
{
public static float kDefaultButtonWidth = 80;
public readonly string MethodName;
private float _buttonWidth = kDefaultButtonWidth;
public float ButtonWidth
{
get { return _buttonWidth; }
set { _buttonWidth = value; }
}
public InspectorButtonAttribute(string MethodName)
{
_buttonWidth = MethodName.Length * 15;
this.MethodName = MethodName;
}
}
#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(InspectorButtonAttribute))]
public class InspectorButtonPropertyDrawer : PropertyDrawer
{
private MethodInfo _eventMethodInfo = null;
public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
{
InspectorButtonAttribute inspectorButtonAttribute = (InspectorButtonAttribute)attribute;
Rect buttonRect = new Rect(position.x + (position.width - inspectorButtonAttribute.ButtonWidth) * 0.5f, position.y, inspectorButtonAttribute.ButtonWidth, position.height);
if (GUI.Button(buttonRect, label.text))
{
System.Type eventOwnerType = prop.serializedObject.targetObject.GetType();
string eventName = inspectorButtonAttribute.MethodName;
if (_eventMethodInfo == null)
_eventMethodInfo = eventOwnerType.GetMethod(eventName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
if (_eventMethodInfo != null)
_eventMethodInfo.Invoke(prop.serializedObject.targetObject, null);
else
Debug.LogWarning(string.Format("InspectorButton: Unable to find method {0} in {1}", eventName, eventOwnerType));
}
}
}
#endif | 33.271186 | 173 | 0.782476 | [
"MIT"
] | morbidintel/WebCity | Assets/Imported/Helper Classes/InspectorButtonAttribute.cs | 1,965 | C# |
//
// Copyright (c) Seal Report (sealreport@gmail.com), http://www.sealreport.org.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. http://www.apache.org/licenses/LICENSE-2.0..
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Data;
using System.Xml.Serialization;
using Seal.Helpers;
using RazorEngine.Templating;
using System.Globalization;
using System.Data.Common;
using System.Text.RegularExpressions;
using MongoDB.Bson;
#if WINDOWS
using System.Drawing.Design;
using Seal.Forms;
using DynamicTypeDescriptor;
#endif
namespace Seal.Model
{
/// <summary>
/// A MetaTable defines a table in a database and contains a list of MetaColumns.
/// </summary>
public class MetaTable : RootComponent, ReportExecutionLog
{
public const string ParameterNameMongoSync = "mongo_sync";
public const string ParameterNameMongoDatabase = "mongo_database";
public const string ParameterNameMongoCollection = "mongo_collection";
public const string ParameterNameMongoArrayName = "mongo_array_name";
public const string ParameterNameMongoRestrictionOperator = "mongo_restriction_operator";
#if WINDOWS
#region Editor
protected override void UpdateEditorAttributes()
{
if (_dctd != null)
{
//Disable all properties
foreach (var property in Properties) property.SetIsBrowsable(false);
//Then enable
GetProperty("Name").SetIsBrowsable(!IsSubTable);
GetProperty("Type").SetIsBrowsable(IsSQL);
GetProperty("Alias").SetIsBrowsable(IsSQL);
GetProperty("DynamicColumns").SetIsBrowsable(IsSQL);
GetProperty("KeepColumnNames").SetIsBrowsable(IsSQL);
GetProperty("PreSQL").SetIsBrowsable(IsSQL);
GetProperty("Sql").SetIsBrowsable(IsSQL);
GetProperty("TemplateName").SetIsBrowsable(!IsSQL);
GetProperty("ParameterValues").SetIsBrowsable(!IsSQL && Parameters.Count > 0);
GetProperty("DefinitionInitScript").SetIsBrowsable(!IsSQL);
GetProperty("DefinitionScript").SetIsBrowsable(!IsSQL);
GetProperty("MongoStagesScript").SetIsBrowsable(IsMongoDb);
GetProperty("LoadScript").SetIsBrowsable(!IsSQL);
GetProperty("CacheDuration").SetIsBrowsable(!IsSQL);
GetProperty("PostSQL").SetIsBrowsable(IsSQL);
GetProperty("IgnorePrePostError").SetIsBrowsable(IsSQL);
GetProperty("WhereSQL").SetIsBrowsable(IsSQL);
GetProperty("HelperRefreshColumns").SetIsBrowsable(!IsSubTable);
GetProperty("HelperCheckTable").SetIsBrowsable(true);
GetProperty("Information").SetIsBrowsable(true);
GetProperty("Error").SetIsBrowsable(true);
if (IsSubTable) GetProperty("LoadScript").SetDisplayName("Load Script");
//Readonly
GetProperty("TemplateName").SetIsReadOnly(true);
GetProperty("Type").SetIsReadOnly(true);
GetProperty("HelperRefreshColumns").SetIsReadOnly(true);
GetProperty("HelperCheckTable").SetIsReadOnly(true);
GetProperty("Information").SetIsReadOnly(true);
GetProperty("Error").SetIsReadOnly(true);
TypeDescriptor.Refresh(this);
}
}
#endregion
#endif
/// <summary>
/// Creates a basic MetaTable
/// </summary>
public static MetaTable Create()
{
return new MetaTable() { GUID = Guid.NewGuid().ToString() };
}
/// <summary>
/// Current execution log
/// </summary>
[XmlIgnore]
public ReportExecutionLog Log = null;
/// <summary>
/// Logs message in the execution log
/// </summary>
public void LogMessage(string message, params object[] args)
{
if (Log != null) Log.LogMessage(message, args);
}
/// <summary>
/// Name of the table in the database. The name can be empty if an SQL Statement is specified.
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Name"), Description("Name of the table in the database or for the No Sql source. The name can be empty if an SQL Statement is specified."), Id(1, 1)]
#endif
public override string Name
{
get { return _name; }
set { _name = value; }
}
/// <summary>
/// SQL Select Statement executed to define the table. If empty, the table name is used.
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("SQL Select Statement"), Description("SQL Select Statement executed to define the table. If empty, the table name is used."), Id(2, 1)]
[Editor(typeof(SQLEditor), typeof(UITypeEditor))]
#endif
public string Sql { get; set; }
/// <summary>
/// DataTable used for No SQL Source
/// </summary>
[XmlIgnore]
public DataTable NoSQLTable = null;
/// <summary>
/// ReportModel set for No SQL Source
/// </summary>
[XmlIgnore]
public ReportModel NoSQLModel = null;
/// <summary>
/// Pipeline stages for Mongo queries
/// </summary>
[XmlIgnore]
public List<BsonDocument> MongoStages = new List<BsonDocument>();
/// <summary>
/// The Razor Script used to built the DataTable object that defines the table
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Template"), Description("The Template used to define the NoSQL table."), Id(1, 1)]
#endif
public string TemplateName { get; set; }
private MetaTableTemplate _tableTemplate = null;
[XmlIgnore]
public MetaTableTemplate TableTemplate
{
get
{
if (IsSQL) return null;
if (_tableTemplate == null)
{
if (!string.IsNullOrEmpty(TemplateName)) _tableTemplate = RepositoryServer.TableTemplates.FirstOrDefault(i => i.Name == TemplateName);
if (_tableTemplate == null) _tableTemplate = RepositoryServer.TableTemplates.FirstOrDefault(i => i.Name == MetaTableTemplate.DefaultName);
InitParameters();
}
return _tableTemplate;
}
}
/// <summary>
/// List of Table Parameters
/// </summary>
public List<Parameter> Parameters { get; set; } = new List<Parameter>();
public bool ShouldSerializeParameters() { return Parameters.Count > 0; }
/// <summary>
/// Init the parameters from the template
/// </summary>
public void InitParameters()
{
if (TableTemplate != null)
{
var initialParameters = Parameters.ToList();
Parameters.Clear();
var defaultParameters = IsSubTable && RootTable != null ? RootTable.Parameters : TableTemplate.DefaultParameters;
foreach (var configParameter in defaultParameters)
{
Parameter parameter = initialParameters.FirstOrDefault(i => i.Name == configParameter.Name);
if (parameter == null) parameter = new Parameter() { Name = configParameter.Name, Value = configParameter.Value };
Parameters.Add(parameter);
parameter.InitFromConfiguration(configParameter);
}
//Show Error if any
if (!string.IsNullOrEmpty(TableTemplate.Error)) Error = TableTemplate.Error;
if (string.IsNullOrEmpty(_name)) _name = "Master"; //Force a name for backward compatibility
}
}
/// <summary>
/// Helper to check if the 2 MetaTable have the same definition
/// </summary>
public bool IsIdentical(MetaTable table)
{
bool result =
TemplateName == table.TemplateName &&
Helper.CompareTrim(DefinitionInitScript, table.DefinitionInitScript) &&
Helper.CompareTrim(DefinitionScript, table.DefinitionScript) &&
Helper.CompareTrim(MongoStagesScript, table.MongoStagesScript) &&
Helper.CompareTrim(LoadScript, table.LoadScript)
;
if (result)
{
foreach (var parameter in Parameters)
{
if (parameter.Value != table.GetValue(parameter.Name))
{
result = false;
break;
}
}
}
return result;
}
MetaTable _rootTable = null;
[XmlIgnore]
MetaTable RootTable
{
get
{
if (_rootTable == null && IsSubTable)
{
_rootTable = Source.MetaData.Tables.FirstOrDefault(i => i.GUID == GUID);
}
return _rootTable;
}
}
/// <summary>
/// Default definition init script coming either from the template or from the root table (for a subtable)
/// </summary>
[XmlIgnore]
public string DefaultDefinitionInitScript
{
get
{
string result = null;
if (IsSubTable && RootTable != null)
{
result = string.IsNullOrEmpty(RootTable.DefinitionInitScript) ? RootTable.DefaultDefinitionInitScript : RootTable.DefinitionInitScript;
}
else if (TableTemplate != null && TemplateName != null) result = TableTemplate.DefaultDefinitionInitScript;
return result ?? "";
}
}
/// <summary>
/// Default definition script coming either from the template or from the root table (for a subtable)
/// </summary>
[XmlIgnore]
public string DefaultDefinitionScript
{
get
{
string result = null;
if (IsSubTable && RootTable != null)
{
result = string.IsNullOrEmpty(RootTable.DefinitionScript) ? RootTable.DefaultDefinitionScript : RootTable.DefinitionScript;
}
else if (TableTemplate != null && TemplateName != null) result = TableTemplate.DefaultDefinitionScript;
return result ?? "";
}
}
/// <summary>
/// Default load script coming either from the template or from the root table (for a subtable)
/// </summary>
[XmlIgnore]
public string DefaultLoadScript
{
get
{
string result = null;
if (IsSubTable && RootTable != null)
{
result = string.IsNullOrEmpty(RootTable.LoadScript) ? RootTable.DefaultLoadScript : RootTable.LoadScript;
}
else if (TableTemplate != null && TemplateName != null)
{
result = TableTemplate.DefaultLoadScript;
}
return result ?? "";
}
}
//Temporary variables to help for report serialization...
private List<Parameter> _tempParameters;
/// <summary>
/// Operations performed before the serialization
/// </summary>
public void BeforeSerialization()
{
InitParameters();
_tempParameters = Parameters.ToList();
//Remove parameters identical to config
Parameters.RemoveAll(i => i.Value == null || i.Value == i.ConfigValue);
if (DefinitionScript != null && DefinitionScript.Trim().Replace("\r\n", "\n") == DefaultDefinitionScript.Trim().Replace("\r\n", "\n")) DefinitionScript = null;
if (LoadScript != null && LoadScript.Trim().Replace("\r\n", "\n") == DefaultLoadScript.Trim().Replace("\r\n", "\n")) LoadScript = null;
if (!IsSQL) Alias = "";
}
/// <summary>
/// Operations performed after the serialization
/// </summary>
public void AfterSerialization()
{
Parameters = _tempParameters;
}
/// <summary>
/// Returns the parameter value
/// </summary>
public string GetValue(string name)
{
Parameter parameter = Parameters.FirstOrDefault(i => i.Name == name);
return parameter == null ? "" : (string.IsNullOrEmpty(parameter.Value) ? parameter.ConfigValue : parameter.Value);
}
/// <summary>
/// Returns a parameter boolean value with a default if it does not exist
/// </summary>
public bool GetBoolValue(string name, bool defaultValue)
{
Parameter parameter = Parameters.FirstOrDefault(i => i.Name == name);
return parameter == null ? defaultValue : parameter.BoolValue;
}
/// <summary>
/// Returns a paramter ineteger value
/// </summary>
public int GetNumericValue(string name)
{
Parameter parameter = Parameters.FirstOrDefault(i => i.Name == name);
return parameter == null ? 0 : parameter.NumericValue;
}
/// <summary>
/// Optional Razor Script executed before the execution of the DefinitionScript
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Definition Init Script"), Description("Optional Razor Script executed before the execution of the DefinitionScript."), Id(1, 1)]
[Editor(typeof(TemplateTextEditor), typeof(UITypeEditor))]
#endif
public string DefinitionInitScript { get; set; }
/// <summary>
/// The Razor Script used to built the DataTable object that defines the table
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Definition Script"), Description("The Razor Script used to built the DataTable object that defines the table."), Id(2, 1)]
[Editor(typeof(TemplateTextEditor), typeof(UITypeEditor))]
#endif
public string DefinitionScript { get; set; }
/// <summary>
/// Razor Script executed for Mongo DB table to add stages executed on the server before the load. This script is automatically generated from the model definition. It can be overwritten if the 'Generate Mongo DB stages' parameter of the table is set to false. Use the 'Refresh Sub-Models and Sub-Tables' button in the model to generate and view the script.
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Mongo DB Stages Script"), Description("Razor Script executed for Mongo DB table to add stages executed on the server before the load. This script is automatically generated from the model definition. It can be overwritten if the 'Generate Mongo DB stages' parameter of the table is set to false. Use the 'Refresh Sub-Models and Sub-Tables' button in the model to generate and view the script."), Id(4, 1)]
[Editor(typeof(TemplateTextEditor), typeof(UITypeEditor))]
#endif
public string MongoStagesScript { get; set; }
/// <summary>
/// The Default Razor Script used to load the data in the table. This can be overwritten in the model.
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Default Load Script"), Description("The Default Razor Script used to load the data in the table. This can be overwritten in the model. If the definition script includes also the load of the data, this script can be left empty/blank."), Id(5, 1)]
[Editor(typeof(TemplateTextEditor), typeof(UITypeEditor))]
#endif
public string LoadScript { get; set; }
/// <summary>
/// Duration in seconds to keep the result DataTable in cache after a load. If 0, the table is always reloaded.
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Cache duration"), Description("Duration in seconds to keep the result DataTable in cache after a load. If 0, the table is always reloaded."), Id(5, 1)]
[DefaultValue(0)]
#endif
public int CacheDuration { get; set; } = 0;
/// <summary>
/// If not empty, table alias name used in the SQL statement. The table alias is necessary if a SQL Statement is specified.
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Table alias"), Description("If not empty, table alias name used in the SQL statement. The table alias is necessary if a SQL Statement is specified."), Id(5, 1)]
#endif
public string Alias { get; set; }
bool _dynamicColumns = false;
/// <summary>
/// If true, columns are generated automatically from the Table Name or the SQL Select Statement by reading the database catalog
/// </summary>
#if WINDOWS
[DefaultValue(false)]
[Category("Definition"), DisplayName("Dynamic Columns"), Description("If true, columns are generated automatically from the Table Name or the SQL Select Statement by reading the database catalog."), Id(6, 1)]
#endif
public bool DynamicColumns
{
get { return _dynamicColumns; }
set
{
_dynamicColumns = value;
UpdateEditorAttributes();
}
}
public bool ShouldSerializeDynamicColumns() { return _dynamicColumns; }
/// <summary>
/// "If true, the display names of the columns are kept when generated from the source SQL
/// </summary>
#if WINDOWS
[DefaultValue(false)]
[Category("Definition"), DisplayName("Keep Column Names"), Description("If true, the display names of the columns are kept when generated from the source SQL."), Id(7, 1)]
#endif
public bool KeepColumnNames { get; set; } = false;
/// <summary>
/// Type of the table got from database catalog
/// </summary>
#if WINDOWS
[Category("Definition"), DisplayName("Table Type"), Description("Type of the table got from database catalog."), Id(8, 1)]
#endif
public string Type { get; set; }
#if WINDOWS
/// <summary>
/// The parameter values for edition.
/// </summary>
[TypeConverter(typeof(ExpandableObjectConverter))]
[DisplayName("Table Parameters"), Description("The table parameter values."), Category("Definition"), Id(10, 1)]
[XmlIgnore]
public ParametersEditor ParameterValues
{
get
{
var editor = new ParametersEditor();
editor.Init(Parameters);
return editor;
}
}
#endif
/// <summary>
/// If true, the table must be refreshed for dynamic columns
/// </summary>
[DefaultValue(false)]
public bool MustRefresh { get; set; } = false;
public bool ShouldSerializeMustRefresh() { return MustRefresh; }
/// <summary>
/// SQL Statement executed before the query when the table is involved. The statement may contain Razor script if it starts with '@'.
/// </summary>
#if WINDOWS
[Category("SQL"), DisplayName("Pre SQL Statement"), Description("SQL Statement executed before the query when the table is involved. The statement may contain Razor script if it starts with '@'."), Id(2, 2)]
[Editor(typeof(SQLEditor), typeof(UITypeEditor))]
#endif
public string PreSQL { get; set; }
/// <summary>
/// SQL Statement executed after the query when the table is involved. The statement may contain Razor script if it starts with '@'.
/// </summary>
#if WINDOWS
[Category("SQL"), DisplayName("Post SQL Statement"), Description("SQL Statement executed after the query when the table is involved. The statement may contain Razor script if it starts with '@'."), Id(3, 2)]
[Editor(typeof(SQLEditor), typeof(UITypeEditor))]
#endif
public string PostSQL { get; set; }
/// <summary>
/// If true, errors occuring during the Pre or Post SQL statements are ignored and the execution continues
/// </summary>
#if WINDOWS
[DefaultValue(false)]
[Category("SQL"), DisplayName("Ignore Pre and Post SQL Errors"), Description("If true, errors occuring during the Pre or Post SQL statements are ignored and the execution continues."), Id(4, 2)]
#endif
public bool IgnorePrePostError { get; set; } = false;
public bool ShouldSerializeIgnorePrePostError() { return IgnorePrePostError; }
/// <summary>
/// Additional SQL added in the WHERE clause when the table is involved in a query. The text may contain Razor script if it starts with '@'.
/// </summary>
#if WINDOWS
[Category("SQL"), DisplayName("Additional WHERE Clause"), Description("Additional SQL added in the WHERE clause when the table is involved in a query. The text may contain Razor script if it starts with '@'."), Id(5, 2)]
[Editor(typeof(SQLEditor), typeof(UITypeEditor))]
#endif
public string WhereSQL { get; set; }
/// <summary>
/// List of MetColumn defined for the table
/// </summary>
public List<MetaColumn> Columns { get; set; } = new List<MetaColumn>();
public bool ShouldSerializeColumns() { return Columns.Count > 0; }
/// <summary>
/// Alias name of the table
/// </summary>
[XmlIgnore]
public string AliasName
{
get
{
if ((IsSQL || string.IsNullOrEmpty(_name)) && !string.IsNullOrEmpty(Alias)) return Alias;
return _name;
}
}
/// <summary>
/// Name of the DataTable LINQ Result: Source name for SQL, table name for No SQL
/// </summary>
[XmlIgnore, Browsable(false)]
public string LINQResultName
{
get
{
var sourceName = "";
if (Source is ReportSource) sourceName = ((ReportSource)Source).MetaSourceName;
if (string.IsNullOrEmpty(sourceName)) sourceName = Source.Name;
return Regex.Replace(IsSQL ? sourceName : AliasName, "[^A-Za-z]", "");
}
}
/// <summary>
/// LINQ expression of the table name
/// </summary>
[XmlIgnore, Browsable(false)]
public string LINQExpressionName
{
get
{
return string.Format("{0} in model.ExecResultTables[\"{0}\"].AsEnumerable()", LINQResultName);
}
}
/// <summary>
/// Full SQL name of the table
/// </summary>
[XmlIgnore]
public string FullSQLName
{
get
{
if (!string.IsNullOrEmpty(Sql))
{
return string.Format("(\r\n{0}\r\n) {1}", Sql, AliasName);
}
else if (!string.IsNullOrEmpty(_name) && !string.IsNullOrEmpty(Alias))
{
return string.Format("{0} {1}", _name, Alias);
}
return AliasName;
}
}
/// <summary>
/// Display name including the type
/// </summary>
[XmlIgnore]
public string DisplayName
{
get
{
if (string.IsNullOrEmpty(Type)) return AliasName;
return string.Format("{0} ({1})", AliasName, Type);
}
}
/// <summary>
/// Display name including the type and the source name
/// </summary>
[XmlIgnore]
public string FullDisplayName
{
get
{
if (string.IsNullOrEmpty(Type)) return string.Format("{0}: {1}", Source.Name, AliasName);
return string.Format("{0}: {1} ({2})", Source.Name, AliasName, Type);
}
}
/// <summary>
/// True if the table is editable
/// </summary>
[XmlIgnore]
public bool IsEditable = true;
/// <summary>
/// True if the source containing the table is a standard SQL source
/// </summary>
[XmlIgnore]
public bool IsSQL
{
get { return !Source.IsNoSQL; }
}
/// <summary>
/// True if the table is a sub-table of a model
/// </summary>
[XmlIgnore]
public bool IsSubTable
{
get { return Model != null && Model.IsLINQ; }
}
/// <summary>
/// True if the table is for a SQL Model
/// </summary>
[XmlIgnore]
public bool IsForSQLModel
{
get { return Model != null && !Model.IsLINQ; }
}
/// <summary>
/// True if the table is for a Mongo DB
/// </summary>
public bool IsMongoDb
{
get { return TemplateName == MetaTableTemplate.MongoDBName; }
}
/// <summary>
/// True if the table has the same mongo DB connection, database and collection
/// </summary>
public bool HasSameMongoCollection(MetaTable table)
{
return GetValue(ParameterNameMongoDatabase) == table.GetValue(ParameterNameMongoDatabase)
&& GetValue(ParameterNameMongoCollection) == table.GetValue(ParameterNameMongoCollection)
&& LINQSourceGUID == LINQSourceGUID;
}
/// <summary>
/// Report Model when the MetaTable comes from a SQL Model or when is a SubTable of a LINQ query
/// </summary>
[XmlIgnore]
public ReportModel Model = null;
/// <summary>
/// Returns the SQL with the name and the CTE (Common Table Expression)
/// </summary>
public void GetExecSQLName(ref string CTE, ref string name)
{
CTE = "";
string sql = "";
if (Sql != null && Sql.Length > 5 && Sql.ToLower().Trim().StartsWith("with"))
{
var startIndex = Sql.IndexOf("(");
var depth = 1;
if (startIndex > 0)
{
bool inComment = false, inQuote = false;
for (int i = startIndex + 1; i < Sql.Length - 5; i++)
{
switch (Sql[i])
{
case ')':
if (!inComment && !inQuote)
{
depth--;
if (depth == 0)
{
CTE = Sql.Substring(0, i + 1).Trim() + "\r\n";
sql = Sql.Substring(i + 1).Trim();
if (sql.ToLower().StartsWith("select"))
{
//end of CTE
i = Sql.Length;
}
}
}
break;
case '(':
if (!inComment && !inQuote)
{
depth++;
}
break;
case '\'':
inQuote = !inQuote;
break;
case '/':
if (Sql[i + 1] == '*')
{
inComment = true;
}
break;
case '*':
if (inComment && Sql[i + 1] == '/')
{
inComment = false;
}
break;
case '-':
if (!inComment && Sql[i + 1] == '-')
{
while (i < Sql.Length - 5 && Sql[i] != '\r' && Sql[i] != '\n') i++;
}
break;
}
}
}
}
if (string.IsNullOrEmpty(CTE) || string.IsNullOrEmpty(sql))
{
name = FullSQLName;
}
else
{
name = string.Format("(\r\n{0}\r\n) {1}", sql, AliasName); ;
}
}
/// <summary>
/// Current MetaSource
/// </summary>
[XmlIgnore, Browsable(false)]
public MetaSource Source { get; set; }
/// <summary>
/// Source GUID for the LINQ Sub-models
/// </summary>
public string LINQSourceGUID
{
get
{
if (Source is ReportSource)
{
return ((ReportSource)Source).MetaSourceGUID ?? Source.GUID;
}
return Source.GUID;
}
}
/// <summary>
/// Returns the last order to display the columns
/// </summary>
public int GetLastDisplayOrder()
{
if (Columns.Count > 0) return Columns.Max(i => i.DisplayOrder) + 1;
return 1;
}
/// <summary>
/// For No SQL Source, build the DataTable from the DefinitionScript, if withLoad is true, the table is then loaded with the LoadScript
/// </summary>
public DataTable BuildNoSQLTable(bool withLoad)
{
lock (this)
{
WithDataLoad = withLoad;
var definitionInitScript = DefinitionInitScript;
if (string.IsNullOrEmpty(definitionInitScript)) definitionInitScript = DefaultDefinitionInitScript;
var definitionScript = DefinitionScript;
if (string.IsNullOrEmpty(definitionScript)) definitionScript = DefaultDefinitionScript;
if (!string.IsNullOrEmpty(definitionScript))
{
MongoStages.Clear();
if (!string.IsNullOrEmpty(definitionInitScript)) RazorHelper.CompileExecute(definitionInitScript, this);
if (withLoad && !string.IsNullOrEmpty(MongoStagesScript)) RazorHelper.CompileExecute(MongoStagesScript, this);
RazorHelper.CompileExecute(definitionScript, this);
if (withLoad)
{
var loadScript = LoadScript;
if (string.IsNullOrEmpty(loadScript)) loadScript = DefaultLoadScript;
if (!string.IsNullOrEmpty(loadScript)) RazorHelper.CompileExecute(loadScript, this);
}
}
else NoSQLTable = new DataTable(Name);
}
return NoSQLTable;
}
DataTable GetDefinitionTable(string sql)
{
DataTable result = null;
var finalSQL = sql;
try
{
if (IsSQL)
{
DbConnection connection = (Model != null ? Model.Connection.GetOpenConnection() : Source.GetOpenConnection());
Helper.ExecutePrePostSQL(connection, Model == null ? ReportModel.ClearCommonRestrictions(PreSQL) : Model.ParseCommonRestrictions(PreSQL), this, IgnorePrePostError);
finalSQL = Model == null ? ReportModel.ClearCommonRestrictions(sql) : Model.ParseCommonRestrictions(sql);
result = Helper.GetDataTable(connection, finalSQL);
Helper.ExecutePrePostSQL(connection, Model == null ? ReportModel.ClearCommonRestrictions(PostSQL) : Model.ParseCommonRestrictions(PostSQL), this, IgnorePrePostError);
connection.Close();
}
else
{
result = BuildNoSQLTable(false);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message + "\r\n" + finalSQL);
}
return result;
}
/// <summary>
/// Refresh the dynamic columns
/// </summary>
public void Refresh()
{
if (Source == null || !DynamicColumns) return;
try
{
Information = "";
Error = "";
MustRefresh = true;
//Build table def from SQL or table name
var sql = "";
if (IsForSQLModel)
{
if (Model.UseRawSQL) sql = Sql;
else sql = string.Format("SELECT * FROM ({0}) a WHERE 1=0", Sql);
}
else if (IsSQL)
{
string CTE = "", name = "";
GetExecSQLName(ref CTE, ref name);
sql = string.Format("{0}SELECT * FROM {1} WHERE 1=0", CTE, name);
}
DataTable defTable = GetDefinitionTable(sql);
int position = 1;
var sourceAliasName = Source.GetTableName(AliasName);
foreach (DataColumn column in defTable.Columns)
{
string columnName = (IsSQL ? Source.GetColumnName(column.ColumnName) : column.ColumnName);
string fullColumnName = (IsSQL && !IsForSQLModel ? sourceAliasName + "." : "") + columnName;
MetaColumn newColumn = Columns.FirstOrDefault(i => i.Name.ToLower() == fullColumnName.ToLower());
column.ColumnName = fullColumnName; //Set it here to clear the columns later
ColumnType type = Helper.NetTypeConverter(column.DataType);
if (newColumn == null)
{
newColumn = MetaColumn.Create(fullColumnName);
newColumn.Source = Source;
newColumn.DisplayName = (KeepColumnNames ? column.ColumnName.Trim() : Helper.DBNameToDisplayName(columnName).Trim());
newColumn.Category = AliasName;
newColumn.DisplayOrder = GetLastDisplayOrder();
Columns.Add(newColumn);
newColumn.Type = type;
newColumn.SetStandardFormat();
}
newColumn.Source = Source;
if (type != newColumn.Type)
{
newColumn.Type = type;
newColumn.SetStandardFormat();
}
newColumn.DisplayOrder = position++;
}
//Clear columns for No SQL or SQL Model
if (!IsSQL || IsForSQLModel)
{
Columns.RemoveAll(i => !defTable.Columns.Contains(i.Name));
}
MustRefresh = false;
Information = "Dynamic columns have been refreshed successfully";
}
catch (Exception ex)
{
Error = ex.Message;
Information = "Error got when refreshing dynamic columns.";
}
Information = Helper.FormatMessage(Information);
UpdateEditorAttributes();
}
/// <summary>
/// Sort the table columns either by alphanumeric order or by position
/// </summary>
public void SortColumns(bool byPosition)
{
if (Source == null) return;
try
{
Information = "";
Error = "";
List<string> colNames = new List<string>();
if (byPosition)
{
DataTable defTable = GetDefinitionTable(string.Format("SELECT * FROM {0} WHERE 1=0", FullSQLName));
foreach (DataColumn column in defTable.Columns)
{
colNames.Add(Source.GetTableName(AliasName) + "." + Source.GetColumnName(column.ColumnName));
}
}
else
{
foreach (var col in Columns) colNames.Add(col.DisplayName);
colNames.Sort();
}
foreach (var col in Columns) col.DisplayOrder = -1;
int position = 1;
foreach (string columnName in colNames)
{
var cols = Columns.Where(i => (byPosition && i.Name.Trim().ToLower() == columnName.Trim().ToLower()) || (!byPosition && i.DisplayName.Trim().ToLower() == columnName.Trim().ToLower()));
foreach (var col in cols) col.DisplayOrder = position++;
}
foreach (var col in Columns) if (col.DisplayOrder == -1) col.DisplayOrder = GetLastDisplayOrder();
Information = "Columns have been sorted by " + (byPosition ? "SQL position" : "Name");
}
catch (Exception ex)
{
Error = ex.Message;
Information = "Error got when sorting columns.";
}
Information = Helper.FormatMessage(Information);
UpdateEditorAttributes();
}
/// <summary>
/// Check the table. If a MetaColumn is specified, only the column is checked.
/// </summary>
public void CheckTable(MetaColumn column)
{
if (Source == null) return;
Information = "";
Error = "";
try
{
if (IsSQL)
{
string colNames = "", groupByNames = "";
foreach (var col in Columns)
{
if (column != null && col != column) continue;
Helper.AddValue(ref colNames, ",", col.Name);
if (!col.IsAggregate) Helper.AddValue(ref groupByNames, ",", col.Name);
}
if (string.IsNullOrEmpty(colNames)) colNames = "1";
string CTE = "", name = "";
GetExecSQLName(ref CTE, ref name);
string sql = string.Format("{0}SELECT {1} FROM {2} WHERE 1=0", CTE, colNames, name);
if (!string.IsNullOrWhiteSpace(WhereSQL))
{
var where = RazorHelper.CompileExecute(WhereSQL, this);
if (!string.IsNullOrWhiteSpace(where)) sql += string.Format("\r\nAND ({0})", RazorHelper.CompileExecute(where, this));
}
if (Columns.Exists(i => i.IsAggregate) && !string.IsNullOrEmpty(groupByNames))
{
sql += string.Format("\r\nGROUP BY {0}", groupByNames);
}
Error = Source.CheckSQL(sql, new List<MetaTable>() { this }, null, false);
}
else
{
BuildNoSQLTable(!IsMongoDb);
}
if (string.IsNullOrEmpty(Error)) Information = "Table checked successfully";
else Information = "Error got when checking table.";
if (column != null)
{
column.Error = Error;
if (string.IsNullOrEmpty(column.Error)) column.Information = "Column checked successfully";
else column.Information = "Error got when checking column.";
column.Information = Helper.FormatMessage(column.Information);
}
}
catch (TemplateCompilationException ex)
{
Error = Helper.GetExceptionMessage(ex);
}
catch (Exception ex)
{
Error = ex.Message;
Information = "Error got when checking the table.";
}
Information = Helper.FormatMessage(Information);
UpdateEditorAttributes();
}
/// <summary>
/// Return the values from a column in the table
/// </summary>
/// <param name="column"></param>
/// <returns></returns>
public string ShowValues(MetaColumn column)
{
string result = "";
try
{
int cnt = 1000;
if (IsSQL)
{
string sql = string.Format("SELECT {0} FROM {1}", column.Name, FullSQLName);
result = string.Format("{0}\r\n\r\n{1}:\r\n", sql, column.DisplayName);
DbConnection connection = Source.GetOpenConnection();
DbCommand command = connection.CreateCommand();
command.CommandText = sql;
var reader = command.ExecuteReader();
while (reader.Read() && --cnt >= 0)
{
string valueStr = "";
if (!reader.IsDBNull(0))
{
object value = reader[0];
CultureInfo culture = (Source.Report != null ? Source.Report.ExecutionView.CultureInfo : Source.Repository.CultureInfo);
if (value is IFormattable) valueStr = ((IFormattable)value).ToString(column.Format, culture);
else valueStr = value.ToString();
}
result += string.Format("{0}\r\n", valueStr);
}
reader.Close();
command.Connection.Close();
}
else
{
result = string.Format("{0}:\r\n", column.DisplayName);
DataTable table = BuildNoSQLTable(!IsMongoDb);
foreach (DataRow row in table.Rows)
{
if (--cnt == 0) break;
result += string.Format("{0}\r\n", row[column.Name]);
}
}
}
catch (Exception ex)
{
result = ex.Message;
}
return result;
}
/// <summary>
/// Load date time to handle caching for No SQL tables
/// </summary>
[XmlIgnore]
public DateTime LoadDate = DateTime.MinValue;
/// <summary>
/// DataTable used for Cache Table (No SQL Source)
/// </summary>
[XmlIgnore]
public DataTable NoSQLCacheTable = null;
/// <summary>
/// Set to true if the Load of the table must also include data
/// </summary>
[XmlIgnore]
public bool WithDataLoad = false;
#region Helpers
/// <summary>
/// Editor Helper: Create or update dynamic columns for this table
/// </summary>
#if WINDOWS
[Category("Helpers"), DisplayName("Refresh dynamic columns"), Description("Create or update dynamic columns for this table."), Id(2, 10)]
[Editor(typeof(HelperEditor), typeof(UITypeEditor))]
#endif
public string HelperRefreshColumns
{
get { return "<Click to refresh dynamic columns>"; }
}
/// <summary>
/// Editor Helper: Check the table definition
/// </summary>
#if WINDOWS
[Category("Helpers"), DisplayName("Check table"), Description("Check the table definition."), Id(3, 10)]
[Editor(typeof(HelperEditor), typeof(UITypeEditor))]
#endif
public string HelperCheckTable
{
get { return IsSQL ? "<Click to check the table in the database>" : "<Click to check the table>"; }
}
/// <summary>
/// Last information message
/// </summary>
#if WINDOWS
[Category("Helpers"), DisplayName("Information"), Description("Last information message."), Id(4, 10)]
[EditorAttribute(typeof(InformationUITypeEditor), typeof(UITypeEditor))]
#endif
[XmlIgnore]
public string Information { get; set; }
/// <summary>
/// Last error message
/// </summary>
#if WINDOWS
[Category("Helpers"), DisplayName("Error"), Description("Last error message."), Id(5, 10)]
[EditorAttribute(typeof(ErrorUITypeEditor), typeof(UITypeEditor))]
#endif
[XmlIgnore]
public string Error { get; set; }
#endregion
}
}
| 39.584642 | 452 | 0.526872 | [
"Apache-2.0"
] | Superdrug-innovation/Seal-Report | Projects/SealLibraryWin/Model/MetaTable.cs | 45,366 | C# |
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
// ReSharper disable once CheckNamespace
namespace NKnife.Win.Forms
{
public sealed partial class Api
{
/// <summary>
/// 面向C#使用API的封装:对User32.dll的封装
/// </summary>
public class User32
{
#region 常量
static readonly IntPtr _False = new IntPtr(0);
static readonly IntPtr _True = new IntPtr(1);
#endregion
#region 面向C#使用API的封装
/// <summary>
/// 是否是指定的键的按下
/// </summary>
/// <param name="key">The key.</param>
/// <returns>
/// <c>true</c> if [is key pressed] [the specified key]; otherwise, <c>false</c>.
/// </returns>
public static bool IsKeyPressed(Keys key)
{
return GetKeyState((int)key) < 0;
}
/// <summary>
/// 从一个文件中获取一个鼠标指针
/// </summary>
/// <param name="fileName">含有鼠标指针的一个文件</param>
/// <returns></returns>
public static Cursor LoadCursor(string fileName)
{
return new Cursor(LoadCursorFromFile(fileName));
}
/// <summary>
/// 通过API设置窗体的阴影
/// </summary>
/// <param name="window">The window.</param>
public static void SetWindowShadow(Form window)
{
SetClassLong(window.Handle, (int)WindowShadowParm.GclStyle, GetClassLong(window.Handle, (int)WindowShadowParm.GclStyle) | (int)WindowShadowParm.CsDropshadow);
}
/// <summary>
/// 当无标题栏的Form无法使用窗体移动,调用APT来实现
/// </summary>
/// <param name="form">The form.</param>
public static void SetFormMoveing(Form form)
{
ReleaseCapture();
Api.User32.SendMessage(form.Handle, (int)WMsg.WmSyscommand, (int)WMsg.ScMove + (int)WMsg.Htcaption, 0);
}
/// <summary>
/// API激活控件的是否重绘(刷新)
/// </summary>
/// <param name="control">The h WND.</param>
/// <param name="allowRedraw">if set to <c>true</c> [allow redraw].</param>
public static void SetWindowRedraw(Control control, bool allowRedraw)
{
SendMessage(control.Handle, (int)WMsg.WmSetredraw, (allowRedraw ? _True : _False).ToInt32(), IntPtr.Zero.ToInt32());
}
#region AnimateWindow 窗口动画
/// <summary>
/// 实现窗体的淡入
/// </summary>
/// <param name="control">The form.</param>
/// <param name="time">淡入窗体的时间,毫秒.</param>
/// <returns></returns>
public static bool SetBlendWindowTo(Control control, int time)
{
return AnimateWindow(control.Handle.ToInt32(), time, (int)AnimateParm.AwBlend | (int)AnimateParm.AwActivate);
}
/// <summary>
/// 实现窗体的淡出,一般应在FormClosing中添加代码
/// </summary>
/// <param name="control">The form.</param>
/// <param name="time">The time.</param>
/// <returns></returns>
public static bool SetBlendWindowHide(Control control, int time)
{
return AnimateWindow(control.Handle.ToInt32(), time, (int)AnimateParm.AwHorNegative | (int)AnimateParm.AwHide);
}
/// <summary>
/// API设置控件滑动显示
/// </summary>
/// <param name="contorl">The contorl.</param>
/// <param name="time">The time.</param>
/// <param name="slide">The slide.</param>
/// <returns></returns>
public static bool SetSlidingWindow(Control contorl, int time, Slide slide)
{
return AnimateWindow(contorl.Handle.ToInt32(), time, (int)slide);
}
#endregion
/// <summary>
/// 让树控件向上滚动
/// </summary>
static public void ScrollTreeViewLineUp(TreeView treeView)
{
SendMessage(treeView.Handle, (int)ScrollTreeView.WmVscroll, (int)ScrollTreeView.SbLineup, 0);
}
/// <summary>
/// 让树控件向下滚动
/// </summary>
static public void ScrollTreeViewLineDown(TreeView treeView)
{
SendMessage(treeView.Handle, (int)ScrollTreeView.WmVscroll, (int)ScrollTreeView.SbLinedown, 0);
}
/// <summary>
/// 面向C#使用API的封装:Sets the window hide.
/// </summary>
/// <param name="form">The form.</param>
public static void SetWindowHide(Form form)
{
SetWindowPos(form.Handle, (IntPtr)0, 0, 0, 0, 0, (int)SetWindow.SwpNosize | (int)SetWindow.SwpNomove | (int)SetWindow.SwpHidewindow | (int)SetWindow.SwpNosendchanging);
}
/// <summary>
/// 面向C#使用API的封装:Sets the window show.
/// </summary>
/// <param name="form">The form.</param>
/// <param name="formAfter">The form after.</param>
/// <param name="x">The x.</param>
/// <param name="y">The y.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
public static void SetWindowShow(Form form, Form formAfter, int x, int y, int width, int height)
{
SetWindowPos(form.Handle, (formAfter == null ? (IntPtr)0 : formAfter.Handle), x, y, width, height, (int)SetWindow.SwpShowwindow | (int)SetWindow.SwpNoactivate);
}
#endregion
#region int -> enum
enum WindowShadowParm : int
{
CsDropshadow = 0x20000,
GcwAtom = -32,
GclCbclsextra = -20,
GclCbwndextra = -18,
GclHbrbackground = -10,
GclHcursor = -12,
GclHicon = -14,
GclHmodule = -16,
GclMenuname = -8,
GclWndproc = -24,
GclStyle = (-26),
}
public enum GlobalHotkeyModifiers
{
ModAlt = 0x1,
ModControl = 0x2,
ModShift = 0x4,
ModWin = 0x8
}
enum SetWindow : int
{
SwpNosize = 0x0001,
SwpNomove = 0x0002,
SwpNozorder = 0x0004,
SwpNoredraw = 0x0008,
SwpNoactivate = 0x0010,
SwpFramechanged = 0x0020, /* The frame changed: send WM_NCCALCSIZE */
SwpShowwindow = 0x0040,
SwpHidewindow = 0x0080,
SwpNocopybits = 0x0100,
SwpNoownerzorder = 0x0200, /* Don't do owner Z ordering */
SwpNosendchanging = 0x0400, /* Don't send WM_WINDOWPOSCHANGING */
}
/// <summary>
/// Show Window Command
/// </summary>
public enum ShowWindowCommand : int
{
/// <summary>
/// Hides the window and activates another window.
/// </summary>
Hide = 0,
/// <summary>
/// Activates and displays a window. If the window is minimized or
/// maximized, the system restores it to its original size and position.
/// An application should specify this flag when displaying the window
/// for the first time.
/// </summary>
Normal = 1,
/// <summary>
/// Activates the window and displays it as a minimized window.
/// </summary>
ShowMinimized = 2,
/// <summary>
/// Maximizes the specified window.
/// </summary>
Maximize = 3, // is this the right value?
/// <summary>
/// Activates the window and displays it as a maximized window.
/// </summary>
ShowMaximized = 3,
/// <summary>
/// Displays a window in its most recent size and position. This value
/// is similar to <see cref="Win32.ShowWindowCommand.Normal"/>, except
/// the window is not actived.
/// </summary>
ShowNoActivate = 4,
/// <summary>
/// Activates the window and displays it in its current size and position.
/// </summary>
Show = 5,
/// <summary>
/// Minimizes the specified window and activates the next top-level
/// window in the Z order.
/// </summary>
Minimize = 6,
/// <summary>
/// Displays the window as a minimized window. This value is similar to
/// <see cref="Win32.ShowWindowCommand.ShowMinimized"/>, except the
/// window is not activated.
/// </summary>
ShowMinNoActive = 7,
/// <summary>
/// Displays the window in its current size and position. This value is
/// similar to <see cref="Win32.ShowWindowCommand.Show"/>, except the
/// window is not activated.
/// </summary>
ShowNa = 8,
/// <summary>
/// Activates and displays the window. If the window is minimized or
/// maximized, the system restores it to its original size and position.
/// An application should specify this flag when restoring a minimized window.
/// </summary>
Restore = 9,
/// <summary>
/// Sets the show state based on the SW_* value specified in the
/// STARTUPINFO structure passed to the CreateProcess function by the
/// program that started the application.
/// </summary>
ShowDefault = 10,
/// <summary>
/// <b>Windows 2000/XP:</b> Minimizes a window, even if the thread
/// that owns the window is not responding. This flag should only be
/// used when minimizing windows from a different thread.
/// </summary>
ForceMinimize = 11
}
enum ScrollTreeView : int
{
WmVscroll = 0x0115,
SbLineup = 0,
SbLineleft = 0,
SbLinedown = 1,
SbLineright = 1,
SbPageup = 2,
SbPageleft = 2,
SbPagedown = 3,
SbPageright = 3,
SbThumbposition = 4,
SbThumbtrack = 5,
SbTop = 6,
SbLeft = 6,
SbBottom = 7,
SbRight = 7,
SbEndscroll = 8,
}
/// <summary>
/// SendMessage中wMsg参数常量值
/// </summary>
public enum WMsg : int
{
/// <summary>
/// WM_KEYDOWN 按下一个键
/// </summary>
WmKeydown = 0x0100,
/// <summary>释放一个键</summary>
WmKeyup = 0x0101,
/// <summary>按下某键,并已发出WM_KEYDOWN, WM_KEYUP消息</summary>
WmChar = 0x102,
/// <summary>当用translatemessage函数翻译WM_KEYUP消息时发送此消息给拥有焦点的窗口</summary>
WmDeadchar = 0x103,
/// <summary>当用户按住ALT键同时按下其它键时提交此消息给拥有焦点的窗口</summary>
WmSyskeydown = 0x104,
/// <summary>当用户释放一个键同时ALT 键还按着时提交此消息给拥有焦点的窗口</summary>
WmSyskeyup = 0x105,
/// <summary>当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后提交此消息给拥有焦点的窗口</summary>
WmSyschar = 0x106,
/// <summary>当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后发送此消息给拥有焦点的窗口</summary>
WmSysdeadchar = 0x107,
/// <summary>在一个对话框程序被显示前发送此消息给它,通常用此消息初始化控件和执行其它任务</summary>
WmInitdialog = 0x110,
/// <summary>当用户选择一条菜单命令项或当某个控件发送一条消息给它的父窗口,一个快捷键被翻译</summary>
WmCommand = 0x111,
/// <summary>当用户选择窗口菜单的一条命令,或当用户选择最大化或最小化时那个窗口会收到此消息</summary>
WmSyscommand = 0x0112,
/// <summary>发生了定时器事件</summary>
WmTimer = 0x113,
/// <summary>当一个窗口标准水平滚动条产生一个滚动事件时发送此消息给那个窗口,也发送给拥有它的控件</summary>
WmHscroll = 0x114,
/// <summary>当一个窗口标准垂直滚动条产生一个滚动事件时发送此消息给那个窗口也,发送给拥有它的控件</summary>
WmVscroll = 0x115,
/// <summary>当一个菜单将要被激活时发送此消息,它发生在用户菜单条中的某项或按下某个菜单键,它允许程序在显示前更改菜单</summary>
WmInitmenu = 0x116,
/// <summary>当一个下拉菜单或子菜单将要被激活时发送此消息,它允许程序在它显示前更改菜单,而不要改变全部</summary>
WmInitmenupopup = 0x117,
/// <summary>当用户选择一条菜单项时发送此消息给菜单的所有者(一般是窗口)</summary>
WmMenuselect = 0x11F,
/// <summary>当菜单已被激活用户按下了某个键(不同于加速键),发送此消息给菜单的所有者</summary>
WmMenuchar = 0x120,
/// <summary>当一个模态对话框或菜单进入空载状态时发送此消息给它的所有者,一个模态对话框或菜单进入空载状态就是在处理完一条或几条先前的消息后没有消息它的列队中等待</summary>
WmEnteridle = 0x121,
/// <summary>在windows绘制消息框前发送此消息给消息框的所有者窗口,通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置消息框的文本和背景颜色</summary>
WmCtlcolormsgbox = 0x132,
/// <summary>当一个编辑型控件将要被绘制时发送此消息给它的父窗口通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置编辑框的文本和背景颜色</summary>
WmCtlcoloredit = 0x133,
/// <summary>当一个列表框控件将要被绘制前发送此消息给它的父窗口通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置列表框的文本和背景颜色</summary>
WmCtlcolorlistbox = 0x134,
/// <summary>当一个按钮控件将要被绘制时发送此消息给它的父窗口通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置按纽的文本和背景颜色</summary>
WmCtlcolorbtn = 0x135,
/// <summary>当一个对话框控件将要被绘制前发送此消息给它的父窗口通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置对话框的文本背景颜色</summary>
WmCtlcolordlg = 0x136,
/// <summary>当一个滚动条控件将要被绘制时发送此消息给它的父窗口通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置滚动条的背景颜色</summary>
WmCtlcolorscrollbar = 0x137,
/// <summary>当一个静态控件将要被绘制时发送此消息给它的父窗口通过响应这条消息,所有者窗口可以 通过使用给定的相关显示设备的句柄来设置静态控件的文本和背景颜色</summary>
WmCtlcolorstatic = 0x138,
/// <summary>当鼠标轮子转动时发送此消息个当前有焦点的控件</summary>
WmMousewheel = 0x20A,
/// <summary>双击鼠标中键</summary>
WmMbuttondblclk = 0x209,
/// <summary>释放鼠标中键</summary>
WmMbuttonup = 0x208,
/// <summary>移动鼠标时发生,同WM_MOUSEFIRST</summary>
WmMousemove = 0x200,
/// <summary>按下鼠标左键</summary>
WmLbuttondown = 0x201,
/// <summary>释放鼠标左键</summary>
WmLbuttonup = 0x202,
/// <summary>双击鼠标左键</summary>
WmLbuttondblclk = 0x203,
/// <summary>按下鼠标右键</summary>
WmRbuttondown = 0x204,
/// <summary>释放鼠标右键</summary>
WmRbuttonup = 0x205,
/// <summary>双击鼠标右键</summary>
WmRbuttondblclk = 0x206,
/// <summary>按下鼠标中键</summary>
WmMbuttondown = 0x207,
/// <summary>创建一个窗口</summary>
WmCreate = 0x01,
/// <summary>当一个窗口被破坏时发送</summary>
WmDestroy = 0x02,
/// <summary>移动一个窗口</summary>
WmMove = 0x03,
/// <summary>改变一个窗口的大小</summary>
WmSize = 0x05,
/// <summary>一个窗口被激活或失去激活状态</summary>
WmActivate = 0x06,
/// <summary>一个窗口获得焦点</summary>
WmSetfocus = 0x07,
/// <summary>一个窗口失去焦点</summary>
WmKillfocus = 0x08,
/// <summary>一个窗口改变成Enable状态</summary>
WmEnable = 0x0A,
/// <summary>设置窗口是否能重画</summary>
WmSetredraw = 0x0B,
/// <summary>应用程序发送此消息来设置一个窗口的文本</summary>
WmSettext = 0x0C,
/// <summary>应用程序发送此消息来复制对应窗口的文本到缓冲区</summary>
WmGettext = 0x0D,
/// <summary>得到与一个窗口有关的文本的长度(不包含空字符)</summary>
WmGettextlength = 0x0E,
/// <summary>要求一个窗口重画自己</summary>
WmPaint = 0x0F,
/// <summary>当一个窗口或应用程序要关闭时发送一个信号</summary>
WmClose = 0x10,
/// <summary>当用户选择结束对话框或程序自己调用ExitWindows函数</summary>
WmQueryendsession = 0x11,
/// <summary>用来结束程序运行</summary>
WmQuit = 0x12,
/// <summary>当用户窗口恢复以前的大小位置时,把此消息发送给某个图标</summary>
WmQueryopen = 0x13,
/// <summary>当窗口背景必须被擦除时(例在窗口改变大小时)</summary>
WmErasebkgnd = 0x14,
/// <summary>当系统颜色改变时,发送此消息给所有顶级窗口</summary>
WmSyscolorchange = 0x15,
/// <summary>当系统进程发出WM_QUERYENDSESSION消息后,此消息发送给应用程序,通知它对话是否结束</summary>
WmEndsession = 0x16,
/// <summary>当隐藏或显示窗口是发送此消息给这个窗口</summary>
WmShowwindow = 0x18,
/// <summary>发此消息给应用程序哪个窗口是激活的,哪个是非激活的</summary>
WmActivateapp = 0x1C,
/// <summary>当系统的字体资源库变化时发送此消息给所有顶级窗口</summary>
WmFontchange = 0x1D,
/// <summary>当系统的时间变化时发送此消息给所有顶级窗口</summary>
WmTimechange = 0x1E,
/// <summary>发送此消息来取消某种正在进行的摸态(操作)</summary>
WmCancelmode = 0x1F,
/// <summary>如果鼠标引起光标在某个窗口中移动且鼠标输入没有被捕获时,就发消息给某个窗口</summary>
WmSetcursor = 0x20,
/// <summary>当光标在某个非激活的窗口中而用户正按着鼠标的某个键发送此消息给当前窗口</summary>
WmMouseactivate = 0x21,
/// <summary>发送此消息给MDI子窗口,当用户点击此窗口的标题栏,或当窗口被激活,移动,改变大小</summary>
WmChildactivate = 0x22,
/// <summary>此消息由基于计算机的训练程序发送,通过WH_JOURNALPALYBACK的hook程序分离出用户输入消息</summary>
WmQueuesync = 0x23,
/// <summary>此消息发送给窗口当它将要改变大小或位置</summary>
WmGetminmaxinfo = 0x24,
/// <summary>发送给最小化窗口当它图标将要被重画</summary>
WmPainticon = 0x26,
/// <summary>此消息发送给某个最小化窗口,仅当它在画图标前它的背景必须被重画</summary>
WmIconerasebkgnd = 0x27,
/// <summary>发送此消息给一个对话框程序去更改焦点位置</summary>
WmNextdlgctl = 0x28,
/// <summary>每当打印管理列队增加或减少一条作业时发出此消息</summary>
WmSpoolerstatus = 0x2A,
/// <summary>当button,combobox,listbox,menu的可视外观改变时发送</summary>
WmDrawitem = 0x2B,
/// <summary>当button, combo box, list box, list view control, or menu item 被创建时</summary>
WmMeasureitem = 0x2C,
/// <summary>此消息有一个LBS_WANTKEYBOARDINPUT风格的发出给它的所有者来响应WM_KEYDOWN消息</summary>
WmVkeytoitem = 0x2E,
/// <summary>此消息由一个LBS_WANTKEYBOARDINPUT风格的列表框发送给他的所有者来响应WM_CHAR消息</summary>
WmChartoitem = 0x2F,
/// <summary>当绘制文本时程序发送此消息得到控件要用的颜色</summary>
WmSetfont = 0x30,
/// <summary>应用程序发送此消息得到当前控件绘制文本的字体</summary>
WmGetfont = 0x31,
/// <summary>应用程序发送此消息让一个窗口与一个热键相关连</summary>
WmSethotkey = 0x32,
/// <summary>应用程序发送此消息来判断热键与某个窗口是否有关联</summary>
WmGethotkey = 0x33,
/// <summary>此消息发送给最小化窗口,当此窗口将要被拖放而它的类中没有定义图标,应用程序能返回一个图标或光标的句柄,当用户拖放图标时系统显示这个图标或光标</summary>
WmQuerydragicon = 0x37,
/// <summary>发送此消息来判定combobox或listbox新增加的项的相对位置</summary>
WmCompareitem = 0x39,
/// <summary>显示内存已经很少了</summary>
WmCompacting = 0x41,
/// <summary>发送此消息给那个窗口的大小和位置将要被改变时,来调用setwindowpos函数或其它窗口管理函数</summary>
WmWindowposchanging = 0x46,
/// <summary>发送此消息给那个窗口的大小和位置已经被改变时,来调用setwindowpos函数或其它窗口管理函数</summary>
WmWindowposchanged = 0x47,
/// <summary>当系统将要进入暂停状态时发送此消息</summary>
WmPower = 0x48,
/// <summary>当一个应用程序传递数据给另一个应用程序时发送此消息</summary>
WmCopydata = 0x4A,
/// <summary>当某个用户取消程序日志激活状态,提交此消息给程序</summary>
WmCanceljourna = 0x4B,
/// <summary>当某个控件的某个事件已经发生或这个控件需要得到一些信息时,发送此消息给它的父窗口</summary>
WmNotify = 0x4E,
/// <summary>当用户选择某种输入语言,或输入语言的热键改变</summary>
WmInputlangchangerequest = 0x50,
/// <summary>当平台现场已经被改变后发送此消息给受影响的最顶级窗口</summary>
WmInputlangchange = 0x51,
/// <summary>当程序已经初始化windows帮助例程时发送此消息给应用程序</summary>
WmTcard = 0x52,
/// <summary>此消息显示用户按下了F1,如果某个菜单是激活的,就发送此消息个此窗口关联的菜单,否则就发送给有焦点的窗口,如果
/// 当前都没有焦点,就把此消息发送给当前激活的窗口</summary>
WmHelp = 0x53,
/// <summary>当用户已经登入或退出后发送此消息给所有的窗口,当用户登入或退出时系统更新用户的具体设置信息,在用户更新设置时系统马上发送此消息</summary>
WmUserchanged = 0x54,
/// <summary>公用控件,自定义控件和他们的父窗口通过此消息来判断控件是使用ANSI还是UNICODE结构</summary>
WmNotifyformat = 0x55,
/// <summary>当调用SETWINDOWLONG函数将要改变一个或多个 窗口的风格时发送此消息给那个窗口</summary>
WmStylechanging = 0x7C,
/// <summary>当调用SETWINDOWLONG函数一个或多个 窗口的风格后发送此消息给那个窗口</summary>
WmStylechanged = 0x7D,
/// <summary>当显示器的分辨率改变后发送此消息给所有的窗口</summary>
WmDisplaychange = 0x7E,
/// <summary>此消息发送给某个窗口来返回与某个窗口有关连的大图标或小图标的句柄</summary>
WmGeticon = 0x7F,
/// <summary>程序发送此消息让一个新的大图标或小图标与某个窗口关联</summary>
WmSeticon = 0x80,
/// <summary>当某个窗口第一次被创建时,此消息在WM_CREATE消息发送前发送</summary>
WmNccreate = 0x81,
/// <summary>此消息通知某个窗口,非客户区正在销毁</summary>
WmNcdestroy = 0x82,
/// <summary>当某个窗口的客户区域必须被核算时发送此消息</summary>
WmNccalcsize = 0x83,
/// <summary>移动鼠标,按住或释放鼠标时发生</summary>
WmNchittest = 0x84,
/// <summary>程序发送此消息给某个窗口当它(窗口)的框架必须被绘制时</summary>
WmNcpaint = 0x85,
/// <summary>此消息发送给某个窗口仅当它的非客户区需要被改变来显示是激活还是非激活状态</summary>
WmNcactivate = 0x86,
/// <summary>发送此消息给某个与对话框程序关联的控件,widdows控制方位键和TAB键使输入进入此控件通过应</summary>
WmGetdlgcode = 0x87,
/// <summary>当光标在一个窗口的非客户区内移动时发送此消息给这个窗口 非客户区为:窗体的标题栏及窗 的边框体</summary>
WmNcmousemove = 0xA0,
/// <summary>当光标在一个窗口的非客户区同时按下鼠标左键时提交此消息</summary>
WmNclbuttondown = 0xA1,
/// <summary>当用户释放鼠标左键同时光标某个窗口在非客户区十发送此消息</summary>
WmNclbuttonup = 0xA2,
/// <summary>当用户双击鼠标左键同时光标某个窗口在非客户区十发送此消息</summary>
WmNclbuttondblclk = 0xA3,
/// <summary>当用户按下鼠标右键同时光标又在窗口的非客户区时发送此消息</summary>
WmNcrbuttondown = 0xA4,
/// <summary>当用户释放鼠标右键同时光标又在窗口的非客户区时发送此消息</summary>
WmNcrbuttonup = 0xA5,
/// <summary>当用户双击鼠标右键同时光标某个窗口在非客户区十发送此消息</summary>
WmNcrbuttondblclk = 0xA6,
/// <summary>当用户按下鼠标中键同时光标又在窗口的非客户区时发送此消息</summary>
WmNcmbuttondown = 0xA7,
/// <summary>当用户释放鼠标中键同时光标又在窗口的非客户区时发送此消息</summary>
WmNcmbuttonup = 0xA8,
/// <summary>当用户双击鼠标中键同时光标又在窗口的非客户区时发送此消息</summary>
WmNcmbuttondblclk = 0xA9,
/// <summary>
///
/// </summary>
WmUser = 0x0400,
/// <summary>
///
/// </summary>
MkLbutton = 0x0001,
/// <summary>
///
/// </summary>
MkRbutton = 0x0002,
/// <summary>
///
/// </summary>
MkShift = 0x0004,
/// <summary>
///
/// </summary>
MkControl = 0x0008,
/// <summary>
///
/// </summary>
MkMbutton = 0x0010,
/// <summary>
///
/// </summary>
MkXbutton1 = 0x0020,
/// <summary>
///
/// </summary>
MkXbutton2 = 0x0040,
/// <summary>
///
/// </summary>
WmSendthishwnd = WmUser + 143,
/// <summary>
///
/// </summary>
WmWebviewisstart = WmUser + 144,
/// <summary>
///
/// </summary>
WmSendtocloseform = WmUser + 145,
/// <summary>
/// 移动信息
/// </summary>
ScMove = 0xF010,
/// <summary>
/// 表示鼠标在窗口标题栏时的系统信息
/// </summary>
Htcaption = 0x0002,
/// <summary>
/// 表示鼠标在窗口客户区的系统消息
/// </summary>
Htclient = 0x01
}
/// <summary>
/// 窗口滑动的方向
/// </summary>
public enum Slide : int
{
/// <summary>
/// 上到下
/// </summary>
Top2Bottom = AnimateParm.AwVerPositive,
/// <summary>
/// 右到左
/// </summary>
Right2Left = AnimateParm.AwHorNegative,
/// <summary>
/// 左到右
/// </summary>
Left2Right = AnimateParm.AwHorPositive,
/// <summary>
/// 下到上
/// </summary>
Bottom2Top = AnimateParm.AwVerNegative
}
public enum AnimateParm : int
{
/// <summary>
/// 自左向右显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志
/// </summary>
AwHorPositive = 0x0001,
/// <summary>
/// 自右向左显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志
/// </summary>
AwHorNegative = 0x0002,
/// <summary>
/// 自顶向下显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志
/// </summary>
AwVerPositive = 0x0004,
/// <summary>
/// 自下向上显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志该标志
/// </summary>
AwVerNegative = 0x0008,
/// <summary>
/// 若使用了AW_HIDE标志,则使窗口向内重叠,即收缩窗口;否则使窗口向外扩展,即展开窗口
/// </summary>
AwCenter = 0x00000010,
/// <summary>
/// 隐藏窗口,缺省则显示窗口
/// </summary>
AwHide = 0x00010000,
/// <summary>
/// 激活窗口。在使用了AW_HIDE标志后不能使用这个标志
/// </summary>
AwActivate = 0x00020000,
/// <summary>
/// 使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时,这个标志就被忽略
/// </summary>
AwSlide = 0x00040000,
/// <summary>
/// 透明度从高到低
/// </summary>
AwBlend = 0x00080000
}
#endregion
#region DllImport
/// <summary>
/// 该函数检索一指定窗口的客户区域或整个屏幕的显示设备上下文环境的句柄,以后可以在GDI函数中使用该句柄来在设备上下文环境中绘图。hWnd:设备上下文环境被检索的窗口的句柄
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr hWnd);
/// <summary>
/// 函数释放设备上下文环境(DC)供其他应用程序使用。
/// </summary>
[DllImport("user32.dll")]
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDc);
/// <summary>
/// 该函数返回桌面窗口的句柄。桌面窗口覆盖整个屏幕。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr GetDesktopWindow();
//通过窗口的标题来查找窗口的句柄
[DllImport("User32.dll", EntryPoint = "FindWindow")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
/// <summary>
/// 该函数设置指定窗口的显示状态。
/// </summary>
[DllImport("user32.dll")]
static public extern bool ShowWindow(IntPtr hWnd, short state);
/// <summary>
/// 通过发送重绘消息 WM_PAINT 给目标窗体来更新目标窗体客户区的无效区域。
/// </summary>
[DllImport("user32.dll")]
static public extern bool UpdateWindow(IntPtr hWnd);
/// <summary>
/// 该函数将创建指定窗口的线程设置到前台,并且激活该窗口。键盘输入转向该窗口,并为用户改各种可视的记号。系统给创建前台窗口的线程分配的权限稍高于其他线程。
/// </summary>
[DllImport("user32.dll")]
static public extern bool SetForegroundWindow(IntPtr hWnd);
/// <summary>
/// 该函数改变一个子窗口,弹出式窗口式顶层窗口的尺寸,位置和Z序。
/// 一般可用来让窗口置于最前(SetWindowPos(this.Handle,-1,0,0,0,0,0x4000|0x0001|0x0002);)
/// </summary>
[DllImport("user32.dll")]
static public extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int width, int height, int flags);
/// <summary>
/// 打开剪切板
/// </summary>
[DllImport("user32.dll")]
static public extern bool OpenClipboard(IntPtr hWndNewOwner);
/// <summary>
/// 关闭剪切板
/// </summary>
[DllImport("user32.dll")]
static public extern bool CloseClipboard();
/// <summary>
/// 打开并清空剪切板
/// </summary>
[DllImport("user32.dll")]
static public extern bool EmptyClipboard();
/// <summary>
/// 将存放有数据的内存块放入剪切板的资源管理中
/// </summary>
[DllImport("user32.dll")]
static public extern IntPtr SetClipboardData(uint format, IntPtr hData);
/// <summary>
/// 在一个矩形中装载指定菜单条目的屏幕坐标信息
/// </summary>
[DllImport("user32.dll")]
static public extern bool GetMenuItemRect(IntPtr hWnd, IntPtr hMenu, uint item, ref Rect rc);
/// <summary>
/// 该函数获得一个指定子窗口的父窗口句柄。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr GetParent(IntPtr hWnd);
/// <summary>
/// 该函数将指定的消息同步发送到一个或多个窗口。
/// 此函数为指定的窗口调用窗口程序,直到窗口程序处理完消息再返回。在同一线程中发送消息并不入线程消息队列。
/// </summary>
/// <param name="hWnd">其窗口程序将接收消息的窗口的句柄</param>
/// <param name="wMsg">指定被发送的消息</param>
/// <param name="wParam">指定附加的消息指定信息</param>
/// <param name="lParam">指定附加的消息指定信息</param>
/// <returns></returns>
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref Rect lParam);
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref Point lParam);
[DllImport("user32.dll")]
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref Tbbutton lParam);
[DllImport("user32.dll")]
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref Tbbuttoninfo lParam);
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref Rebarbandinfo lParam);
[DllImport("user32.dll")]
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref Tvitem lParam);
[DllImport("User32.dll")]
public static extern int SendMessage(int hWnd,int msg, int wParam, ref CopyDataStruct lParam);
/// <summary>
/// 该函数将一个消息放入(寄送)到与指定窗口创建的线程相联系消息队列里,与SendMessage对应。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, int msg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern IntPtr SetWindowsHookEx(int hookid, HookProc pfnhook, IntPtr hinst, int threadid);
[DllImport("user32.dll")]
public static extern bool UnhookWindowsHookEx(IntPtr hhook);
[DllImport("user32.dll")]
public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wparam, IntPtr lparam);
/// <summary>
/// 该函数对指定的窗口设置键盘焦点。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr SetFocus(IntPtr hWnd);
/// <summary>
/// 该函数在指定的矩形里写入格式化文本,根据指定的方法对文本格式化(扩展的制表符,字符对齐、折行等)。
/// </summary>
[DllImport("user32.dll")]
public extern static int DrawText(IntPtr hdc, string lpString, int nCount, ref Rect lpRect, int uFormat);
/// <summary>
/// 该函数改变指定子窗口的父窗口。
/// </summary>
[DllImport("user32.dll")]
public extern static IntPtr SetParent(IntPtr hChild, IntPtr hParent);
/// <summary>
/// 获取对话框中子窗口控件的句柄
/// </summary>
[DllImport("user32.dll")]
public extern static IntPtr GetDlgItem(IntPtr hDlg, int nControlId);
/// <summary>
/// 该函数获取窗口客户区的坐标。
/// </summary>
[DllImport("user32.dll")]
public extern static int GetClientRect(IntPtr hWnd, ref Rect rc);
/// <summary>
/// 该函数向指定的窗体添加一个矩形,然后窗口客户区域的这一部分将被重新绘制。
/// </summary>
[DllImport("user32.dll")]
public extern static int InvalidateRect(IntPtr hWnd, IntPtr rect, int bErase);
/// <summary>
/// 该函数产生对其他线程的控制,如果一个线程没有其他消息在其消息队列里。
/// </summary>
[DllImport("user32.dll")]
public static extern bool WaitMessage();
/// <summary>
/// 该函数为一个消息检查线程消息队列,并将该消息(如果存在)放于指定的结构。
/// </summary>
[DllImport("user32.dll")]
public static extern bool PeekMessage(ref Msg msg, int hWnd, uint wFilterMin, uint wFilterMax, uint wFlag);
/// <summary>
/// 该函数从调用线程的消息队列里取得一个消息并将其放于指定的结构。此函数可取得与指定窗口联系的消息和由PostThreadMesssge寄送的线程消息。此函数接收一定范围的消息值。
/// </summary>
[DllImport("user32.dll")]
public static extern bool GetMessage(ref Msg msg, int hWnd, uint wFilterMin, uint wFilterMax);
/// <summary>
/// 该函数将虚拟键消息转换为字符消息。
/// </summary>
[DllImport("user32.dll")]
public static extern bool TranslateMessage(ref Msg msg);
/// <summary>
/// 该函数调度一个消息给窗口程序。
/// </summary>
[DllImport("user32.dll")]
public static extern bool DispatchMessage(ref Msg msg);
/// <summary>
/// 该函数从一个与应用事例相关的可执行文件(EXE文件)中载入指定的光标资源.
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr LoadCursor(IntPtr hInstance, uint cursor);
/// <summary>
/// 该函数确定光标的形状。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr SetCursor(IntPtr hCursor);
/// <summary>
/// 确定当前焦点位于哪个控件上。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr GetFocus();
/// <summary>
/// 该函数从当前线程中的窗口释放鼠标捕获,并恢复通常的鼠标输入处理。捕获鼠标的窗口接收所有的鼠标输入(无论光标的位置在哪里),除非点击鼠标键时,光标热点在另一个线程的窗口中。
/// </summary>
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
/// <summary>
/// 获得鼠标拖动
/// </summary>
/// <returns></returns>
[DllImport("user32.dll")]
public static extern IntPtr SetCapture(IntPtr hWnd);
/// <summary>
/// 准备指定的窗口来重绘并将绘画相关的信息放到一个PAINTSTRUCT结构中。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr BeginPaint(IntPtr hWnd, ref Paintstruct ps);
/// <summary>
/// 标记指定窗口的绘画过程结束,每次调用BeginPaint函数之后被请求
/// </summary>
[DllImport("user32.dll")]
public static extern bool EndPaint(IntPtr hWnd, ref Paintstruct ps);
/// <summary>
/// 半透明窗体
/// </summary>
[DllImport("user32.dll")]
public static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pprSrc, Int32 crKey, ref Blendfunction pblend, Int32 dwFlags);
/// <summary>
/// 该函数返回指定窗口的边框矩形的尺寸。该尺寸以相对于屏幕坐标左上角的屏幕坐标给出。
/// </summary>
[DllImport("user32.dll")]
public static extern bool GetWindowRect(IntPtr hWnd, ref Rect rect);
/// <summary>
/// 该函数将指定点的用户坐标转换成屏幕坐标。
/// </summary>
[DllImport("user32.dll")]
public static extern bool ClientToScreen(IntPtr hWnd, ref Point pt);
/// <summary>
/// 当在指定时间内鼠标指针离开或盘旋在一个窗口上时,此函数寄送消息。
/// </summary>
[DllImport("user32.dll")]
public static extern bool TrackMouseEvent(ref Trackmouseevent tme);
/// <summary>
///
/// </summary>
[DllImport("user32.dll")]
public static extern bool SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool redraw);
/// <summary>
/// 该函数检取指定虚拟键的状态。
/// </summary>
[DllImport("user32.dll")]
public static extern ushort GetKeyState(int virtKey);
/// <summary>
/// 该函数改变指定窗口的位置和尺寸。对于顶层窗口,位置和尺寸是相对于屏幕的左上角的:对于子窗口,位置和尺寸是相对于父窗口客户区的左上角坐标的。
/// </summary>
[DllImport("user32.dll")]
public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
/// <summary>
/// 该函数获得指定窗口所属的类的类名。
/// </summary>
[DllImport("user32.dll")]
public static extern int GetClassName(IntPtr hWnd, out StringBuilder className, int nMaxCount);
/// <summary>
/// 该函数改变指定窗口的属性
/// </summary>
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", SetLastError = true)]
public static extern UInt32 GetWindowLong(IntPtr hWnd, int nIndex);
/// <summary>
/// 该函数检索指定窗口客户区域或整个屏幕的显示设备上下文环境的句柄,在随后的GDI函数中可以使用该句柄在设备上下文环境中绘图。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hRegion, uint flags);
/// <summary>
/// 获取整个窗口(包括边框、滚动条、标题栏、菜单等)的设备场景 返回值 Long。
/// </summary>
[DllImport("user32.dll")]
public static extern IntPtr GetWindowDC(IntPtr hWnd);
/// <summary>
/// 该函数用指定的画刷填充矩形,此函数包括矩形的左上边界,但不包括矩形的右下边界。
/// </summary>
[DllImport("user32.dll")]
public static extern int FillRect(IntPtr hDc, ref Rect rect, IntPtr hBrush);
/// <summary>
/// 该函数返回指定窗口的显示状态以及被恢复的、最大化的和最小化的窗口位置。
/// </summary>
[DllImport("user32.dll")]
public static extern int GetWindowPlacement(IntPtr hWnd, ref Windowplacement wp);
/// <summary>
/// 该函数改变指定窗口的标题栏的文本内容
/// </summary>
[DllImport("user32.dll")]
public static extern int SetWindowText(IntPtr hWnd, string text);
/// <summary>
/// 该函数将指定窗口的标题条文本(如果存在)拷贝到一个缓存区内。如果指定的窗口是一个控制,则拷贝控制的文本。
/// </summary>
[DllImport("user32.dll")]
public static extern int GetWindowText(IntPtr hWnd, out StringBuilder text, int maxCount);
/// <summary>
/// 用于得到被定义的系统数据或者系统配置信息.
/// </summary>
[DllImport("user32.dll")]
static public extern int GetSystemMetrics(int nIndex);
/// <summary>
/// 该函数设置滚动条参数,包括滚动位置的最大值和最小值,页面大小,滚动按钮的位置。
/// </summary>
[DllImport("user32.dll")]
static public extern int SetScrollInfo(IntPtr hwnd, int bar, ref Scrollinfo si, int fRedraw);
/// <summary>
/// 该函数显示或隐藏所指定的滚动条。
/// </summary>
[DllImport("user32.dll")]
public static extern int ShowScrollBar(IntPtr hWnd, int bar, int show);
/// <summary>
/// 该函数可以激活一个或两个滚动条箭头或是使其失效。
/// </summary>
[DllImport("user32.dll")]
public static extern int EnableScrollBar(IntPtr hWnd, uint flags, uint arrows);
/// <summary>
/// 该函数将指定的窗口设置到Z序的顶部。
/// </summary>
[DllImport("user32.dll")]
public static extern int BringWindowToTop(IntPtr hWnd);
/// <summary>
/// 该函数滚动指定窗体客户区域的目录。
/// </summary>
[DllImport("user32.dll")]
static public extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy, ref Rect rcScroll, ref Rect rcClip, IntPtr updateRegion, ref Rect rcInvalidated, uint flags);
/// <summary>
/// 该函数确定给定的窗口句柄是否识别一个已存在的窗口。
/// </summary>
[DllImport("user32.dll")]
public static extern int IsWindow(IntPtr hWnd);
/// <summary>
/// 该函数将256个虚拟键的状态拷贝到指定的缓冲区中。
/// </summary>
[DllImport("user32.dll")]
public static extern int GetKeyboardState(byte[] pbKeyState);
/// <summary>
/// 该函数将指定的虚拟键码和键盘状态翻译为相应的字符或字符串。该函数使用由给定的键盘布局句柄标识的物理键盘布局和输入语言来翻译代码。
/// </summary>
[DllImport("user32.dll")]
public static extern int ToAscii(int uVirtKey, int uScanCode, byte[] lpbKeyState, byte[] lpwTransKey, int fuState);
/// <summary>
/// Provides access to function required to delete handle. This method is used internally
/// and is not required to be called separately.
/// </summary>
/// <param name="hIcon">Pointer to icon handle.</param>
/// <returns>N/A</returns>
[DllImport("User32.dll")]
public static extern int DestroyIcon(IntPtr hIcon);
[DllImport("user32.dll")]
public static extern IntPtr LoadCursorFromFile(string fileName);
/// <summary>
/// The SetClassLong function replaces the specified 32-bit (long) value at the
/// specified offset into the extra class memory or the WNDCLASSEX structure
/// for the class to which the specified window belongs.
/// NOTE: This function has been superseded by the SetClassLongPtr function.
/// To write code that is compatible with both 32-bit and 64-bit versions of
/// Microsoft Windows, use SetClassLongPtr.
/// </summary>
/// <param name="hwnd">The HWND.</param>
/// <param name="nIndex">Index of the n.</param>
/// <param name="dwNewLong">The dw new long.</param>
/// <returns></returns>
[DllImport("user32.dll")]
public static extern int SetClassLong(IntPtr hwnd, int nIndex, int dwNewLong);
/// <summary>
/// GetClassLong retrieves a single 32-bit value from the information
/// about the window class to which the specified window belongs.
/// The class's properties may not necessarily match perfectly with
/// the actual properties of the window.
/// This function can also retrieve a 32-bit value from the extra
/// memory area associated with the window class. GetClassLong Retrieves
/// the specified 32-bit value from the WNDCLASSEX structure associated
/// with the specified window.
/// </summary>
/// <param name="hwnd">The HWND.</param>
/// <param name="nIndex">Index of the n.</param>
/// <returns>If an error occured,
/// the function returns 0 (use GetLastError to get the error code).
/// If successful, the function returns the desired 32-bit value. </returns>
[DllImport("user32.dll")]
public static extern int GetClassLong(IntPtr hwnd, int nIndex);
[DllImport("user32.dll")]
private static extern bool AnimateWindow(int hwnd, int dwTime, int dwFlags);
#region Global Hotkey
/// <summary>
/// 注册全局热键
/// </summary>
/// <param name="hWnd">The h WND.</param>
/// <param name="id">The id.</param>
/// <param name="fsModifiers">The fs modifiers.</param>
/// <param name="vk">The vk.</param>
/// <returns></returns>
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool RegisterHotKey(IntPtr hWnd, int id, GlobalHotkeyModifiers fsModifiers, Keys vk);
/// <summary>
/// 取消全局热键
/// </summary>
/// <param name="hWnd">The h WND.</param>
/// <param name="id">The id.</param>
/// <returns></returns>
[DllImport("user32.dll")]
public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
#endregion
#endregion
#region Struct
[StructLayout(LayoutKind.Sequential)]
public struct Blendfunction
{
public byte BlendOp;
public byte BlendFlags;
public byte SourceConstantAlpha;
public byte AlphaFormat;
}
[StructLayout(LayoutKind.Sequential)]
public struct Trackmouseevent
{
public UInt32 cbSize;
public UInt32 dwFlags;
public IntPtr hWnd;
public UInt32 dwHoverTime;
public Trackmouseevent(UInt32 dwFlags, IntPtr hWnd, UInt32 dwHoverTime)
{
this.cbSize = 16;
this.dwFlags = dwFlags;
this.hWnd = hWnd;
this.dwHoverTime = dwHoverTime;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct Size
{
public int cx;
public int cy;
public Size(int cx, int cy)
{
this.cx = cx;
this.cy = cy;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct Msg
{
public IntPtr hwnd;
public uint message;
public IntPtr wParam;
public IntPtr lParam;
public uint time;
public Point pt;
}
[StructLayout(LayoutKind.Sequential)]
public struct Point
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Explicit)]
public struct Rect
{
[FieldOffset(0)]
public int left;
[FieldOffset(4)]
public int top;
[FieldOffset(8)]
public int right;
[FieldOffset(12)]
public int bottom;
}
[StructLayout(LayoutKind.Sequential)]
public struct Paintstruct
{
public IntPtr hdc;
public bool fErase;
public Rect rcPaint;
public bool fRestore;
public bool fIncUpdate;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] rgbReserved;
}
[Serializable, StructLayout(LayoutKind.Sequential)]
public struct Scrollinfo
{
public int cbSize;
public int fMask;
public int nMin;
public int nMax;
public int nPage;
public int nPos;
public int nTrackPos;
}
/// <summary>
/// Contains information about the placement of a window on the screen.
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public struct Windowplacement
{
/// <summary>
/// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT).
/// <para>
/// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.
/// </para>
/// </summary>
public int Length;
/// <summary>
/// Specifies flags that control the position of the minimized window and the method by which the window is restored.
/// </summary>
public int Flags;
/// <summary>
/// The current show state of the window.
/// </summary>
public ShowWindowCommand ShowCmd;
/// <summary>
/// The coordinates of the window's upper-left corner when the window is minimized.
/// </summary>
public Point MinPosition;
/// <summary>
/// The coordinates of the window's upper-left corner when the window is maximized.
/// </summary>
public Point MaxPosition;
/// <summary>
/// The window's coordinates when the window is in the restored position.
/// </summary>
public Rect NormalPosition;
/// <summary>
/// Gets the default (empty) value.
/// </summary>
public static Windowplacement Default
{
get
{
Windowplacement result = new Windowplacement();
result.Length = Marshal.SizeOf(result);
return result;
}
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Tbbutton
{
public int iBitmap;
public int idCommand;
public byte fsState;
public byte fsStyle;
public byte bReserved0;
public byte bReserved1;
public int dwData;
public int iString;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct Tbbuttoninfo
{
public int cbSize;
public int dwMask;
public int idCommand;
public int iImage;
public byte fsState;
public byte fsStyle;
public short cx;
public IntPtr lParam;
public IntPtr pszText;
public int cchText;
}
[StructLayout(LayoutKind.Sequential)]
public struct Rebarbandinfo
{
public int cbSize;
public int fMask;
public int fStyle;
public int clrFore;
public int clrBack;
public IntPtr lpText;
public int cch;
public int iImage;
public IntPtr hwndChild;
public int cxMinChild;
public int cyMinChild;
public int cx;
public IntPtr hbmBack;
public int wID;
public int cyChild;
public int cyMaxChild;
public int cyIntegral;
public int cxIdeal;
public int lParam;
public int cxHeader;
}
/// <summary>
/// WM_COPYDATA消息所要求的数据结构
/// </summary>
public struct CopyDataStruct
{
public int _CbData;
public IntPtr _DwData;
[MarshalAs(UnmanagedType.LPStr)]
public string _LpData;
}
[StructLayout(LayoutKind.Sequential)]
public struct Tvitem
{
public uint mask;
public IntPtr hItem;
public uint state;
public uint stateMask;
public IntPtr pszText;
public int cchTextMax;
public int iImage;
public int iSelectedImage;
public int cChildren;
public IntPtr lParam;
}
#endregion
#region 回调函数
public delegate int HookProc(int code, IntPtr wParam, IntPtr lParam);
#endregion
}
}
}
| 40.175258 | 207 | 0.509073 | [
"MIT"
] | xknife-erian/nknife | NKnife.Win.Forms/API/API.User32.cs | 65,312 | C# |
#region License
// Copyright (c) 2011, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This software is licensed under the Open Software License v3.0.
// For the complete license, see http://www.clearcanvas.ca/OSLv3.0
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using ClearCanvas.Common;
using ClearCanvas.Desktop;
using ClearCanvas.Desktop.View.WinForms;
namespace ClearCanvas.ImageViewer.Layout.Basic.View.WinForms
{
/// <summary>
/// Provides a Windows Forms view onto <see cref="DisplaySetOptionsApplicationComponent"/>.
/// </summary>
[ExtensionOf(typeof(DisplaySetCreationConfigurationComponentViewExtensionPoint))]
public class DisplaySetCreationConfigurationComponentView : WinFormsView, IApplicationComponentView
{
private DisplaySetCreationConfigurationComponent _component;
private DisplaySetCreationConfigurationComponentControl _control;
#region IApplicationComponentView Members
/// <summary>
/// Called by the host to assign this view to a component.
/// </summary>
public void SetComponent(IApplicationComponent component)
{
_component = (DisplaySetCreationConfigurationComponent)component;
}
#endregion
/// <summary>
/// Gets the underlying GUI component for this view.
/// </summary>
public override object GuiElement
{
get
{
if (_control == null)
{
_control = new DisplaySetCreationConfigurationComponentControl(_component);
}
return _control;
}
}
}
}
| 30.305085 | 104 | 0.642617 | [
"Apache-2.0"
] | SNBnani/Xian | ImageViewer/Layout/Basic/View/WinForms/DisplaySetCreationConfigurationComponentView.cs | 1,788 | C# |
using Lab.EventSourcing.Core;
using System;
using Xunit;
namespace Lab.EventSourcing.Inventory.Test
{
public class EventStoreCase
{
[Fact]
public void Should_Persist_Events()
{
var eventStore = EventStore.Create();
Inventory inventory = Inventory.Create();
eventStore.Commit(inventory);
var storedInventory = Inventory.Load(eventStore.GetById(inventory.Id));
Assert.Empty(inventory.PendingEvents);
Assert.Equal(inventory.Id, storedInventory.Id);
}
[Fact]
public void Should_Load_All_Events()
{
var eventStore = EventStore.Create();
Inventory inventory = Inventory.Create();
var productId = Guid.NewGuid();
var productQuantity = 10;
inventory.AddProduct(productId, productQuantity);
eventStore.Commit(inventory);
var storedInventory = Inventory.Load(eventStore.GetById(inventory.Id));
Assert.Equal(inventory.Id, storedInventory.Id);
Assert.Equal(productQuantity, storedInventory.GetProductCount(productId));
}
[Fact]
public void Should_Load_Created_Only()
{
var eventStore = EventStore.Create();
Inventory inventory = Inventory.Create();
var productId = Guid.NewGuid();
inventory.AddProduct(productId, 10);
eventStore.Commit(inventory);
var storedInventory = Inventory.Load(eventStore.GetByVersion(inventory.Id, 1));
Assert.Equal(inventory.Id, storedInventory.Id);
Assert.Equal(0, storedInventory.GetProductCount(productId));
}
}
}
| 32.166667 | 91 | 0.614277 | [
"Unlicense"
] | wsantosdev/lab-eventsourcing-parte-3 | Lab.EventSourcing.Inventory.Test/EventStoreCase.cs | 1,739 | C# |
using System;
namespace Mobet.Auditing.Attributes
{
/// <summary>
/// This attribute is used to apply audit logging for a single method or
/// all methods of a class or interface.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class AuditedAttribute : Attribute
{
}
}
| 23 | 76 | 0.681159 | [
"Apache-2.0"
] | Mobet/mobet | Mobet-Net/Mobet.Auditing/Attributes/AuditedAttribute.cs | 347 | C# |
using System.Runtime.Serialization;
namespace EncompassRest.Loans.RateLocks
{
/// <summary>
/// RateStatus
/// </summary>
public enum RateStatus
{
/// <summary>
/// Not Locked
/// </summary>
[EnumMember(Value = "notLocked")]
NotLocked = 0,
/// <summary>
/// Locked
/// </summary>
[EnumMember(Value = "locked")]
Locked = 1,
/// <summary>
/// Expired
/// </summary>
[EnumMember(Value = "expired")]
Expired = 2,
/// <summary>
/// Cancelled
/// </summary>
[EnumMember(Value = "cancelled")]
Cancelled = 3
}
} | 22.225806 | 41 | 0.470247 | [
"MIT"
] | EncompassRest/EncompassREST | src/EncompassRest/Loans/RateLocks/RateStatus.cs | 691 | C# |
using PnP.Core.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
namespace PnP.Core.Model.SharePoint
{
internal sealed class SyntexModel : ISyntexModel
{
#region Properties
public IListItem ListItem { get; internal set; }
public IFile File { get; internal set; }
public int Id
{
get
{
if (ListItem != null)
{
return ListItem.Id;
}
return 0;
}
}
public Guid UniqueId
{
get
{
if (File != null)
{
return File.UniqueId;
}
return Guid.Empty;
}
}
public string Name
{
get
{
if (ListItem != null)
{
return ListItem.Values[PageConstants.ModelMappedClassifierName].ToString();
}
return null;
}
}
public DateTime ModelLastTrained
{
get
{
if (ListItem != null)
{
if (ListItem.Values[PageConstants.ModelLastTrained] is DateTime dateTime)
{
return dateTime;
}
if (DateTime.TryParse(ListItem.Values[PageConstants.ModelLastTrained]?.ToString(), out DateTime modelLastTrained))
{
return modelLastTrained;
}
}
return DateTime.MinValue;
}
}
public string Description
{
get
{
if (ListItem != null)
{
return ListItem.Values[PageConstants.ModelDescription]?.ToString();
}
return null;
}
}
#endregion
#region Methods
#region Get published models
public async Task<List<ISyntexModelPublication>> GetModelPublicationsAsync()
{
ApiCall apiCall = BuildGetModelPublicationsApiCall();
var publications = await (ListItem as ListItem).RawRequestAsync(apiCall, HttpMethod.Post).ConfigureAwait(false);
List<ISyntexModelPublication> results = new List<ISyntexModelPublication>();
if (!string.IsNullOrEmpty(publications.Json))
{
ProcessGetModelPublicationsResponse(publications.Json, results);
}
return results;
}
public List<ISyntexModelPublication> GetModelPublications()
{
return GetModelPublicationsAsync().GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublication>> GetModelPublicationsBatchAsync(Batch batch)
{
ApiCall apiCall = BuildGetModelPublicationsApiCall();
// Since we're doing a raw batch request the processing of the batch response needs be implemented
apiCall.RawEnumerableResult = new List<ISyntexModelPublication>();
apiCall.RawResultsHandler = (json, apiCall) =>
{
ProcessGetModelPublicationsResponse(json, (List<ISyntexModelPublication>)apiCall.RawEnumerableResult);
};
// Add the request to the batch
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
// Return the batch result as Enumerable
return new BatchEnumerableBatchResult<ISyntexModelPublication>(batch, batchRequest.Id, (IReadOnlyList<ISyntexModelPublication>)apiCall.RawEnumerableResult);
}
public IEnumerableBatchResult<ISyntexModelPublication> GetModelPublicationsBatch(Batch batch)
{
return GetModelPublicationsBatchAsync(batch).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublication>> GetModelPublicationsBatchAsync()
{
return await GetModelPublicationsBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch).ConfigureAwait(false);
}
public IEnumerableBatchResult<ISyntexModelPublication> GetModelPublicationsBatch()
{
return GetModelPublicationsBatchAsync().GetAwaiter().GetResult();
}
private ApiCall BuildGetModelPublicationsApiCall()
{
return new ApiCall($"_api/machinelearning/publications/getbymodeluniqueid('{UniqueId}')", ApiType.SPORest);
}
private static void ProcessGetModelPublicationsResponse(string json, List<ISyntexModelPublication> results)
{
var root = JsonSerializer.Deserialize<JsonElement>(json).GetProperty("value");
if (root.ValueKind == JsonValueKind.Array)
{
foreach (var publicationResultJson in root.EnumerateArray())
{
var modelPublication = new SyntexModelPublication
{
ModelUniqueId = publicationResultJson.GetProperty("ModelUniqueId").GetGuid(),
TargetLibraryServerRelativeUrl = publicationResultJson.GetProperty("TargetLibraryServerRelativeUrl").GetString(),
TargetWebServerRelativeUrl = publicationResultJson.GetProperty("TargetWebServerRelativeUrl").GetString(),
TargetSiteUrl = publicationResultJson.GetProperty("TargetSiteUrl").ToString(),
ViewOption = (MachineLearningPublicationViewOption)Enum.Parse(typeof(MachineLearningPublicationViewOption), publicationResultJson.GetProperty("ViewOption").ToString())
};
results.Add(modelPublication);
}
}
}
#endregion
#region Model Publication
public ISyntexModelPublicationResult PublishModel(IList library, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return PublishModelAsync(library, viewOption).GetAwaiter().GetResult();
}
public async Task<ISyntexModelPublicationResult> PublishModelAsync(IList library, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
// Ensure we have the needed data loaded
await (library as List).EnsurePropertiesAsync(p => p.RootFolder).ConfigureAwait(false);
await library.PnPContext.Web.EnsurePropertiesAsync(p => p.ServerRelativeUrl).ConfigureAwait(false);
return ProcessModelPublishResponse(await PublishModelApiRequestAsync(UniqueId,
library.PnPContext.Uri.AbsoluteUri.ToString(),
library.PnPContext.Web.ServerRelativeUrl,
library.RootFolder.ServerRelativeUrl,
viewOption).ConfigureAwait(false));
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(Batch batch, IList library, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
// Ensure we have the needed data loaded
await (library as List).EnsurePropertiesAsync(p => p.RootFolder).ConfigureAwait(false);
await library.PnPContext.Web.EnsurePropertiesAsync(p => p.ServerRelativeUrl).ConfigureAwait(false);
return await PublishModelBatchImplementationAsync(batch, UniqueId,
library.PnPContext.Uri.AbsoluteUri.ToString(),
library.PnPContext.Web.ServerRelativeUrl,
library.RootFolder.ServerRelativeUrl,
viewOption).ConfigureAwait(false);
}
private async Task<IBatchSingleResult<ISyntexModelPublicationResult>> PublishModelBatchImplementationAsync(Batch batch, Guid uniqueId, string targetSiteUrl, string targetWebServerRelativeUrl,
string targetLibraryServerRelativeUrl, MachineLearningPublicationViewOption viewOption)
{
System.Dynamic.ExpandoObject registerInfo = PublishModelApiRequestBody(uniqueId,
targetSiteUrl,
targetWebServerRelativeUrl,
targetLibraryServerRelativeUrl,
viewOption);
string body = JsonSerializer.Serialize(registerInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications", ApiType.SPORest, body)
{
RawSingleResult = new SyntexModelPublicationResult(),
RawResultsHandler = (json, apiCall) =>
{
List<SyntexModelPublicationResult> modelPublicationResults = ParseModelPublishResponse(json);
var firstModelPublicationResult = modelPublicationResults.First();
(apiCall.RawSingleResult as SyntexModelPublicationResult).ErrorMessage = firstModelPublicationResult.ErrorMessage;
(apiCall.RawSingleResult as SyntexModelPublicationResult).Publication = firstModelPublicationResult.Publication;
(apiCall.RawSingleResult as SyntexModelPublicationResult).StatusCode = firstModelPublicationResult.StatusCode;
}
};
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
return new BatchSingleResult<ISyntexModelPublicationResult>(batch, batchRequest.Id, apiCall.RawSingleResult as ISyntexModelPublicationResult);
}
public IBatchSingleResult<ISyntexModelPublicationResult> PublishModelBatch(Batch batch, IList library, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return PublishModelBatchAsync(batch, library, viewOption).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(IList library, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return await PublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, library, viewOption).ConfigureAwait(false);
}
public IBatchSingleResult<ISyntexModelPublicationResult> PublishModelBatch(IList library, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return PublishModelBatchAsync(library, viewOption).GetAwaiter().GetResult();
}
public async Task<List<ISyntexModelPublicationResult>> PublishModelAsync(List<IList> libraries, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
List<SyntexModelPublication> modelPublications = await BuildModelPublicationListAsync(libraries, viewOption).ConfigureAwait(false);
return ProcessModelPublishResponseMultiple(await PublishModelApiRequestAsync(modelPublications).ConfigureAwait(false));
}
private async Task<List<SyntexModelPublication>> BuildModelPublicationListAsync(List<IList> libraries, MachineLearningPublicationViewOption viewOption)
{
List<SyntexModelPublication> modelPublications = new List<SyntexModelPublication>();
foreach (var library in libraries)
{
await (library as List).EnsurePropertiesAsync(p => p.RootFolder).ConfigureAwait(false);
await library.PnPContext.Web.EnsurePropertiesAsync(p => p.ServerRelativeUrl).ConfigureAwait(false);
modelPublications.Add(new SyntexModelPublication()
{
ModelUniqueId = UniqueId,
TargetSiteUrl = library.PnPContext.Uri.AbsoluteUri.ToString(),
TargetWebServerRelativeUrl = library.PnPContext.Web.ServerRelativeUrl,
TargetLibraryServerRelativeUrl = library.RootFolder.ServerRelativeUrl,
ViewOption = viewOption
});
}
return modelPublications;
}
public List<ISyntexModelPublicationResult> PublishModel(List<IList> libraries, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return PublishModelAsync(libraries, viewOption).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(Batch batch, List<IList> libraries, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
List<SyntexModelPublication> modelPublications = await BuildModelPublicationListAsync(libraries, viewOption).ConfigureAwait(false);
return await PublishModelBatchImplementationAsync(batch, modelPublications).ConfigureAwait(false);
}
private async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> PublishModelBatchImplementationAsync(Batch batch, List<SyntexModelPublication> modelPublications)
{
System.Dynamic.ExpandoObject registerInfo = PublishModelApiRequestBody(modelPublications);
string body = JsonSerializer.Serialize(registerInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications", ApiType.SPORest, body)
{
RawEnumerableResult = new List<ISyntexModelPublicationResult>(),
RawResultsHandler = (json, apiCall) =>
{
(apiCall.RawEnumerableResult as List<ISyntexModelPublicationResult>).AddRange(ParseModelPublishResponse(json).Cast<ISyntexModelPublicationResult>());
}
};
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
return new BatchEnumerableBatchResult<ISyntexModelPublicationResult>(batch, batchRequest.Id, (IReadOnlyList<ISyntexModelPublicationResult>)apiCall.RawEnumerableResult);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> PublishModelBatch(Batch batch, List<IList> libraries, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return PublishModelBatchAsync(batch, libraries, viewOption).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(List<IList> libraries, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return await PublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, libraries, viewOption).ConfigureAwait(false);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> PublishModelBatch(List<IList> libraries, MachineLearningPublicationViewOption viewOption = MachineLearningPublicationViewOption.NewViewAsDefault)
{
return PublishModelBatchAsync(libraries, viewOption).GetAwaiter().GetResult();
}
public async Task<ISyntexModelPublicationResult> PublishModelAsync(SyntexModelPublishOptions publicationOptions)
{
return ProcessModelPublishResponse(await PublishModelApiRequestAsync(UniqueId,
publicationOptions.TargetSiteUrl,
publicationOptions.TargetWebServerRelativeUrl,
publicationOptions.TargetLibraryServerRelativeUrl,
publicationOptions.ViewOption).ConfigureAwait(false));
}
public ISyntexModelPublicationResult PublishModel(SyntexModelPublishOptions publicationOptions)
{
return PublishModelAsync(publicationOptions).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(Batch batch, SyntexModelPublishOptions publicationOptions)
{
return await PublishModelBatchImplementationAsync(batch, UniqueId,
publicationOptions.TargetSiteUrl,
publicationOptions.TargetWebServerRelativeUrl,
publicationOptions.TargetLibraryServerRelativeUrl,
publicationOptions.ViewOption).ConfigureAwait(false);
}
public IBatchSingleResult<ISyntexModelPublicationResult> PublishModelBatch(Batch batch, SyntexModelPublishOptions publicationOptions)
{
return PublishModelBatchAsync(batch, publicationOptions).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(SyntexModelPublishOptions publicationOptions)
{
return await PublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, publicationOptions).ConfigureAwait(false);
}
public IBatchSingleResult<ISyntexModelPublicationResult> PublishModelBatch(SyntexModelPublishOptions publicationOptions)
{
return PublishModelBatchAsync(publicationOptions).GetAwaiter().GetResult();
}
public async Task<List<ISyntexModelPublicationResult>> PublishModelAsync(List<SyntexModelPublishOptions> publicationOptions)
{
List<SyntexModelPublication> modelPublications = BuildModelPublicationList(publicationOptions);
return ProcessModelPublishResponseMultiple(await PublishModelApiRequestAsync(modelPublications).ConfigureAwait(false));
}
private List<SyntexModelPublication> BuildModelPublicationList(List<SyntexModelPublishOptions> publicationOptions)
{
List<SyntexModelPublication> modelPublications = new List<SyntexModelPublication>();
foreach (var publication in publicationOptions)
{
modelPublications.Add(new SyntexModelPublication()
{
ModelUniqueId = UniqueId,
TargetSiteUrl = publication.TargetSiteUrl,
TargetWebServerRelativeUrl = publication.TargetWebServerRelativeUrl,
TargetLibraryServerRelativeUrl = publication.TargetLibraryServerRelativeUrl,
ViewOption = publication.ViewOption
});
}
return modelPublications;
}
public List<ISyntexModelPublicationResult> PublishModel(List<SyntexModelPublishOptions> publicationOptions)
{
return PublishModelAsync(publicationOptions).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(Batch batch, List<SyntexModelPublishOptions> publicationOptions)
{
List<SyntexModelPublication> modelPublications = BuildModelPublicationList(publicationOptions);
return await PublishModelBatchImplementationAsync(batch, modelPublications).ConfigureAwait(false);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> PublishModelBatch(Batch batch, List<SyntexModelPublishOptions> publicationOptions)
{
return PublishModelBatchAsync(batch, publicationOptions).GetAwaiter().GetResult();
}
/// <summary>
/// Publish this model to a list of libraries
/// </summary>
/// <param name="publicationOptions">Information defining the model publications</param>
/// <returns>Information about the model publications</returns>
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> PublishModelBatchAsync(List<SyntexModelPublishOptions> publicationOptions)
{
return await PublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, publicationOptions).ConfigureAwait(false);
}
/// <summary>
/// Publish this model to a list of libraries
/// </summary>
/// <param name="publicationOptions">Information defining the model publications</param>
/// <returns>Information about the model publications</returns>
public IEnumerableBatchResult<ISyntexModelPublicationResult> PublishModelBatch(List<SyntexModelPublishOptions> publicationOptions)
{
return PublishModelBatchAsync(publicationOptions).GetAwaiter().GetResult();
}
private static ISyntexModelPublicationResult ProcessModelPublishResponse(ApiCallResponse response)
{
if (!string.IsNullOrEmpty(response.Json))
{
List<SyntexModelPublicationResult> modelPublicationResults = ParseModelPublishResponse(response.Json);
var modelPublicationResult = modelPublicationResults.FirstOrDefault();
if (modelPublicationResult is ISyntexModelPublicationResult syntexModelPublicationResult)
{
return syntexModelPublicationResult;
}
}
return null;
}
private static List<ISyntexModelPublicationResult> ProcessModelPublishResponseMultiple(ApiCallResponse response)
{
if (!string.IsNullOrEmpty(response.Json))
{
return ParseModelPublishResponse(response.Json).Cast<ISyntexModelPublicationResult>().ToList();
}
return null;
}
private static List<SyntexModelPublicationResult> ParseModelPublishResponse(string json)
{
var root = JsonSerializer.Deserialize<JsonElement>(json).GetProperty("Details");
var modelPublicationResults = DeserializeModelPublishResult(root.ToString());
return modelPublicationResults;
}
private async Task<ApiCallResponse> PublishModelApiRequestAsync(Guid uniqueId, string targetSiteUrl, string targetWebServerRelativeUrl,
string targetLibraryServerRelativeUrl, MachineLearningPublicationViewOption viewOption)
{
System.Dynamic.ExpandoObject registerInfo = PublishModelApiRequestBody(uniqueId, targetSiteUrl, targetWebServerRelativeUrl, targetLibraryServerRelativeUrl, viewOption);
return await PublishModelApiCallAsync(registerInfo).ConfigureAwait(false);
}
private static System.Dynamic.ExpandoObject PublishModelApiRequestBody(Guid uniqueId, string targetSiteUrl, string targetWebServerRelativeUrl, string targetLibraryServerRelativeUrl, MachineLearningPublicationViewOption viewOption)
{
/*
{
"__metadata": {
"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationsEntityData"
},
"Publications": {
"results": [
{
"ModelUniqueId": "bb25a5be-aeed-436d-90e7-add975ac766e",
"TargetSiteUrl": "https://m365x215748.sharepoint.com/sites/Mark8ProjectTeam",
"TargetWebServerRelativeUrl": "/sites/Mark8ProjectTeam",
"TargetLibraryServerRelativeUrl": "/sites/Mark8ProjectTeam/Shared Documents",
"ViewOption": "NewViewAsDefault"
}
]
},
"Comment": ""
}
*/
return new
{
__metadata = new { type = "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationsEntityData" },
Publications = new
{
results = new List<SyntexModelPublication>()
{
new SyntexModelPublication()
{
ModelUniqueId = uniqueId,
TargetSiteUrl = targetSiteUrl,
TargetWebServerRelativeUrl = targetWebServerRelativeUrl,
TargetLibraryServerRelativeUrl = targetLibraryServerRelativeUrl,
ViewOption = viewOption
}
}
},
Comment = ""
}.AsExpando();
}
private async Task<ApiCallResponse> PublishModelApiRequestAsync(List<SyntexModelPublication> modelPublications)
{
System.Dynamic.ExpandoObject registerInfo = PublishModelApiRequestBody(modelPublications);
return await PublishModelApiCallAsync(registerInfo).ConfigureAwait(false);
}
private static System.Dynamic.ExpandoObject PublishModelApiRequestBody(List<SyntexModelPublication> modelPublications)
{
return new
{
__metadata = new { type = "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationsEntityData" },
Publications = new
{
results = modelPublications
},
Comment = ""
}.AsExpando();
}
private async Task<ApiCallResponse> PublishModelApiCallAsync(System.Dynamic.ExpandoObject registerInfo)
{
string body = JsonSerializer.Serialize(registerInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications", ApiType.SPORest, body);
return await (ListItem as ListItem).RawRequestAsync(apiCall, HttpMethod.Post).ConfigureAwait(false);
}
#endregion
#region Model unpublication
public async Task<ISyntexModelPublicationResult> UnPublishModelAsync(IList library)
{
// Ensure we have the needed data loaded
await (library as List).EnsurePropertiesAsync(p => p.RootFolder).ConfigureAwait(false);
await library.PnPContext.Web.EnsurePropertiesAsync(p => p.ServerRelativeUrl).ConfigureAwait(false);
return ProcessModelPublishResponse(await UnPublishModelApiRequestAsync(UniqueId,
library.PnPContext.Uri.AbsoluteUri.ToString(),
library.PnPContext.Web.ServerRelativeUrl,
library.RootFolder.ServerRelativeUrl).ConfigureAwait(false));
}
public ISyntexModelPublicationResult UnPublishModel(IList library)
{
return UnPublishModelAsync(library).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(Batch batch, IList library)
{
// Ensure we have the needed data loaded
await (library as List).EnsurePropertiesAsync(p => p.RootFolder).ConfigureAwait(false);
await library.PnPContext.Web.EnsurePropertiesAsync(p => p.ServerRelativeUrl).ConfigureAwait(false);
System.Dynamic.ExpandoObject unPublishInfo = UnPublishModelApiRequestBody(UniqueId,
library.PnPContext.Uri.AbsoluteUri.ToString(),
library.PnPContext.Web.ServerRelativeUrl,
library.RootFolder.ServerRelativeUrl);
string body = JsonSerializer.Serialize(unPublishInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications/batchdelete", ApiType.SPORest, body)
{
RawSingleResult = new SyntexModelPublicationResult(),
RawResultsHandler = (json, apiCall) =>
{
List<SyntexModelPublicationResult> modelPublicationResults = ParseModelPublishResponse(json);
var firstModelPublicationResult = modelPublicationResults.First();
(apiCall.RawSingleResult as SyntexModelPublicationResult).ErrorMessage = firstModelPublicationResult.ErrorMessage;
(apiCall.RawSingleResult as SyntexModelPublicationResult).Publication = firstModelPublicationResult.Publication;
(apiCall.RawSingleResult as SyntexModelPublicationResult).StatusCode = firstModelPublicationResult.StatusCode;
}
};
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
return new BatchSingleResult<ISyntexModelPublicationResult>(batch, batchRequest.Id, apiCall.RawSingleResult as ISyntexModelPublicationResult);
}
public IBatchSingleResult<ISyntexModelPublicationResult> UnPublishModelBatch(Batch batch, IList library)
{
return UnPublishModelBatchAsync(batch, library).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(IList library)
{
return await UnPublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, library).ConfigureAwait(false);
}
public IBatchSingleResult<ISyntexModelPublicationResult> UnPublishModelBatch(IList library)
{
return UnPublishModelBatchAsync(library).GetAwaiter().GetResult();
}
public async Task<List<ISyntexModelPublicationResult>> UnPublishModelAsync(List<IList> libraries)
{
List<SyntexModelPublication> modelUnPublications = await BuildModelUnPublicationListAsync(libraries).ConfigureAwait(false);
return ProcessModelPublishResponseMultiple(await UnPublishModelApiRequestAsync(modelUnPublications).ConfigureAwait(false));
}
private async Task<List<SyntexModelPublication>> BuildModelUnPublicationListAsync(List<IList> libraries)
{
List<SyntexModelPublication> modelPublications = new List<SyntexModelPublication>();
foreach (var library in libraries)
{
await (library as List).EnsurePropertiesAsync(p => p.RootFolder).ConfigureAwait(false);
await library.PnPContext.Web.EnsurePropertiesAsync(p => p.ServerRelativeUrl).ConfigureAwait(false);
modelPublications.Add(new SyntexModelPublication()
{
ModelUniqueId = UniqueId,
TargetSiteUrl = library.PnPContext.Uri.AbsoluteUri.ToString(),
TargetWebServerRelativeUrl = library.PnPContext.Web.ServerRelativeUrl,
TargetLibraryServerRelativeUrl = library.RootFolder.ServerRelativeUrl
});
}
return modelPublications;
}
public List<ISyntexModelPublicationResult> UnPublishModel(List<IList> libraries)
{
return UnPublishModelAsync(libraries).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(Batch batch, List<IList> libraries)
{
List<SyntexModelPublication> modelUnPublications = await BuildModelUnPublicationListAsync(libraries).ConfigureAwait(false);
var unPublishInfo = new
{
publications = modelUnPublications
}.AsExpando();
string body = JsonSerializer.Serialize(unPublishInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications/batchdelete", ApiType.SPORest, body)
{
RawEnumerableResult = new List<ISyntexModelPublicationResult>(),
RawResultsHandler = (json, apiCall) =>
{
(apiCall.RawEnumerableResult as List<ISyntexModelPublicationResult>).AddRange(ParseModelPublishResponse(json).Cast<ISyntexModelPublicationResult>());
}
};
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
return new BatchEnumerableBatchResult<ISyntexModelPublicationResult>(batch, batchRequest.Id, (IReadOnlyList<ISyntexModelPublicationResult>)apiCall.RawEnumerableResult);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> UnPublishModelBatch(Batch batch, List<IList> libraries)
{
return UnPublishModelBatchAsync(batch, libraries).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(List<IList> libraries)
{
return await UnPublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, libraries).ConfigureAwait(false);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> UnPublishModelBatch(List<IList> libraries)
{
return UnPublishModelBatchAsync(libraries).GetAwaiter().GetResult();
}
public async Task<ISyntexModelPublicationResult> UnPublishModelAsync(SyntexModelUnPublishOptions unPublicationOptions)
{
return ProcessModelPublishResponse(await UnPublishModelApiRequestAsync(UniqueId,
unPublicationOptions.TargetSiteUrl,
unPublicationOptions.TargetWebServerRelativeUrl,
unPublicationOptions.TargetLibraryServerRelativeUrl).ConfigureAwait(false));
}
public ISyntexModelPublicationResult UnPublishModel(SyntexModelUnPublishOptions unPublicationOptions)
{
return UnPublishModelAsync(unPublicationOptions).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(Batch batch, SyntexModelUnPublishOptions unPublicationOptions)
{
System.Dynamic.ExpandoObject unPublishInfo = UnPublishModelApiRequestBody(UniqueId, unPublicationOptions.TargetSiteUrl,
unPublicationOptions.TargetWebServerRelativeUrl,
unPublicationOptions.TargetLibraryServerRelativeUrl);
string body = JsonSerializer.Serialize(unPublishInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications/batchdelete", ApiType.SPORest, body)
{
RawSingleResult = new SyntexModelPublicationResult(),
RawResultsHandler = (json, apiCall) =>
{
List<SyntexModelPublicationResult> modelPublicationResults = ParseModelPublishResponse(json);
var firstModelPublicationResult = modelPublicationResults.First();
(apiCall.RawSingleResult as SyntexModelPublicationResult).ErrorMessage = firstModelPublicationResult.ErrorMessage;
(apiCall.RawSingleResult as SyntexModelPublicationResult).Publication = firstModelPublicationResult.Publication;
(apiCall.RawSingleResult as SyntexModelPublicationResult).StatusCode = firstModelPublicationResult.StatusCode;
}
};
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
return new BatchSingleResult<ISyntexModelPublicationResult>(batch, batchRequest.Id, apiCall.RawSingleResult as ISyntexModelPublicationResult);
}
public IBatchSingleResult<ISyntexModelPublicationResult> UnPublishModelBatch(Batch batch, SyntexModelUnPublishOptions unPublicationOptions)
{
return UnPublishModelBatchAsync(batch, unPublicationOptions).GetAwaiter().GetResult();
}
public async Task<IBatchSingleResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(SyntexModelUnPublishOptions unPublicationOptions)
{
return await UnPublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, unPublicationOptions).ConfigureAwait(false);
}
public IBatchSingleResult<ISyntexModelPublicationResult> UnPublishModelBatch(SyntexModelUnPublishOptions unPublicationOptions)
{
return UnPublishModelBatchAsync(unPublicationOptions).GetAwaiter().GetResult();
}
public async Task<List<ISyntexModelPublicationResult>> UnPublishModelAsync(List<SyntexModelUnPublishOptions> unPublicationOptions)
{
List<SyntexModelPublication> modelUnPublications = BuildModelUnPublishList(unPublicationOptions);
return ProcessModelPublishResponseMultiple(await UnPublishModelApiRequestAsync(modelUnPublications).ConfigureAwait(false));
}
private List<SyntexModelPublication> BuildModelUnPublishList(List<SyntexModelUnPublishOptions> unPublicationOptions)
{
List<SyntexModelPublication> modelPublications = new List<SyntexModelPublication>();
foreach (var publication in unPublicationOptions)
{
modelPublications.Add(new SyntexModelPublication()
{
ModelUniqueId = UniqueId,
TargetSiteUrl = publication.TargetSiteUrl,
TargetWebServerRelativeUrl = publication.TargetWebServerRelativeUrl,
TargetLibraryServerRelativeUrl = publication.TargetLibraryServerRelativeUrl,
});
}
return modelPublications;
}
public List<ISyntexModelPublicationResult> UnPublishModel(List<SyntexModelUnPublishOptions> unPublicationOptions)
{
return UnPublishModelAsync(unPublicationOptions).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(Batch batch, List<SyntexModelUnPublishOptions> unPublicationOptions)
{
List<SyntexModelPublication> modelUnPublications = BuildModelUnPublishList(unPublicationOptions);
var unPublishInfo = new
{
publications = modelUnPublications
}.AsExpando();
string body = JsonSerializer.Serialize(unPublishInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications/batchdelete", ApiType.SPORest, body)
{
RawEnumerableResult = new List<ISyntexModelPublicationResult>(),
RawResultsHandler = (json, apiCall) =>
{
(apiCall.RawEnumerableResult as List<ISyntexModelPublicationResult>).AddRange(ParseModelPublishResponse(json).Cast<ISyntexModelPublicationResult>());
}
};
var batchRequest = await (ListItem as ListItem).RawRequestBatchAsync(batch, apiCall, HttpMethod.Post).ConfigureAwait(false);
return new BatchEnumerableBatchResult<ISyntexModelPublicationResult>(batch, batchRequest.Id, (IReadOnlyList<ISyntexModelPublicationResult>)apiCall.RawEnumerableResult);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> UnPublishModelBatch(Batch batch, List<SyntexModelUnPublishOptions> unPublicationOptions)
{
return UnPublishModelBatchAsync(batch, unPublicationOptions).GetAwaiter().GetResult();
}
public async Task<IEnumerableBatchResult<ISyntexModelPublicationResult>> UnPublishModelBatchAsync(List<SyntexModelUnPublishOptions> unPublicationOptions)
{
return await UnPublishModelBatchAsync((ListItem as ListItem).PnPContext.CurrentBatch, unPublicationOptions).ConfigureAwait(false);
}
public IEnumerableBatchResult<ISyntexModelPublicationResult> UnPublishModelBatch(List<SyntexModelUnPublishOptions> unPublicationOptions)
{
return UnPublishModelBatchAsync(unPublicationOptions).GetAwaiter().GetResult();
}
private async Task<ApiCallResponse> UnPublishModelApiRequestAsync(Guid uniqueId, string targetSiteUrl, string targetWebServerRelativeUrl,
string targetLibraryServerRelativeUrl)
{
System.Dynamic.ExpandoObject unPublishInfo = UnPublishModelApiRequestBody(uniqueId, targetSiteUrl, targetWebServerRelativeUrl, targetLibraryServerRelativeUrl);
return await UnPublishModelApiCallAsync(unPublishInfo).ConfigureAwait(false);
}
private static System.Dynamic.ExpandoObject UnPublishModelApiRequestBody(Guid uniqueId, string targetSiteUrl, string targetWebServerRelativeUrl, string targetLibraryServerRelativeUrl)
{
/*
{
"publications": [
{
"ModelUniqueId": "bb25a5be-aeed-436d-90e7-add975ac766e",
"TargetSiteUrl": "https://m365x215748.sharepoint.com/sites/AdminContentCenter",
"TargetWebServerRelativeUrl": "/sites/AdminContentCenter",
"TargetLibraryServerRelativeUrl": "/sites/AdminContentCenter/PNP_SDK_TEST_RegisterModelToList"
}
]
}
*/
return new
{
publications = new List<SyntexModelPublication>()
{
new SyntexModelPublication()
{
ModelUniqueId = uniqueId,
TargetSiteUrl = targetSiteUrl,
TargetWebServerRelativeUrl = targetWebServerRelativeUrl,
TargetLibraryServerRelativeUrl = targetLibraryServerRelativeUrl,
}
}
}.AsExpando();
}
private async Task<ApiCallResponse> UnPublishModelApiRequestAsync(List<SyntexModelPublication> modelUnPublications)
{
var unPublishInfo = new
{
publications = modelUnPublications
}.AsExpando();
return await UnPublishModelApiCallAsync(unPublishInfo).ConfigureAwait(false);
}
private async Task<ApiCallResponse> UnPublishModelApiCallAsync(System.Dynamic.ExpandoObject unPublishInfo)
{
string body = JsonSerializer.Serialize(unPublishInfo, PnPConstants.JsonSerializer_IgnoreNullValues_StringEnumConvertor);
var apiCall = new ApiCall("_api/machinelearning/publications/batchdelete", ApiType.SPORest, body);
return await (ListItem as ListItem).RawRequestAsync(apiCall, HttpMethod.Post).ConfigureAwait(false);
}
private static List<SyntexModelPublicationResult> DeserializeModelPublishResult(string jsonString)
{
/* Response:
{
"d": {
"__metadata": {
"id": "https://m365x215748.sharepoint.com/sites/AdminContentCenter/_api/machinelearning/publications",
"uri": "https://m365x215748.sharepoint.com/sites/AdminContentCenter/_api/machinelearning/publications",
"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationsResult"
},
"Details": {
"__metadata": {
"type": "Collection(Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationResult)"
},
"results": [
{
"ErrorMessage": null,
"Publication": {
"__metadata": {
"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationEntityData"
},
"ModelUniqueId": "bb25a5be-aeed-436d-90e7-add975ac766e",
"TargetLibraryServerRelativeUrl": "/sites/AdminContentCenter/PNP_SDK_TEST_RegisterModelToList",
"TargetSiteUrl": "https://m365x215748.sharepoint.com/sites/AdminContentCenter",
"TargetWebServerRelativeUrl": "/sites/AdminContentCenter",
"ViewOption": "NewViewAsDefault"
},
"StatusCode": 201
}
]
},
"TotalFailures": 0,
"TotalSuccesses": 1
}
}
*/
List<SyntexModelPublicationResult> results = new List<SyntexModelPublicationResult>();
var json = JsonSerializer.Deserialize<JsonElement>(jsonString);
if (json.ValueKind == JsonValueKind.Array)
{
foreach (var publicationResultJson in json.EnumerateArray())
{
var publicationResult = new SyntexModelPublicationResult
{
ErrorMessage = publicationResultJson.GetProperty("ErrorMessage").GetString(),
StatusCode = publicationResultJson.GetProperty("StatusCode").GetInt32(),
};
if (publicationResultJson.TryGetProperty("Publication", out JsonElement publicationJson))
{
publicationResult.Publication = new SyntexModelPublication
{
ModelUniqueId = publicationJson.GetProperty("ModelUniqueId").GetGuid(),
TargetLibraryServerRelativeUrl = publicationJson.GetProperty("TargetLibraryServerRelativeUrl").GetString(),
TargetWebServerRelativeUrl = publicationJson.GetProperty("TargetWebServerRelativeUrl").GetString(),
TargetSiteUrl = publicationJson.GetProperty("TargetSiteUrl").ToString(),
ViewOption = (MachineLearningPublicationViewOption)Enum.Parse(typeof(MachineLearningPublicationViewOption), publicationJson.GetProperty("ViewOption").ToString())
};
}
results.Add(publicationResult);
}
}
return results;
}
#endregion
#endregion
}
}
| 52.957377 | 244 | 0.637981 | [
"MIT"
] | MathijsVerbeeck/pnpcore | src/sdk/PnP.Core/Model/SharePoint/Syntex/Internal/SyntexModel.cs | 48,458 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace xdef.net.Utils
{
public static class BigEndianBitConverter
{
public static byte[] GetBytes(bool value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(char value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(double value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(short value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(int value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(long value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(float value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(ushort value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(uint value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(ulong value)
{
return BitConverter.GetBytes(value).Reverse().ToArray();
}
public static byte[] GetBytes(string value)
{
var data = Encoding.UTF8.GetBytes(value);
return GetBytes(data.Length).Concat(data).ToArray();
}
public static bool ToBoolean(byte[] value, int startIndex)
{
return BitConverter.ToBoolean(value, startIndex);
}
public static char ToChar(byte[] value, int startIndex)
{
return BitConverter.ToChar(value, startIndex);
}
public static double ToDouble(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(8).Reverse().ToArray();
return BitConverter.ToDouble(bytes, 0);
}
public static short ToInt16(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(2).Reverse().ToArray();
return BitConverter.ToInt16(bytes, 0);
}
public static int ToInt32(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(4).Reverse().ToArray();
return BitConverter.ToInt32(bytes, 0);
}
public static long ToInt64(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(8).Reverse().ToArray();
return BitConverter.ToInt64(bytes, 0);
}
public static float ToSingle(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(4).Reverse().ToArray();
return BitConverter.ToSingle(bytes, 0);
}
public static ushort ToUInt16(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(2).Reverse().ToArray();
return BitConverter.ToUInt16(bytes, 0);
}
public static uint ToUInt32(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(4).Reverse().ToArray();
return BitConverter.ToUInt32(bytes, 0);
}
public static ulong ToUInt64(byte[] value, int startIndex)
{
var bytes = value.Skip(startIndex).Take(8).Reverse().ToArray();
return BitConverter.ToUInt64(bytes, 0);
}
}
}
| 35.214953 | 75 | 0.580414 | [
"Apache-2.0"
] | adameste/xdef.net | xdef.net/xdef.net/Utils/BigEndianBitConverter.cs | 3,770 | C# |
using System;
using System.Diagnostics;
using WindowsDesktop.Interop;
namespace WindowsDesktop
{
public static class VirtualDesktopHelper
{
internal static void ThrowIfNotSupported()
{
if (!VirtualDesktop.IsSupported)
{
throw new NotSupportedException("Need to include the app manifest in your project so as to target Windows 10. And, run without debugging.");
}
}
public static bool IsCurrentVirtualDesktop(IntPtr handle)
{
ThrowIfNotSupported();
return ComObjects.VirtualDesktopManager.IsWindowOnCurrentVirtualDesktop(handle);
}
public static void MoveToDesktop(IntPtr hWnd, VirtualDesktop virtualDesktop)
{
Console.WriteLine("MoveToDesktop 1");
ThrowIfNotSupported();
Console.WriteLine("MoveToDesktop 2");
int processId;
NativeMethods.GetWindowThreadProcessId(hWnd, out processId);
Console.WriteLine("MoveToDesktop 3");
if (Process.GetCurrentProcess().Id == processId)
{
Console.WriteLine("MoveToDesktop 4.1");
var guid = virtualDesktop.Id;
ComObjects.VirtualDesktopManager.MoveWindowToDesktop(hWnd, ref guid);
Console.WriteLine("MoveToDesktop 4.2");
}
else
{
Console.WriteLine("MoveToDesktop 5.1");
try
{
Console.WriteLine("MoveToDesktop 5.2");
IntPtr view;
Console.WriteLine("MoveToDesktop 5.3");
ComObjects.ApplicationViewCollection.GetViewForHwnd(hWnd, out view);
Console.WriteLine("MoveToDesktop 5.4");
ComObjects.VirtualDesktopManagerInternal.MoveViewToDesktop(view, virtualDesktop.ComObject);
Console.WriteLine("MoveToDesktop 5.5");
}
catch (System.Runtime.InteropServices.COMException ex)
{
Console.WriteLine("MoveToDesktop 6.1");
if (ex.Match(HResult.TYPE_E_ELEMENTNOTFOUND))
{
Console.WriteLine("MoveToDesktop 6.2");
throw new ArgumentException("hWnd");
}
Console.WriteLine("MoveToDesktop 6.3");
throw;
}
}
}
public static bool IsPinnedWindow(IntPtr hWnd)
{
ThrowIfNotSupported();
var view = hWnd.GetApplicationView();
if (view == IntPtr.Zero)
{
throw new ArgumentException("hWnd");
}
return ComObjects.VirtualDesktopPinnedApps.IsViewPinned(view);
}
public static void PinWindow(IntPtr hWnd)
{
ThrowIfNotSupported();
var view = hWnd.GetApplicationView();
if (view == IntPtr.Zero)
{
throw new ArgumentException("hWnd");
}
if (!ComObjects.VirtualDesktopPinnedApps.IsViewPinned(view))
{
ComObjects.VirtualDesktopPinnedApps.PinView(view);
}
}
public static void UnpinWindow(IntPtr hWnd)
{
ThrowIfNotSupported();
var view = hWnd.GetApplicationView();
if (view == IntPtr.Zero)
{
throw new ArgumentException("hWnd");
}
if (ComObjects.VirtualDesktopPinnedApps.IsViewPinned(view))
{
ComObjects.VirtualDesktopPinnedApps.UnpinView(view);
}
}
public static void TogglePinWindow(IntPtr hWnd)
{
ThrowIfNotSupported();
var view = hWnd.GetApplicationView();
if (view == IntPtr.Zero)
{
throw new ArgumentException("hWnd");
}
if (ComObjects.VirtualDesktopPinnedApps.IsViewPinned(view))
{
ComObjects.VirtualDesktopPinnedApps.UnpinView(view);
}
else
{
ComObjects.VirtualDesktopPinnedApps.PinView(view);
}
}
private static IntPtr GetApplicationView(this IntPtr hWnd)
{
try
{
IntPtr view;
ComObjects.ApplicationViewCollection.GetViewForHwnd(hWnd, out view);
return view;
}
catch (System.Runtime.InteropServices.COMException ex)
{
if (ex.Match(HResult.TYPE_E_ELEMENTNOTFOUND))
return IntPtr.Zero;
throw;
}
}
}
}
| 24.429487 | 145 | 0.670428 | [
"MIT"
] | nathannelson97/VirtualDesktopGridSwitcher | VirtualDesktop-master/source/VirtualDesktop/VirtualDesktopHelper.cs | 3,813 | C# |
using System;
using Newtonsoft.Json;
using System.Xml.Serialization;
namespace Essensoft.AspNetCore.Payment.Alipay.Domain
{
/// <summary>
/// MybankCreditProdarrangementContracttextQueryModel Data Structure.
/// </summary>
[Serializable]
public class MybankCreditProdarrangementContracttextQueryModel : AlipayObject
{
/// <summary>
/// 业务编号,例如合约编号,贷款申请编号等
/// </summary>
[JsonProperty("bsn_no")]
[XmlElement("bsn_no")]
public string BsnNo { get; set; }
/// <summary>
/// 合同类型,枚举如下:LOAN:贷款合同类型,PRE_LOAN_INVESTIGATION : 贷前调查征信授权合同, POST_LOAN_MANAGEMENT : 贷后管理征信授权合同;
/// </summary>
[JsonProperty("contract_type")]
[XmlElement("contract_type")]
public string ContractType { get; set; }
/// <summary>
/// 查询场景类型,例如根据业务单据号或者合约号来查询; 枚举如下:AR_NO:合约类型,BSN_NO:业务场景
/// </summary>
[JsonProperty("query_type")]
[XmlElement("query_type")]
public string QueryType { get; set; }
}
}
| 29.828571 | 105 | 0.625479 | [
"MIT"
] | Aosir/Payment | src/Essensoft.AspNetCore.Payment.Alipay/Domain/MybankCreditProdarrangementContracttextQueryModel.cs | 1,242 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Text;
using Microsoft.CodeAnalysis.Scripting.Hosting;
namespace Microsoft.CodeAnalysis.Scripting.Test
{
internal sealed class TestConsoleIO : ConsoleIO
{
public TestConsoleIO(string input)
: this(new Reader(input))
{
}
private TestConsoleIO(Reader reader)
: base(output: new Writer(reader), error: new StringWriter(), input: reader)
{
}
public override ConsoleColor ForegroundColor
{
get
{
return ((Writer)Out).CurrentColor;
}
set
{
((Writer)Out).CurrentColor = value;
}
}
private sealed class Reader : StringReader
{
public readonly StringBuilder ContentRead = new StringBuilder();
public Reader(string input)
: base(input)
{
}
public override string ReadLine()
{
string result = base.ReadLine();
ContentRead.AppendLine(result);
return result;
}
}
private sealed class Writer : StringWriter
{
private ConsoleColor _lastColor = ConsoleColor.Gray;
public ConsoleColor CurrentColor = ConsoleColor.Gray;
public override Encoding Encoding => Encoding.UTF8;
private readonly Reader _reader;
public Writer(Reader reader)
{
_reader = reader;
}
private void OnBeforeWrite()
{
if (_reader.ContentRead.Length > 0)
{
base.Write(_reader.ContentRead.ToString());
_reader.ContentRead.Clear();
}
if (_lastColor != CurrentColor)
{
base.WriteLine($"«{CurrentColor}»");
_lastColor = CurrentColor;
}
}
public override void Write(char value)
{
OnBeforeWrite();
base.Write(value);
}
public override void Write(string value)
{
OnBeforeWrite();
base.Write(value);
}
public override void WriteLine(string value)
{
OnBeforeWrite();
base.WriteLine(value);
}
public override void WriteLine()
{
OnBeforeWrite();
base.WriteLine();
}
}
}
}
| 26.895238 | 161 | 0.493626 | [
"Apache-2.0"
] | aanshibudhiraja/Roslyn | src/Scripting/CoreTest/TestConsoleIO.cs | 2,828 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleCalculator
{
public interface IOperationData
{
Char Symbol { get; }
}
}
| 15.428571 | 33 | 0.75 | [
"MIT"
] | kenwilcox/SimpleCalculator | SimpleCalculator/Interfaces/IOperationData.cs | 218 | C# |
using Windows.UI.Xaml;
namespace TrackMe.WinPhoneUniversalNative.Converters
{
public sealed class BooleanToVisibilityConverter : BooleanConverter<Visibility>
{
public BooleanToVisibilityConverter() :
base(Visibility.Visible, Visibility.Collapsed)
{ }
}
} | 26.909091 | 83 | 0.716216 | [
"MIT"
] | PGSSoft/TrackMe-Mobile | TrackMe.WinPhoneUniversalNative/Converters/BooleanToVisibilityConverter.cs | 298 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using EIva.Algorithms.Utils;
using Tree;
namespace Trae
{
/// <summary>
/// Lexical frequency counter tree.
/// </summary>
public class Trae<TChar> : ITree<TChar, uint> where TChar : IEquatable<TChar>, IComparable<TChar>
{
private readonly IDictionary<TChar, Trae<TChar>> _child = new Dictionary<TChar, Trae<TChar>>();
public Trae<TChar> this[TChar charecter]
{
get { return _child[charecter]; }
set { _child[charecter] = value; }
}
public IEnumerable<TChar> Keys => _child.Keys;
ITree<TChar, uint> ITree<TChar, uint>.this[TChar charecter]
{
get { return this[charecter]; }
set { this[charecter] = (Trae<TChar>) value; }
}
public uint Value { get; set; }
public void Apply(IEnumerable<TChar> word)
{
++Value;
if (word.Any())
{
var node = _child.GetOrCreate(word.First());
node.Apply(word.Skip(1));
}
}
}
} | 27.904762 | 104 | 0.533276 | [
"MIT"
] | eiva/Algorithms | EIva.Algorithms/Trae/Contract.cs | 1,174 | C# |
namespace RSToolkit.UI.Controls
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using RSToolkit.Controls;
using UnityEngine.Events;
[RequireComponent(typeof(Text))]
public class UICountDownText : CountDown
{
private Text _textComponent;
// Start is called before the first frame update
protected sealed override void Start()
{
base.Start();
OnStart.AddListener(updateText);
OnTick.AddListener(updateText);
OnReset.AddListener(updateText);
ResetCountdown();
}
protected sealed override void Awake()
{
base.Awake();
_textComponent = this.GetComponent<Text>();
}
void updateText(){
_textComponent.text = Count.ToString();
}
}
} | 26 | 57 | 0.575855 | [
"MIT"
] | richardschembri/UnityRSToolk | UnityRSToolkit/Assets/RSToolKit/Scripts/UI/Controls/UICountDownText.cs | 938 | C# |
using System.Text;
using Exceptionless.Core.Models.Data;
using Newtonsoft.Json;
namespace Exceptionless.Core.Extensions;
public static class RequestInfoExtensions {
public static RequestInfo ApplyDataExclusions(this RequestInfo request, IList<string> exclusions, int maxLength = 1000) {
if (request == null)
return null;
request.Cookies = ApplyExclusions(request.Cookies, exclusions, maxLength);
request.QueryString = ApplyExclusions(request.QueryString, exclusions, maxLength);
request.PostData = ApplyPostDataExclusions(request.PostData, exclusions, maxLength);
return request;
}
private static object ApplyPostDataExclusions(object data, IEnumerable<string> exclusions, int maxLength) {
if (data == null)
return null;
var dictionary = data as Dictionary<string, string>;
if (dictionary == null && data is string) {
string json = (string)data;
if (!json.IsJson())
return data;
try {
dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
}
catch (Exception) { }
}
return dictionary != null ? ApplyExclusions(dictionary, exclusions, maxLength) : data;
}
private static Dictionary<string, string> ApplyExclusions(Dictionary<string, string> dictionary, IEnumerable<string> exclusions, int maxLength) {
if (dictionary == null || dictionary.Count == 0)
return dictionary;
foreach (string key in dictionary.Keys.Where(k => String.IsNullOrEmpty(k) || StringExtensions.AnyWildcardMatches(k, exclusions, true)).ToList())
dictionary.Remove(key);
foreach (string key in dictionary.Where(kvp => kvp.Value != null && kvp.Value.Length > maxLength).Select(kvp => kvp.Key).ToList())
dictionary[key] = String.Format("Value is too large to be included.");
return dictionary;
}
/// <summary>
/// The full path for the request including host, path and query String.
/// </summary>
public static string GetFullPath(this RequestInfo requestInfo, bool includeHttpMethod = false, bool includeHost = true, bool includeQueryString = true) {
var sb = new StringBuilder();
if (includeHttpMethod)
sb.Append(requestInfo.HttpMethod).Append(" ");
if (includeHost) {
sb.Append(requestInfo.IsSecure ? "https://" : "http://");
sb.Append(requestInfo.Host);
if (requestInfo.Port != 80 && requestInfo.Port != 443)
sb.Append(":").Append(requestInfo.Port);
}
if (!requestInfo.Path.StartsWith("/"))
sb.Append("/");
sb.Append(requestInfo.Path);
if (includeQueryString && requestInfo.QueryString != null && requestInfo.QueryString.Count > 0)
sb.Append("?").Append(CreateQueryString(requestInfo.QueryString));
return sb.ToString();
}
private static string CreateQueryString(IEnumerable<KeyValuePair<string, string>> args) {
if (args == null)
return String.Empty;
if (!args.Any())
return String.Empty;
var sb = new StringBuilder(args.Count() * 10);
foreach (var p in args) {
if (String.IsNullOrEmpty(p.Key) && p.Value == null)
continue;
if (!String.IsNullOrEmpty(p.Key)) {
sb.Append(Uri.EscapeDataString(p.Key));
sb.Append('=');
}
if (p.Value != null)
sb.Append(p.Value);
sb.Append('&');
}
sb.Length--; // remove trailing &
return sb.ToString();
}
}
| 36.184466 | 157 | 0.611215 | [
"Apache-2.0"
] | 491134648/Exceptionless | src/Exceptionless.Core/Extensions/RequestInfoExtensions.cs | 3,729 | C# |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using osu.Game.Online.Chat;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Chat
{
public class ChatLine : CompositeDrawable
{
public const float LEFT_PADDING = default_message_padding + default_horizontal_padding * 2;
private const float default_message_padding = 200;
protected virtual float MessagePadding => default_message_padding;
private const float default_timestamp_padding = 65;
protected virtual float TimestampPadding => default_timestamp_padding;
private const float default_horizontal_padding = 15;
protected virtual float HorizontalPadding => default_horizontal_padding;
protected virtual float TextSize => 20;
private Color4 customUsernameColour;
private OsuSpriteText timestamp;
public ChatLine(Message message)
{
Message = message;
Padding = new MarginPadding { Left = HorizontalPadding, Right = HorizontalPadding };
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
}
[Resolved(CanBeNull = true)]
private ChannelManager chatManager { get; set; }
private Message message;
private OsuSpriteText username;
public LinkFlowContainer ContentFlow { get; private set; }
public Message Message
{
get => message;
set
{
if (message == value) return;
message = MessageFormatter.FormatMessage(value);
if (!IsLoaded)
return;
updateMessageContent();
}
}
private bool senderHasBackground => !string.IsNullOrEmpty(message.Sender.Colour);
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
customUsernameColour = colours.ChatBlue;
bool hasBackground = senderHasBackground;
Drawable effectedUsername = username = new OsuSpriteText
{
Shadow = false,
Colour = hasBackground ? customUsernameColour : username_colours[message.Sender.Id % username_colours.Length],
Truncate = true,
EllipsisString = "… :",
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true),
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
MaxWidth = MessagePadding - TimestampPadding
};
if (hasBackground)
{
// Background effect
effectedUsername = new Container
{
AutoSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 4,
EdgeEffect = new EdgeEffectParameters
{
Roundness = 1,
Offset = new Vector2(0, 3),
Radius = 3,
Colour = Color4.Black.Opacity(0.3f),
Type = EdgeEffectType.Shadow,
},
// Drop shadow effect
Child = new Container
{
AutoSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 4,
EdgeEffect = new EdgeEffectParameters
{
Radius = 1,
Colour = Color4Extensions.FromHex(message.Sender.Colour),
Type = EdgeEffectType.Shadow,
},
Padding = new MarginPadding { Left = 3, Right = 3, Bottom = 1, Top = -3 },
Y = 3,
Child = username,
}
};
}
InternalChildren = new Drawable[]
{
new Container
{
Size = new Vector2(MessagePadding, TextSize),
Children = new Drawable[]
{
timestamp = new OsuSpriteText
{
Shadow = false,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.SemiBold, fixedWidth: true)
},
new MessageSender(message.Sender)
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,
Child = effectedUsername,
},
}
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = MessagePadding + HorizontalPadding },
Children = new Drawable[]
{
ContentFlow = new LinkFlowContainer(t =>
{
t.Shadow = false;
if (Message.IsAction)
{
t.Font = OsuFont.GetFont(italics: true);
if (senderHasBackground)
t.Colour = Color4Extensions.FromHex(message.Sender.Colour);
}
t.Font = t.Font.With(size: TextSize);
})
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
}
}
}
};
updateMessageContent();
}
protected override void LoadComplete()
{
base.LoadComplete();
FinishTransforms(true);
}
private void updateMessageContent()
{
this.FadeTo(message is LocalEchoMessage ? 0.4f : 1.0f, 500, Easing.OutQuint);
timestamp.FadeTo(message is LocalEchoMessage ? 0 : 1, 500, Easing.OutQuint);
timestamp.Text = $@"{message.Timestamp.LocalDateTime:HH:mm:ss}";
username.Text = $@"{message.Sender.Username}" + (senderHasBackground || message.IsAction ? "" : ":");
// remove non-existent channels from the link list
message.Links.RemoveAll(link => link.Action == LinkAction.OpenChannel && chatManager?.AvailableChannels.Any(c => c.Name == link.Argument) != true);
ContentFlow.Clear();
ContentFlow.AddLinks(message.DisplayContent, message.Links);
}
private class MessageSender : OsuClickableContainer, IHasContextMenu
{
private readonly User sender;
private Action startChatAction;
[Resolved]
private IAPIProvider api { get; set; }
public MessageSender(User sender)
{
this.sender = sender;
}
[BackgroundDependencyLoader(true)]
private void load(UserProfileOverlay profile, ChannelManager chatManager)
{
Action = () => profile?.ShowUser(sender);
startChatAction = () => chatManager?.OpenPrivateChannel(sender);
}
public MenuItem[] ContextMenuItems
{
get
{
List<MenuItem> items = new List<MenuItem>
{
new OsuMenuItem("View Profile", MenuItemType.Highlighted, Action)
};
if (sender.Id != api.LocalUser.Value.Id)
items.Add(new OsuMenuItem("Start Chat", MenuItemType.Standard, startChatAction));
return items.ToArray();
}
}
}
private static readonly Color4[] username_colours =
{
Color4Extensions.FromHex("588c7e"),
Color4Extensions.FromHex("b2a367"),
Color4Extensions.FromHex("c98f65"),
Color4Extensions.FromHex("bc5151"),
Color4Extensions.FromHex("5c8bd6"),
Color4Extensions.FromHex("7f6ab7"),
Color4Extensions.FromHex("a368ad"),
Color4Extensions.FromHex("aa6880"),
Color4Extensions.FromHex("6fad9b"),
Color4Extensions.FromHex("f2e394"),
Color4Extensions.FromHex("f2ae72"),
Color4Extensions.FromHex("f98f8a"),
Color4Extensions.FromHex("7daef4"),
Color4Extensions.FromHex("a691f2"),
Color4Extensions.FromHex("c894d3"),
Color4Extensions.FromHex("d895b0"),
Color4Extensions.FromHex("53c4a1"),
Color4Extensions.FromHex("eace5c"),
Color4Extensions.FromHex("ea8c47"),
Color4Extensions.FromHex("fc4f4f"),
Color4Extensions.FromHex("3d94ea"),
Color4Extensions.FromHex("7760ea"),
Color4Extensions.FromHex("af52c6"),
Color4Extensions.FromHex("e25696"),
Color4Extensions.FromHex("677c66"),
Color4Extensions.FromHex("9b8732"),
Color4Extensions.FromHex("8c5129"),
Color4Extensions.FromHex("8c3030"),
Color4Extensions.FromHex("1f5d91"),
Color4Extensions.FromHex("4335a5"),
Color4Extensions.FromHex("812a96"),
Color4Extensions.FromHex("992861"),
};
}
}
| 36.97931 | 160 | 0.504196 | [
"MIT"
] | BananeVolante/osu | osu.Game/Overlays/Chat/ChatLine.cs | 10,437 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sales.Backend")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sales.Backend")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1f84931e-357b-43f0-affc-fbf955a9b260")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.611111 | 84 | 0.750369 | [
"MIT"
] | AngelloLuis/GamarraWasi | Sales.Backend/Properties/AssemblyInfo.cs | 1,357 | C# |
namespace TelegramClient.Core.Network.Exceptions
{
using System;
internal abstract class DataCenterMigrationException : Exception
{
private const string ReportMessage =
" See: https://github.com/sochix/TLSharp#i-get-a-xxxmigrationexception-or-a-migrate_x-error";
internal int Dc { get; }
protected DataCenterMigrationException(string msg, int dc) : base(msg + ReportMessage)
{
Dc = dc;
}
}
} | 28.823529 | 106 | 0.628571 | [
"MIT"
] | vik-borisov/TelegramClient | src/TelegramClient.Core/Network/Exceptions/DataCenterMigrationException.cs | 490 | C# |
using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using TagsTree.Commands;
using TagsTree.Views;
namespace TagsTree.ViewModels;
public partial class FileImporterViewModel : ObservableObject
{
public FileImporterViewModel(FileImporterPage page)
{
Import = new RelayCommand(_ => !Importing, page.Import);
DeleteBClick = new RelayCommand(_ => !Importing && FileViewModels.Count != 0, page.DeleteBClick);
SaveBClick = new RelayCommand(_ => !Importing && FileViewModels.Count != 0, page.SaveBClick);
FileViewModels.CollectionChanged += (_, _) =>
{
DeleteBClick.OnCanExecuteChanged();
SaveBClick.OnCanExecuteChanged();
};
PropertyChanged += (_, e) =>
{
if (e.PropertyName is nameof(Importing))
{
Import.OnCanExecuteChanged();
DeleteBClick.OnCanExecuteChanged();
SaveBClick.OnCanExecuteChanged();
}
};
}
public RelayCommand Import { get; }
public RelayCommand DeleteBClick { get; }
public RelayCommand SaveBClick { get; }
public ObservableCollection<FileViewModel> FileViewModels { get; } = new();
[ObservableProperty] private bool _importing;
} | 34.783784 | 105 | 0.651904 | [
"MIT"
] | Poker-sang/TagsTree | TagsTree/ViewModels/FileImporterViewModel.cs | 1,289 | C# |
using System;
class SquareOfANumber
{
static void Main()
{
string decorationLine = new string('-', 80);
Console.Write(decorationLine);
Console.WriteLine("***Printing the square of the number 12345***");
Console.Write(decorationLine);
Console.WriteLine("The square of {0} is {1}.", 12345, 12345 * 12345);
}
}
| 24.2 | 77 | 0.614325 | [
"MIT"
] | vladislav-karamfilov/TelerikAcademy | C# Projects/Homework-IntroductionToProgramming/8. SquareOfANumber/SquareOfANumber.cs | 365 | C# |
/*
* This filePath is part of AceQL C# Client SDK.
* AceQL C# Client SDK: Remote SQL access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this filePath except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using AceQL.Client.Api;
using AceQL.Client.Test.Dml;
using AceQL.Client.Test.Util;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace AceQL.Client.test.Dml.Blob
{
public class SqlBlobSelectTest
{
private AceQLConnection connection;
public SqlBlobSelectTest(AceQLConnection connection)
{
this.connection = connection;
}
public async Task BlobDownload(int customerId, int itemId, string blobPath)
{
string sql = "select * from orderlog where customer_id = @parm1 and item_id = @parm2 ";
AceQLCommand command = new AceQLCommand(sql, connection);
command.Parameters.AddWithValue("@parm1", customerId);
command.Parameters.AddWithValue("@parm2", itemId);
using (AceQLDataReader dataReader = await command.ExecuteReaderAsync())
{
while (dataReader.Read())
{
AceQLConsole.WriteLine();
AceQLConsole.WriteLine("Get values using ordinal values:");
int i = 0;
AceQLConsole.WriteLine("GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i++) + "\n"
+ "GetValue: " + dataReader.GetValue(i));
//customer_id
//item_id
//description
//item_cost
//date_placed
//date_shipped
//jpeg_image
//is_delivered
//quantity
AceQLConsole.WriteLine();
AceQLConsole.WriteLine("Get values using column name values:");
AceQLConsole.WriteLine("GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("customer_id"))
+ "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("item_id")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("description")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("item_cost")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("date_placed")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("date_shipped")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("jpeg_image")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("is_delivered")) + "\n"
+ "GetValue: " + dataReader.GetValue(dataReader.GetOrdinal("quantity")));
AceQLConsole.WriteLine("==> dataReader.IsDBNull(3): " + dataReader.IsDBNull(3));
AceQLConsole.WriteLine("==> dataReader.IsDBNull(4): " + dataReader.IsDBNull(4));
// Download Blobs
using (Stream stream = await dataReader.GetStreamAsync(6))
{
using (var fileStream = File.Create(blobPath))
{
stream.CopyTo(fileStream);
}
}
}
}
}
}
}
| 45.304762 | 115 | 0.526592 | [
"Apache-2.0"
] | kawansoft/AceQL.Client2 | AceQL.Client.Tests2/test/Dml.Blob/SqlBlobSelectTest.cs | 4,759 | C# |
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Prime;
using Prime.Models;
namespace Prime.Migrations
{
[DbContext(typeof(ApiDbContext))]
[Migration("20210715213428_CreateClientLogModels")]
partial class CreateClientLogModels
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Prime.Models.AccessAgreementNote", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdjudicatorId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("NoteDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("EnrolleeId")
.IsUnique();
b.ToTable("AccessAgreementNote");
});
modelBuilder.Entity("Prime.Models.Address", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AddressType")
.HasColumnType("integer");
b.Property<string>("City")
.HasColumnType("text");
b.Property<string>("CountryCode")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Postal")
.HasColumnType("text");
b.Property<string>("ProvinceCode")
.HasColumnType("text");
b.Property<string>("Street")
.HasColumnType("text");
b.Property<string>("Street2")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CountryCode");
b.HasIndex("ProvinceCode");
b.ToTable("Address");
b.HasDiscriminator<int>("AddressType");
});
modelBuilder.Entity("Prime.Models.Admin", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("IDIR")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("Admin");
});
modelBuilder.Entity("Prime.Models.Agreement", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset?>("AcceptedDate")
.HasColumnType("timestamp with time zone");
b.Property<int>("AgreementVersionId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int?>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("ExpiryDate")
.HasColumnType("timestamp with time zone");
b.Property<int?>("LimitsConditionsClauseId")
.HasColumnType("integer");
b.Property<int?>("OrganizationId")
.HasColumnType("integer");
b.Property<int?>("PartyId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AgreementVersionId");
b.HasIndex("EnrolleeId");
b.HasIndex("LimitsConditionsClauseId");
b.HasIndex("OrganizationId");
b.HasIndex("PartyId");
b.ToTable("Agreement");
b.HasCheckConstraint("CHK_Agreement_OnlyOneForeignKey", @"( CASE WHEN ""EnrolleeId"" IS NULL THEN 0 ELSE 1 END
+ CASE WHEN ""OrganizationId"" IS NULL THEN 0 ELSE 1 END
+ CASE WHEN ""PartyId"" IS NULL THEN 0 ELSE 1 END) = 1");
});
modelBuilder.Entity("Prime.Models.AgreementVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AgreementType")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("EffectiveDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Text")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("AgreementVersion");
b.HasData(
new
{
Id = 1,
AgreementType = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>PHARMANET TERMS OF ACCESS FOR ON-BEHALF-OF USER</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
On Behalf of User Access
</p>
<p class=""bold"">
You represent and warrant to the Province that:
</p>
<ol type=""a"">
<li>
your employment duties in relation to a Practitioner require you to access PharmaNet (and PharmaNet Data) to
support the Practitioner’s delivery of Direct Patient Care;
</li>
<li>
you are directly supervised by a Practitioner who has been granted access to PharmaNet by the Province; and
</li>
<li>
all information provided by you in connection with your application for PharmaNet access, including all
information submitted through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
Definitions
</p>
<p class=""bold"">
In these terms, capitalized terms will have the following meanings:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom a Practitioner provides direct patient care in the context of their Practice.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record or
information in the custody, control or possession of you or a Practitioner that was obtained through access to
PharmaNet by anyone.
</li>
<li>
<strong>“Practice”</strong> means a Practitioner’s practice of their health profession.
</li>
<li>
<strong>“Practitioner”</strong> means a health professional regulated under the Health Professions Act who
supervises your access and use of PharmaNet and who has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for, and
manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
</ul>
</li>
<li>
<p class=""bold underline"">
Terms of Access to PharmaNet
</p>
<p class=""bold"">
You must:
</p>
<ol type=""a"">
<li>
access and use PharmaNet and PharmaNet Data only to support Direct Patient Care delivered by the Practitioner to
the individuals whose PharmaNet Data you are accessing;
</li>
<li>
only access PharmaNet as permitted by law and directed by the Practitioner;
</li>
<li>
maintain all PharmaNet Data, whether accessed on PharmaNet or otherwise disclosed to you in any manner, in
strict confidence;
</li>
<li>
maintain the security of PharmaNet, and any applications, connections, or networks used to access PharmaNet;
</li>
<li>
complete all training required by the Practice’s PharmaNet software vendor and the Province before accessing
PharmaNet;
</li>
<li>
notify the Province if you have any reason to suspect that PharmaNet, or any PharmaNet Data, is or has been
accessed or used inappropriately by any person.
</li>
</ol>
<p class=""bold"">
You must not:
</p>
<ol type=""a""
start=""7"">
<li>
disclose PharmaNet Data for any purpose other than Direct Patient Care, except as permitted by law and directed
by the Practitioner;
</li>
<li>
permit any person to use any user IDs, passwords or credentials provided to you to access PharmaNet;
</li>
<li>
reveal, share or compromise any user IDs, passwords or credentials for PharmaNet;
</li>
<li>
use, or attempt to use, the user IDs, passwords or credentials of any other person to access PharmaNet;
</li>
<li>
take any action that might compromise the integrity of PharmaNet, its information, or the provincial drug plan,
such as altering information or submitting false information;
</li>
<li>
test the security related to PharmaNet;
</li>
<li>
attempt to access PharmaNet from any location other than the approved Practice site of the Practitioner,
including by VPN or other remote access technology, unless that VPN or remote access technology has first been
approved by the Province in writing for use at the Practice.
</li>
</ol>
<p>
Your access to PharmaNet and use of PharmaNet Data are governed by the Pharmaceutical Services Act and you must
comply with all your duties under that Act.
</p>
<p>
The Province may, in writing and from time to time, set further limits and conditions in respect of PharmaNet,
either for you or for the Practitioner(s), and that you must comply with any such further limits and conditions.
</p>
</li>
<li>
<p class=""bold underline"">
How to Notify the Province
</p>
<p>
Notice to the Province may be sent in writing to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<p class=""bold underline"">
Province may modify these terms
</p>
<p>
The Province may amend these terms, including this section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified by the
Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will specify
the effective date of the amendment, which date will be at least thirty (30) days after the date that the
PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with (i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
<p>
Any written notice to you under (i) above will be in writing and delivered by the Province to you using any of the
contact mechanisms identified by you in PRIME, including by mail to a specified postal address, email to a
specified email address or text message to a specified cell phone number. You may be required to click a URL link
or log into PRIME to receive the contents of any such notice.
</p>
</li>
{$lcPlaceholder}
<li>
<p class=""bold underline"">
Governing Law
</p>
<p>
These terms will be governed by and will be construed and interpreted in accordance with the laws of British
Columbia and the laws of Canada applicable therein.
</p>
<p>
Unless otherwise specified, a reference to a statute or regulation by name means the statute or regulation of
British Columbia of that name, as amended or replaced from time to time, and includes any enactment made under the
authority of that statute or regulation.
</p>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 2,
AgreementType = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>PHARMANET REGULATED USER TERMS OF ACCESS</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold underline"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to
ensure that appropriate measures are in place to protect the confidentiality of all such information. All access
to and use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the Pharmaceutical Services Act.
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province that provides
you with the information technology software and/or services through which you and On-Behalf-of Users access
PharmaNet.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the Province, as
amended
from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards; and
</li>
<li>
Office of the Chief Information Officer: “Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity”.
</li>
</ol>
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the Information Management Regulation, B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to PharmaNet to
carry out duties in relation to your Practice; and (ii) is authorized by you to access PharmaNet on your
behalf; and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record
or information in the custody, control or possession of you or a On-Behalf-of User that was obtained through
your or a On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the Health
Professions Act and identified by you through PRIME.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for,
and manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the Freedom of Information and Protection of Privacy Act, the
Personal Information Protection Act, and any other statutory or legal obligations of privacy owed by you or
the Province, whether arising under statute, by contract or at common law.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the Information Management Regulation.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any further limits
or conditions communicated to you in writing by the Province, unless the conflicting provision expressly
states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act and all
Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
specific provisions of the Act, including the Information Management Regulation and sections 24, 25 and 29 of
the Act, apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in section 5(b) below and otherwise in this Agreement. The
Province may from time to time, at its discretion, amend or change the scope of your access privileges to
PharmaNet as privacy, security, business and clinical practice requirements change. In such circumstances, the
Province will use reasonable efforts to notify you of such changes.
</li>
<li>
<p>
<strong>Limits and Conditions of Access.</strong> The following limits and conditions apply to your access to
PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your licence permits you to
deliver Direct Patient Care requiring access to PharmaNet;
</li>
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, at a
location approved by the Province, and using only the technologies and applications approved by the
Province. For greater certainty, you must not access PharmaNet using a VPN or similar remote access
technology to an approved location, unless that VPN or remote access technology has first been approved by
the Province in writing for use at the Practice;
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct Patient Care;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning, surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in the PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as required
by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Practice to prevent viewing of PharmaNet
Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and prohibit
sharing or other multiple use of your access credential, or an On-Behalf-of User’s access credential, for
access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access to
PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards - Business Rules.</strong> You will comply with, and will ensure On-Behalf-of
Users comply with, the business rules specified in the Conformance Standards when accessing and recording
information in PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with
Professional College requirements and in connection with your provision of Direct Patient Care and otherwise is
in compliance with the Conformance Standards. You will not modify any records retained in accordance with this
section other than as may be expressly authorized in the Conformance Standards. For clarity, you may annotate a
discrete record provided that the discrete record is not itself modified other than as expressly authorized in
the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet access.</strong> If the Province suspends or terminates your
right, or an On-Behalf-of User’s right, to access PharmaNet under the Information Management Regulation, the
Province may also terminate this Agreement at any time thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the Information
Management Regulation.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy, completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province if You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective,
must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content
of any such notice.
</li>
<li>
<strong>Deemed receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent
by mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays)
after the date the notice was sent.
</li>
<li>
<strong>Substitute contact information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
{$lcPlaceholder}
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Entire Agreement.</strong> This Agreement constitutes the entire agreement between the parties with
respect to the subject matter of this agreement.
</p>
</li>
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(iv) (v), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province may modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified by
the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 3,
AgreementType = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 3, 5, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -8, 0, 0, 0)),
Text = @"<h1>PHARMANET TERMS OF ACCESS FOR ON-BEHALF-OF USER</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
On Behalf of User Access
</p>
<p class=""bold"">
You represent and warrant to the Province that:
</p>
<ol type=""a"">
<li>
your employment duties in relation to a Practitioner require you to access PharmaNet (and PharmaNet
Data) to
support the Practitioner’s delivery of Direct Patient Care;
</li>
<li>
you are directly supervised by a Practitioner who has been granted access to PharmaNet by the Province;
and
</li>
<li>
all information provided by you in connection with your application for PharmaNet access, including all
information submitted through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
Definitions
</p>
<p class=""bold"">
In these terms, capitalized terms will have the following meanings:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of
health
services to an individual to whom a Practitioner provides direct patient care in the context of their
Practice.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on
the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any
record or
information in the custody, control or possession of you or a Practitioner that was obtained through
access to
PharmaNet by anyone.
</li>
<li>
<strong>“Practice”</strong> means a Practitioner’s practice of their health profession.
</li>
<li>
<strong>“Practitioner”</strong> means a health professional regulated under the Health Professions Act
who
supervises your access and use of PharmaNet and who has been granted access to PharmaNet by the
Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply
for, and
manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by
the
Minister of Health.
</li>
</ul>
</li>
<li>
<p class=""bold underline"">
Terms of Access to PharmaNet
</p>
<p class=""bold"">
You must:
</p>
<ol type=""a"">
<li>
access and use PharmaNet and PharmaNet Data only to support Direct Patient Care delivered by the
Practitioner to
the individuals whose PharmaNet Data you are accessing;
</li>
<li>
only access PharmaNet as permitted by law and directed by the Practitioner;
</li>
<li>
maintain all PharmaNet Data, whether accessed on PharmaNet or otherwise disclosed to you in any manner,
in
strict confidence;
</li>
<li>
maintain the security of PharmaNet, and any applications, connections, or networks used to access
PharmaNet;
</li>
<li>
complete all training required by the Practice’s PharmaNet software vendor and the Province before
accessing
PharmaNet;
</li>
<li>
notify the Province if you have any reason to suspect that PharmaNet, or any PharmaNet Data, is or has
been
accessed or used inappropriately by any person.
</li>
</ol>
<p class=""bold"">
You must not:
</p>
<ol type=""a""
start=""7"">
<li>
disclose PharmaNet Data for any purpose other than Direct Patient Care, except as permitted by law and
directed
by the Practitioner;
</li>
<li>
permit any person to use any user IDs, passwords or credentials provided to you to access PharmaNet;
</li>
<li>
reveal, share or compromise any user IDs, passwords or credentials for PharmaNet;
</li>
<li>
use, or attempt to use, the user IDs, passwords or credentials of any other person to access PharmaNet;
</li>
<li>
take any action that might compromise the integrity of PharmaNet, its information, or the provincial
drug plan,
such as altering information or submitting false information;
</li>
<li>
test the security related to PharmaNet;
</li>
<li>
you must not attempt to access PharmaNet from any location other than the approved Practice site of the
Practitioner, including by VPN or other remote access technology,
unless that VPN or remote access technology has first been approved by the Province in writing for use
at the Practice.
You must be physically located in BC whenever you use approved VPN or other approved remote access
technology to access PharmaNet.
</li>
</ol>
<p>
Your access to PharmaNet and use of PharmaNet Data are governed by the Pharmaceutical Services Act and you
must
comply with all your duties under that Act.
</p>
<p>
The Province may, in writing and from time to time, set further limits and conditions in respect of
PharmaNet,
either for you or for the Practitioner(s), and that you must comply with any such further limits and
conditions.
</p>
</li>
<li>
<p class=""bold underline"">
How to Notify the Province
</p>
<p>
Notice to the Province may be sent in writing to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<p class=""bold underline"">
Province may modify these terms
</p>
<p>
The Province may amend these terms, including this section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the
Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify
the effective date of the amendment, which date will be at least thirty (30) days after the date that
the
PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with
(i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
<p>
Any written notice to you under (i) above will be in writing and delivered by the Province to you using any
of the
contact mechanisms identified by you in PRIME, including by mail to a specified postal address, email to a
specified email address or text message to a specified cell phone number. You may be required to click a URL
link
or log into PRIME to receive the contents of any such notice.
</p>
</li>
{$lcPlaceholder}
<li>
<p class=""bold underline"">
Governing Law
</p>
<p>
These terms will be governed by and will be construed and interpreted in accordance with the laws of British
Columbia and the laws of Canada applicable therein.
</p>
<p>
Unless otherwise specified, a reference to a statute or regulation by name means the statute or regulation
of
British Columbia of that name, as amended or replaced from time to time, and includes any enactment made
under the
authority of that statute or regulation.
</p>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 4,
AgreementType = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 3, 5, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -8, 0, 0, 0)),
Text = @"<h1>PHARMANET REGULATED USER TERMS OF ACCESS</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links
B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered
into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet
is to
enhance patient care by providing timely and relevant information to persons involved in the provision of
direct
patient care.
</p>
<p class=""bold underline"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the
proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to
ensure that appropriate measures are in place to protect the confidentiality of all such information. All
access
to and use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will
have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the Pharmaceutical Services Act.
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province
that provides
you with the information technology software and/or services through which you and On-Behalf-of
Users access
PharmaNet.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the
Province, as
amended
from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards; and
</li>
<li>
Office of the Chief Information Officer: “Submission for Technical Security Standard and
High Level
Architecture for Wireless Local Area Network Connectivity”.
</li>
</ol>
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision
of health
services to an individual to whom you provide direct patient care in the context of your
Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the Information Management
Regulation, B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to
PharmaNet to
carry out duties in relation to your Practice; and (ii) is authorized by you to access PharmaNet
on your
behalf; and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an
identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health
information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the
Province on the
following website (or such other website as may be specified by the Province from time to time
for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information
Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and
any record
or information in the custody, control or possession of you or a On-Behalf-of User that was
obtained through
your or a On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the
Health
Professions Act and identified by you through PRIME.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to
apply for,
and manage, their access to PharmaNet, and through which users are granted access by the
Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the Freedom of Information and Protection of
Privacy Act, the
Personal Information Protection Act, and any other statutory or legal obligations of privacy
owed by you or
the Province, whether arising under statute, by contract or at common law.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as
represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support
purposes in
accordance with section 6 of the Information Management Regulation.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or
regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time
to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this
Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any
further limits
or conditions communicated to you in writing by the Province, unless the conflicting provision
expressly
states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the
Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act and
all
Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by
the
Province under the authority of the Act;
</li>
<li>
specific provisions of the Act, including the Information Management Regulation and sections 24, 25 and
29 of
the Act, apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
this Agreement documents limits and conditions, set by the minister in writing, that the Act requires
you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in section 5(b) below and otherwise in this Agreement.
The
Province may from time to time, at its discretion, amend or change the scope of your access privileges
to
PharmaNet as privacy, security, business and clinical practice requirements change. In such
circumstances, the
Province will use reasonable efforts to notify you of such changes.
</li>
<li>
<p>
<strong>Limits and Conditions of Access.</strong> The following limits and conditions apply to your
access to
PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access
PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your licence
permits you to
deliver Direct Patient Care requiring access to PharmaNet;
</li>
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access
PharmaNet, at a location approved by the Province, and using only the technologies and
applications approved by the Province. For greater certainty, you must not access PharmaNet
using a VPN or similar remote access technology to an approved location, unless that VPN or
remote access technology has first been approved by the Province in writing for use at the
Practice. You, or your On-Behalf-of Users, must be physically located in BC whenever you use VPN
or similar remote access technology to access PharmaNet.
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you
will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct
Patient Care;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of
market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet
Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure
that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of
Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning,
surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all
reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in
relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require
access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave
of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the
Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional
limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your
application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this
Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable
measures to
safeguard Personal Information, including any Personal Information in the PharmaNet Data while it is
in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and
as required
by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Practice to prevent viewing of
PharmaNet
Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User,
and prohibit
sharing or other multiple use of your access credential, or an On-Behalf-of User’s access
credential, for
access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable
access to
PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from
time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards - Business Rules.</strong> You will comply with, and will ensure
On-Behalf-of
Users comply with, the business rules specified in the Conformance Standards when accessing and
recording
information in PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper
files or
any electronic system, unless such storage or retention is required for record keeping in accordance
with
Professional College requirements and in connection with your provision of Direct Patient Care and
otherwise is
in compliance with the Conformance Standards. You will not modify any records retained in accordance
with this
section other than as may be expressly authorized in the Conformance Standards. For clarity, you may
annotate a
discrete record provided that the discrete record is not itself modified other than as expressly
authorized in
the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with
section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the
purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do
not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient
Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of
Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in
accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing
PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such
records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record contained in PharmaNet.</strong> If you receive a
request for
correction of any record or information contained in PharmaNet, you will refer the request to the
Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the
Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records
contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For
greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests
or
demands for records contained in PharmaNet, and not records retained by you in accordance with section
6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of
User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material
inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it
if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations
conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books,
records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province
may
report any material breach of this Agreement to your Professional College or to the Information and
Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this
Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any
steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of
User’s
access rights.
</li>
<li>
<p>
<strong>Non Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User
will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the
security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person,
to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet
by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or
(e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written
notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet access.</strong> If the Province suspends or terminates
your
right, or an On-Behalf-of User’s right, to access PharmaNet under the Information Management Regulation,
the
Province may also terminate this Agreement at any time thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate
this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to
you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the Information
Management Regulation.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may
suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the
Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but
you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and
PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as
available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy,
completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation
of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You are Responsible.</strong> You are responsible for verifying the accuracy of information
disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or
acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User
pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the
Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or
PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province if You Cause a Loss or Claim.</strong> You agree to indemnify
and save
harmless the Province, and the Province’s employees and agents (each an
<strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified
Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are
based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another
method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to
be
effective,
must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will
be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in
PRIME,
including by mail to a specified postal address, email to a specified email address or text message to
the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the
content
of any such notice.
</li>
<li>
<strong>Deemed receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if
sent
by mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory
holidays)
after the date the notice was sent.
</li>
<li>
<strong>Substitute contact information.</strong> You may notify the Province of a substitute contact
mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
{$lcPlaceholder}
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Entire Agreement.</strong> This Agreement constitutes the entire agreement between the
parties with
respect to the subject matter of this agreement.
</p>
</li>
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and
is
severable from any other covenant, and if any of them are held by a court, or other decision-maker,
to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(iv) (v), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any
other
provision of this Agreement that expressly or by its nature continues after termination, shall
survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and
interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be
assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any
provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or
any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province may modify this Agreement.</strong> The Province may amend this Agreement,
including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of
(A) the date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment
specified by
the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the
notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after
the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment
described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this
Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for
which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly
(and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all
On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 5,
AgreementType = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 3, 10, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>PHARMANET TERMS OF ACCESS FOR ON-BEHALF-OF USER</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
On Behalf of User Access
</p>
<p class=""bold"">
You represent and warrant to the Province that:
</p>
<ol type=""a"">
<li>
your employment duties in relation to a Practitioner require you to access PharmaNet (and PharmaNet
Data) to
support the Practitioner’s delivery of Direct Patient Care;
</li>
<li>
you are directly supervised by a Practitioner who has been granted access to PharmaNet by the Province;
and
</li>
<li>
all information provided by you in connection with your application for PharmaNet access, including all
information submitted through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
Definitions
</p>
<p class=""bold"">
In these terms, capitalized terms will have the following meanings:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of
health
services to an individual to whom a Practitioner provides direct patient care in the context of their
Practice.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on
the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any
record or
information in the custody, control or possession of you or a Practitioner that was obtained through
access to
PharmaNet by anyone.
</li>
<li>
<strong>“Practice”</strong> means a Practitioner’s practice of their health profession.
</li>
<li>
<strong>“Practitioner”</strong> means a health professional regulated under the Health Professions Act
who
supervises your access and use of PharmaNet and who has been granted access to PharmaNet by the
Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply
for, and
manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by
the
Minister of Health.
</li>
</ul>
</li>
<li>
<p class=""bold underline"">
Terms of Access to PharmaNet
</p>
<p class=""bold"">
You must:
</p>
<ol type=""a"">
<li>
access and use PharmaNet and PharmaNet Data only to support Direct Patient Care delivered by the
Practitioner to
the individuals whose PharmaNet Data you are accessing;
</li>
<li>
only access PharmaNet as permitted by law and directed by the Practitioner;
</li>
<li>
maintain all PharmaNet Data, whether accessed on PharmaNet or otherwise disclosed to you in any manner,
in
strict confidence;
</li>
<li>
maintain the security of PharmaNet, and any applications, connections, or networks used to access
PharmaNet;
</li>
<li>
complete all training required by the Practice’s PharmaNet software vendor and the Province before
accessing
PharmaNet;
</li>
<li>
notify the Province if you have any reason to suspect that PharmaNet, or any PharmaNet Data, is or has
been
accessed or used inappropriately by any person.
</li>
</ol>
<p class=""bold"">
You must not:
</p>
<ol type=""a""
start=""7"">
<li>
disclose PharmaNet Data for any purpose other than Direct Patient Care, except as permitted by law and
directed
by the Practitioner;
</li>
<li>
permit any person to use any user IDs, passwords or credentials provided to you to access PharmaNet;
</li>
<li>
reveal, share or compromise any user IDs, passwords or credentials for PharmaNet;
</li>
<li>
use, or attempt to use, the user IDs, passwords or credentials of any other person to access PharmaNet;
</li>
<li>
take any action that might compromise the integrity of PharmaNet, its information, or the provincial
drug plan,
such as altering information or submitting false information;
</li>
<li>
test the security related to PharmaNet;
</li>
<li>
attempt to access PharmaNet from any location other than the approved Practice site of the
Practitioner, including by VPN or other remote access technology,
unless that VPN or remote access technology has first been approved by the Province in writing for use
at the Practice.
You must be physically located in BC whenever you use approved VPN or other approved remote access
technology to access PharmaNet.
</li>
</ol>
<p>
Your access to PharmaNet and use of PharmaNet Data are governed by the Pharmaceutical Services Act and you
must
comply with all your duties under that Act.
</p>
<p>
The Province may, in writing and from time to time, set further limits and conditions in respect of
PharmaNet,
either for you or for the Practitioner(s), and that you must comply with any such further limits and
conditions.
</p>
</li>
<li>
<p class=""bold underline"">
How to Notify the Province
</p>
<p>
Notice to the Province may be sent in writing to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<p class=""bold underline"">
Province may modify these terms
</p>
<p>
The Province may amend these terms, including this section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the
Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify
the effective date of the amendment, which date will be at least thirty (30) days after the date that
the
PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with
(i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
<p>
Any written notice to you under (i) above will be in writing and delivered by the Province to you using any
of the
contact mechanisms identified by you in PRIME, including by mail to a specified postal address, email to a
specified email address or text message to a specified cell phone number. You may be required to click a URL
link
or log into PRIME to receive the contents of any such notice.
</p>
</li>
{$lcPlaceholder}
<li>
<p class=""bold underline"">
Governing Law
</p>
<p>
These terms will be governed by and will be construed and interpreted in accordance with the laws of British
Columbia and the laws of Canada applicable therein.
</p>
<p>
Unless otherwise specified, a reference to a statute or regulation by name means the statute or regulation
of
British Columbia of that name, as amended or replaced from time to time, and includes any enactment made
under the
authority of that statute or regulation.
</p>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 6,
AgreementType = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 5, 7, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>PHARMANET REGULATED USER TERMS OF ACCESS: TEST OF INSERTION OF INDIVIDUAL L&C COPY</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold underline"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to ensure
that appropriate measures are in place to protect the confidentiality of all such information. All access to and
use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the <em>Pharmaceutical Services Act</em>.
</li>
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which you provide Direct Patient Care
and which is approved by the Province for PharmaNet access.
<span class=""underline"">For greater certainty, “Approved Practice Site” does not include a location from which remote access to PharmaNet takes place;</span>
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province that provides
you with the information technology software and/or services through which you and On-Behalf-of Users access
PharmaNet.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the Province, as
amended from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards; and
</li>
<li>
Office of the Chief Information Officer: “Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity”.
</li>
</ol>
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the Information Management Regulation, B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to PharmaNet to
carry out duties in relation to your Practice; (ii) is authorized by you to access PharmaNet on your behalf;
and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record
or information in the custody, control or possession of you or an On-Behalf-of User that was obtained
through your or an On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the <em>Health
Professions Act</em>, or your practice as an enrolled device provider under the
<em>Provider Regulation</em>, B.C. Reg.222/2014, as identified by you through PRIME.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for,
and manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the
<em>Freedom of Information and Protection of Privacy Act</em>,
the <em>Personal Information Protection Act</em>, and any other statutory or legal obligations of privacy
owed by you or the Province, whether arising under statute, by contract or at common law.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the <em>Information Management Regulation</em>.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any further
limits or conditions communicated to you in writing by the Province, unless the conflicting provision
expressly states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act and all
Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
specific provisions of the Act, including the <em>Information Management Regulation</em> and sections 24, 25 and
29 of the Act, apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in section 5(b) below and otherwise in this Agreement. The
Province may from time to time, at its discretion, amend or change the scope of your access privileges to
PharmaNet as privacy, security, business and clinical practice requirements change. In such circumstances, the
Province will use reasonable efforts to notify you of such changes.
</li>
<li>
<p>
<strong>Limits and Conditions of Access.</strong> The following limits and conditions apply to your access to
PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your registration permits
you to deliver Direct Patient Care requiring access to PharmaNet;
</li>
<li>
<p>you will only access PharmaNet:</p>
<ul>
<li>
at the Approved Practice Site, and using only the technologies and applications approved by the
Province; or
</li>
<li>
using a VPN or similar remote access technology, if you are physically located in British Columbia and
remotely connected to the Approved Practice Site using a VPN or other remote access technology
specifically approved by the Province in writing for the Approved Practice Site.
</li>
</ul>
</li>
<li>
you must ensure that your On-Behalf-of-Users do not access PharmaNet on your behalf unless the access
takes place at the Approved Practice Site and the access is in relation to patients for whom you will be
providing Direct Patient Care at the Approved Practice Site requiring the access to PharmaNet;
</li>
<li>
you must ensure that your On-Behalf-of Users do not access PharmaNet using VPN or other remote access
technology
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct Patient Care;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning, surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in the PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as
required by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Practice to prevent viewing of PharmaNet
Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and prohibit
sharing or other multiple use of your access credential, or an On-Behalf-of User’s access credential, for
access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access to
PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards.</strong> You will comply with, and will ensure On-Behalf-of
Users comply with, the rules specified in the Conformance Standards when accessing and recording information in
PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with
Professional College requirements and in connection with your provision of Direct Patient Care and otherwise is
in compliance with the Conformance Standards. You will not modify any records retained in accordance with this
section other than as may be expressly authorized in the Conformance Standards. For clarity, you may annotate a
discrete record provided that the discrete record is not itself modified other than as expressly authorized in
the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet access.</strong> If the Province suspends or terminates your
right, or an On-Behalf-of User’s right, to access PharmaNet under the
<em>Information Management Regulation</em>, the Province may also terminate this Agreement at any time
thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the
<em>Information Management Regulation</em>.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy, completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province if You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective, must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content of
any such notice.
</li>
<li>
<strong>Deemed receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent by
mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays) after
the date the notice was sent.
</li>
<li>
<strong>Substitute contact information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(vi) (vii), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province may modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 7,
AgreementType = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 5, 7, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>
PHARMANET TERMS OF ACCESS FOR ON-BEHALF-OF USER<br>
with individual limits and conditions added
</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<p class=""bold underline"">
On Behalf-of-User Access
</p>
<ol>
<li>
<p>
You represent and warrant to the Province that:
</p>
<ol type=""a"">
<li>
your employment duties in relation to a Practitioner require you to access PharmaNet (and PharmaNet Data) to
support the Practitioner’s delivery of Direct Patient Care;
</li>
<li>
you are directly supervised by a Practitioner who has been granted access to PharmaNet by the Province; and
</li>
<li>
all information provided by you in connection with your application for PharmaNet access, including all
information submitted through PRIME, is true and correct.
</li>
</ol>
</li>
</ol>
<p class=""bold underline"">
Definitions
</p>
<ol start=""2"">
<li>
<p>
In these terms, capitalized terms will have the following meanings:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which a Practitioner provides Direct
Patient Care and which is approved by the Province for PharmaNet access. For greater certainty, “Approved
Practice Site” does not include a location from which remote access to PharmaNet takes place.
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom a Practitioner provides direct patient care in the context of their Practice.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the <em>Information Management
Regulation</em>, B.C. Reg. 74/2015.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record or
information in the custody, control or possession of you or a Practitioner that was obtained through access to
PharmaNet by anyone.
</li>
<li>
<strong>“Practice”</strong> means a Practitioner’s practice of their health profession.
</li>
<li>
<strong>“Practitioner”</strong> means a health professional regulated under the <em>Health Professions Act</em>,
or an enrolled device provide under the <em>Provider Regulation</em> B.C. Reg. 222/2014, who supervises your
access to and use of PharmaNet and who has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for, and
manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
</ul>
</li>
<li>
Unless otherwise specified, a reference to a statute or regulation by name means the statute or regulation of
British Columbia of that name, as amended or replaced from time to time, and includes any enactment made under the
authority of that statute or regulation.
</li>
</ol>
<p class=""bold underline"">
Terms of Access to PharmaNet
</p>
<ol start=""4"">
<li>
<p>
You must:
</p>
<ol type=""a"">
<li>
access and use PharmaNet and PharmaNet Data only at the Approved Practice Site of a Practitioner;
</li>
<li>
access and use PharmaNet and PharmaNet Data only to support Direct Patient Care delivered by a Practitioner to
the individuals whose PharmaNet Data you are accessing, and only if the Practitioner is or will be delivering
Direct Patient Care requiring that access to those individuals at the same Approved Practice Site at which the
access occurs;
</li>
<li>
only access PharmaNet as permitted by law and directed by a Practitioner;
</li>
<li>
maintain all PharmaNet Data, whether accessed on PharmaNet or otherwise disclosed to you in any manner, in
strict confidence;
</li>
<li>
maintain the security of PharmaNet, and any applications, connections, or networks used to access PharmaNet;
</li>
<li>
complete all training required by the Approved Practice Site’s PharmaNet software vendor and the Province before
accessing PharmaNet;
</li>
<li>
notify the Province if you have any reason to suspect that PharmaNet, or any PharmaNet Data, is or has been
accessed or used inappropriately by any person.
</li>
</ol>
</li>
<li>
<p>
You must not:
</p>
<ol type=""a"">
<li>
disclose PharmaNet Data for any purpose other than Direct Patient Care, except as permitted by law and
directed by a Practitioner;
</li>
<li>
permit any person to use any user IDs, passwords or credentials provided to you to access PharmaNet;
</li>
<li>
reveal, share or compromise any user IDs, passwords or credentials for PharmaNet;
</li>
<li>
use, or attempt to use, the user IDs, passwords or credentials of any other person to access PharmaNet;
</li>
<li>
take any action that might compromise the integrity of PharmaNet, its information, or the provincial drug plan,
such as altering information or submitting false information;
</li>
<li>
test the security related to PharmaNet;
</li>
<li>
attempt to access PharmaNet from any location other than the Approved Practice Site of a Practitioner,
including by VPN or other remote access technology;
</li>
<li>
access PharmaNet unless the access is for the purpose of supporting a Practitioner in providing Direct
Patient Care to a patient at the same Approved Practice Site at which your access occurs.
</li>
</ol>
</li>
</ol>
<ol start=""6"">
<li>
Your access to PharmaNet and use of PharmaNet Data are governed by the <em>Pharmaceutical Services Act</em> and you
must comply with all your duties under that Act.
</li>
<li>
The Province may, in writing and from time to time, set further limits and conditions in respect of PharmaNet,
either for you or for the Practitioner(s), and that you must comply with any such further limits and conditions.
</li>
</ol>
<p class=""bold underline"">
How to Notify the Province
</p>
<ol start=""8"">
<li>
<p>
Notice to the Province may be sent in writing to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
</ol>
<p class=""bold underline"">
Province May Modify These Terms
</p>
<ol start=""9"">
<li>
<p>
The Province may amend these terms, including this section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified by the
Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will specify
the effective date of the amendment, which date will be at least thirty (30) days after the date that the
PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with (i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
<p>
Any written notice to you under (i) above will be in writing and delivered by the Province to you using any of the
contact mechanisms identified by you in PRIME, including by mail to a specified postal address, email to a
specified email address or text message to a specified cell phone number. You may be required to click a URL link
or log into PRIME to receive the contents of any such notice.
</p>
</li>
</ol>
<p class=""bold underline"">
Governing Law
</p>
<ol start=""10"">
<li>
<p>
These terms will be governed by and will be construed and interpreted in accordance with the laws of British
Columbia and the laws of Canada applicable therein.
</p>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 8,
AgreementType = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 6, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>PHARMANET REGULATED USER TERMS OF ACCESS</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold underline"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to ensure
that appropriate measures are in place to protect the confidentiality of all such information. All access to and
use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the <em>Pharmaceutical Services Act</em>.
</li>
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which you provide Direct Patient Care
and which is approved by the Province for PharmaNet access.
<span class=""underline"">For greater certainty, “Approved Practice Site” does not include a location from which remote access to PharmaNet takes place;</span>
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province that provides
you with the information technology software and/or services through which you and On-Behalf-of Users access
PharmaNet.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the Province, as
amended from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards; and
</li>
<li>
Office of the Chief Information Officer: “Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity”.
</li>
</ol>
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the Information Management Regulation, B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to PharmaNet to
carry out duties in relation to your Practice; (ii) is authorized by you to access PharmaNet on your behalf;
and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record
or information in the custody, control or possession of you or an On-Behalf-of User that was obtained
through your or an On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the <em>Health
Professions Act</em>, or your practice as an enrolled device provider under the
<em>Provider Regulation</em>, B.C. Reg.222/2014, as identified by you through PRIME.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for,
and manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the
<em>Freedom of Information and Protection of Privacy Act</em>,
the <em>Personal Information Protection Act</em>, and any other statutory or legal obligations of privacy
owed by you or the Province, whether arising under statute, by contract or at common law.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the <em>Information Management Regulation</em>.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any further
limits or conditions communicated to you in writing by the Province, unless the conflicting provision
expressly states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act and all
Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
specific provisions of the Act, including the <em>Information Management Regulation</em> and sections 24, 25 and
29 of the Act, apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in section 5(b) below and otherwise in this Agreement. The
Province may from time to time, at its discretion, amend or change the scope of your access privileges to
PharmaNet as privacy, security, business and clinical practice requirements change. In such circumstances, the
Province will use reasonable efforts to notify you of such changes.
</li>
<li>
<p>
<strong>Limits and Conditions of Access.</strong> The following limits and conditions apply to your access to
PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your registration permits
you to deliver Direct Patient Care requiring access to PharmaNet;
</li>
<li>
<p>you will only access PharmaNet:</p>
<ul>
<li>
at the Approved Practice Site, and using only the technologies and applications approved by the
Province; or
</li>
<li>
using a VPN or similar remote access technology, if you are physically located in British Columbia and
remotely connected to the Approved Practice Site using a VPN or other remote access technology
specifically approved by the Province in writing for the Approved Practice Site.
</li>
</ul>
</li>
<li>
you must ensure that your On-Behalf-of-Users do not access PharmaNet on your behalf unless the access
takes place at the Approved Practice Site and the access is in relation to patients for whom you will be
providing Direct Patient Care at the Approved Practice Site requiring the access to PharmaNet;
</li>
<li>
you must ensure that your On-Behalf-of Users do not access PharmaNet using VPN or other remote access
technology
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct Patient Care;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning, surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in the PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as
required by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Practice to prevent viewing of PharmaNet
Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and prohibit
sharing or other multiple use of your access credential, or an On-Behalf-of User’s access credential, for
access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access to
PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards.</strong> You will comply with, and will ensure On-Behalf-of
Users comply with, the rules specified in the Conformance Standards when accessing and recording information in
PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with
Professional College requirements and in connection with your provision of Direct Patient Care and otherwise is
in compliance with the Conformance Standards. You will not modify any records retained in accordance with this
section other than as may be expressly authorized in the Conformance Standards. For clarity, you may annotate a
discrete record provided that the discrete record is not itself modified other than as expressly authorized in
the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet access.</strong> If the Province suspends or terminates your
right, or an On-Behalf-of User’s right, to access PharmaNet under the
<em>Information Management Regulation</em>, the Province may also terminate this Agreement at any time
thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the
<em>Information Management Regulation</em>.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy, completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province if You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective, must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content of
any such notice.
</li>
<li>
<strong>Deemed receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent by
mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays) after
the date the notice was sent.
</li>
<li>
<strong>Substitute contact information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(vi) (vii), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province may modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 9,
AgreementType = 1,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>PHARMANET COMMUNITY PHARMACIST TERMS OF ACCESS</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to ensure
that appropriate measures are in place to protect the confidentiality of all such information. All access to and
use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the <em>Pharmaceutical Services Act</em>.
</li>
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which you provide Direct Patient Care
and which is approved by the Province for PharmaNet access.
<span class=""underline"">For greater certainty, “Approved Practice Site” does not include a location from which remote access to PharmaNet takes place;</span>
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province that provides
you with the information technology software and/or services through which you and On-Behalf-of Users access
PharmaNet.
</li>
<li>
<strong>“Claim”</strong> means a claim made under the Act for payment in respect of a benefit under the Act.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the Province, as
amended from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards<br>
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards"" target=""_blank"" rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards
</a>;
</li>
<li>
Policy for Secure Remote Access to PharmaNet
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards"" target=""_blank"" rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards
</a>; and
</li>
<li>
iii. Office of the Chief Information Officer: “Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity”.
</li>
</ol>
</li>
<li>
<strong>“Device Provider”</strong> means a person enrolled under section 11 of the Act in the class of
provider known as “device provider”.
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the <em>Information Management Regulation</em>,
B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to PharmaNet to
carry out duties in relation to your Practice; (ii) is authorized by you to access PharmaNet on your behalf;
and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record
or information in the custody, control or possession of you or an On-Behalf-of User that was obtained
through your or an On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the <em>Health
Professions Act</em>, or your practice as a Device Provider, as identified by you through PRIME
or another mechanism provided by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for,
and manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the
<em>Freedom of Information and Protection of Privacy Act</em>, the Personal Information Protection Act, and
any other statutory or legal obligations of privacy owed by you or the Province, whether arising under
statute, by contract or at common law.
</li>
<li>
<strong>“Provider”</strong> means a person enrolled under section 11 of the Act for the purpose of receiving
payment for providing benefits.
</li>
<li>
<strong>“Provider Regulation”</strong> means the <em>Provider Regulation</em>, B.C. Reg. 222/2014.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the <em>Information Management Regulation</em>.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
i. a provision in the body of this Agreement will prevail over any conflicting provision in any further
limits or conditions communicated to you in writing by the Province, unless the conflicting provision
expressly states otherwise; and a provision referred to in (i) above will prevail over any conflicting
provision in the Conformance Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act, the
Information Management Regulation and all Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
a. PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
b. specific provisions of the Act (including but not limited to sections 24, 25 and 29) and the Information
Management Regulation apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
c. this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in this Agreement. The Province may from time to time, at its
discretion, amend or change the scope of your access privileges to PharmaNet as privacy, security, business and
clinical practice requirements change. In such circumstances, the Province will use reasonable efforts to notify
you of such changes.
</li>
<li>
<p>
<strong>Requirements for Access.</strong> The following requirements apply to your access to PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your registration permits
you to deliver Direct Patient Care requiring access to PharmaNet or, in the case of access as a Device
Provider, for so long as you are enrolled as a Device Provider;
</li>
<li>
<p>you will only access PharmaNet:</p>
<ul>
<li>
at the Approved Practice Site, and using only the technologies and applications approved by the
Province; or
</li>
<li>
• using a VPN or similar remote access technology, if you are physically located in British Columbia and
remotely connected to the Approved Practice Site using a VPN or other remote access technology
specifically approved by the Province in writing for the Approved Practice Site.
</li>
</ul>
</li>
<li>
you must ensure that your On-Behalf-of-Users do not access PharmaNet on your behalf unless the access
takes place at the Approved Practice Site and the access is required in relation to patients for whom you
will be providing Direct Patient Care at the Approved Practice Site;
</li>
<li>
you must ensure that your On-Behalf-of Users do not access PharmaNet using VPN or other remote access
technology;
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will
ensure that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct
Patient Care;
</li>
<li>
you will not submit Claims on PharmaNet other than from an Approved Practice Site in respect of which a
person is enrolled as a Provider, and you will ensure that On-Behalf-of Users submit Claims on PharmaNet
only from an Approved Practice Site in respect of which a person is enrolled as a Provider;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning, surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable
measures to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as
required by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Approved Practice Site to prevent
viewing of PharmaNet Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and
prohibit sharing or other multiple use of your access credential, or an On-Behalf-of User’s access
credential, for access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access
to PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards.</strong> You will comply with, and will ensure On-Behalf-of Users comply with,
the rules specified in the Conformance Standards when accessing and recording information in PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with the
Act, the Provider Regulation, and Professional College requirements and in connection with your provision of
Direct Patient Care and otherwise is in compliance with the Conformance Standards. You will not modify any
records retained in accordance with this section other than as may be expressly authorized in the Conformance
Standards. For clarity, you may annotate a discrete record provided that the discrete record is not itself
modified other than as expressly authorized in the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet access.</strong> If the Province suspends or terminates your
right, or an On-Behalf-of User’s right, to access PharmaNet under the
<em>Information Management Regulation</em>, the Province may also terminate this Agreement at any time
thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the
<em>Information Management Regulation</em>.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy, completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province if You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement or in connection with access to PharmaNet by you or an
On-Behalf-of User.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective, must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Innovation<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content of
any such notice.
</li>
<li>
<strong>Deemed receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent by
mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays) after
the date the notice was sent.
</li>
<li>
<strong>Substitute contact information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(vii) (viii), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province may modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 10,
AgreementType = 1,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 8, 28, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<h1>PHARMANET USER TERMS OF ACCESS FOR PHARMACISTS</h1>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to ensure
that appropriate measures are in place to protect the confidentiality of all such information. All access to and
use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the <em>Pharmaceutical Services Act</em>.
</li>
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which you provide Direct Patient Care
and which is approved by the Province for PharmaNet access.
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province that provides
you with the information technology software and/or services through which you and On-Behalf-of Users access
PharmaNet.
</li>
<li>
<strong>“Claim”</strong> means a claim made under the Act for payment in respect of a benefit under the Act.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the Province, as
amended from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards<br>
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards"" target=""_blank"" rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards
</a>; and
</li>
<li>
Office of the Chief Information Officer: “Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity”.
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/system-access/requirements-for-wireless-access-to-pharmanet"" target=""_blank"" rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/system-access/requirements-for-wireless-access-to-pharmanet
</a>
</li>
</ol>
</li>
<li>
<strong>“Device Provider”</strong> means a person enrolled under section 11 of the Act in the class of
provider known as “device provider”.
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the <em>Information Management Regulation</em>,
B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to PharmaNet to
carry out duties in relation to your Practice; (ii) is authorized by you to access PharmaNet on your behalf;
and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record
or information in the custody, control or possession of you or an On-Behalf-of User that was obtained
through your or an On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the <em>Health
Professions Act</em>, or your practice as a Device Provider, as identified by you through PRIME
or another mechanism provided by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for,
and manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the
<em>Freedom of Information and Protection of Privacy Act</em>, the Personal Information Protection Act, and
any other statutory or legal obligations of privacy owed by you or the Province, whether arising under
statute, by contract or at common law.
</li>
<li>
<strong>“Provider”</strong> means a person enrolled under section 11 of the Act for the purpose of receiving
payment for providing benefits.
</li>
<li>
<strong>“Provider Regulation”</strong> means the <em>Provider Regulation</em>, B.C. Reg. 222/2014.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the <em>Information Management Regulation</em>.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any further limits
or conditions communicated to you in writing by the Province, unless the conflicting provision expressly
states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act, the
Information Management Regulation and all Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
a. PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
b. specific provisions of the Act (including but not limited to sections 24, 25 and 29) and the Information
Management Regulation apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
c. this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in this Agreement. The Province may from time to time, at its
discretion, amend or change the scope of your access privileges to PharmaNet as privacy, security, business and
clinical practice requirements change. In such circumstances, the Province will use reasonable efforts to notify
you of such changes.
</li>
<li>
<p>
<strong>Requirements for Access.</strong> The following requirements apply to your access to PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your registration permits
you to deliver Direct Patient Care requiring access to PharmaNet or, in the case of access as a Device
Provider, for so long as you are enrolled as a Device Provider;
</li>
<li>
you will only access PharmaNet: at the Approved Practice Site, and using only the technologies and
applications approved by the Province;
</li>
<li>
you must ensure that your On-Behalf-of-Users do not access PharmaNet on your behalf unless the access takes
place at the Approved Practice Site and the access is required in relation to patients for whom you will be
providing Direct Patient Care at the Approved Practice Site;
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct Patient Care;
</li>
<li>
you will not submit Claims on PharmaNet other than from an Approved Practice Site in respect of which a
person is enrolled as a Provider, and you will ensure that On-Behalf-of Users submit Claims on PharmaNet
only from an Approved Practice Site in respect of which a person is enrolled as a Provider;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning, surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as
required by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Approved Practice Site to prevent
viewing of PharmaNet Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and
prohibit sharing or other multiple use of your access credential, or an On-Behalf-of User’s access
credential, for access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access
to PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards.</strong> You will comply with, and will ensure On-Behalf-of Users comply with,
the rules specified in the Conformance Standards when accessing and recording information in PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with the
Act, the Provider Regulation, and Professional College requirements and in connection with your provision of
Direct Patient Care and otherwise is in compliance with the Conformance Standards. You will not modify any
records retained in accordance with this section other than as may be expressly authorized in the Conformance
Standards. For clarity, you may annotate a discrete record provided that the discrete record is not itself
modified other than as expressly authorized in the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record Contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON-COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non-Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet Access.</strong> If the Province suspends or terminates your
right, or an On-Behalf-of User’s right, to access PharmaNet under the
<em>Information Management Regulation</em>, the Province may also terminate this Agreement at any time
thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by Operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the
<em>Information Management Regulation</em>.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy, completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You Are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province If You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement or in connection with access to PharmaNet by you or an
On-Behalf-of User.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective, must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Innovation<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content of
any such notice.
</li>
<li>
<strong>Deemed Receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent by
mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays) after
the date the notice was sent.
</li>
<li>
<strong>Substitute Contact Information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(vi) (vii), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province May Modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 11,
AgreementType = 4,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<p class=""text-center"">
This Agreement is made the {{day}} day of {{month}}, {{year}}
</p>
<h1>ORGANIZATION AGREEMENT FOR PHARMANET USE</h1>
<p>
This Organization Agreement for PharmaNet Use (the "Agreement") is executed by {{organizationName}}
("Organization") for the benefit of HER MAJESTY THE QUEEN IN RIGHT OF THE PROVINCE OF BRITISH COLUMBIA, as
represented by the Minister of Health (the "Province").
</p>
<p>
<strong>WHEREAS:</strong>
</p>
<ol type=""A"">
<li>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links
pharmacies to a central data system. Every prescription dispensed in community pharmacies in British
Columbia is entered into PharmaNet.
</li>
<li>
PharmaNet contains highly sensitive confidential information, including personal information, and it is in
the public interest to ensure that appropriate measures are in place to protect the confidentiality and
integrity of such information. All access to and use of PharmaNet and PharmaNet Data is subject to the
Act and other applicable law.
</li>
<li>
The Province permits Authorized Users to access PharmaNet to provide health services to, or to facilitate
the care of, the individual whose personal information is being accessed.
</li>
<li>
This Agreement sets out the terms by which Organization may permit Authorized Users to access PharmaNet
at the Site(s) operated by Organization.
</li>
</ol>
<p>
<strong>NOW THEREFORE</strong> Organization makes this Agreement knowing that the Province will rely on it
in permitting access to and use of PharmaNet from Sites operated by Organization. Organization conclusively
acknowledges that reliance by the Province on this Agreement is in every respect justifiable and that it
received fair and valuable consideration for this Agreement, the receipt and adequacy of which is hereby
acknowledged. Organization hereby agrees as follows:
</p>
<p class=""text-center"">
<strong>ARTICLE 1 – INTERPRETATION</strong>
</p>
<ol type=""1""
start=""1""
class=""decimal"">
<li>
<ol type=""1"">
<li>
<p>
In this Agreement, unless the context otherwise requires, the following definitions will apply:
</p>
<ol type=""a"">
<li>
<strong>"Act"</strong> means the <em>Pharmaceutical Services Act</em>;
</li>
<li>
<strong>"Approved SSO"</strong> means, in relation to a Site, the software support organization
identified in section 1 of the Site Request that provides Organization with the SSO-Provided
Technology used at the Site;
</li>
<li>
<strong>"Associated Technology"</strong> means, in relation to a Site, any information technology
hardware, software or services used at the Site, other than the SSO-Provided Technology, that is
in any way used in connection with Site Access or any PharmaNet Data;
</li>
<li>
<p>
<strong>"Authorized User"</strong> means an individual who is granted access to PharmaNet by the
Province and who is:
</p>
<ol type=""i"">
<li>
an employee or independent contractor of Organization, or
</li>
<li>
if Organization is an individual, the Organization;
</li>
</ol>
</li>
<li>
<strong>"Information Management Regulation"</strong> means the
<em>Information Management Regulation</em>,
B.C. Reg. 74/2015;
</li>
<li>
<strong>"On-Behalf-Of User"</strong> means an Authorized User described in subsection 4 (5) of the
<em>Information Management Regulation</em> who acts on behalf of a Regulated User when accessing
PharmaNet;
</li>
<li>
"PharmaNet" means PharmaNet as continued under section 2 of the
<em>Information Management Regulation</em>;
</li>
<li>
<strong>"PharmaNet Data"</strong> includes any records or information contained in PharmaNet and
any records
or information in the custody, control or possession of Organization or any Authorized User as the result of
any Site Access;
</li>
<li>
<strong>"Regulated User"</strong> means an Authorized User described in subsections 4 (2) to (4)
of the
<em>Information Management Regulation</em>;
</li>
<li>
<strong>"Signing Authority"</strong> means the individual identified by Organization as the
"Signing Authority"
for a Site, with the associated contact information, as set out in section 2 of the Site Request;
</li>
<li>
<p>
"Site" means a premises operated by Organization and located in British Columbia that:
</p>
<ol type=""i"">
<li>
is the subject of a Site Request submitted to the Province, and
</li>
<li>
has been approved for Site Access by the Province in writing
</li>
</ol>
<p class=""underline"">
For greater certainty, "Site" does not include a location from which remote access to PharmaNet
takes place;
</p>
</li>
<li>
<strong>"Site Access"</strong> means any access to or use of PharmaNet at a Site or remotely as
permitted
by the Province;
</li>
<li>
<strong>"Site Request"</strong> means, in relation to a Site, the information contained in the
PharmaNet access
request form submitted to the Province by the Organization, requesting PharmaNet access at the Site, as such
information is updated by the Organization from time to time in accordance with section 2.2;
</li>
<li>
<strong>"SSO-Provided Technology"</strong> means any information technology hardware, software or
services
provided to Organization by an Approved SSO for the purpose of Site Access;
</li>
</ol>
</li>
<li>
Unless otherwise specified, a reference to a statute or regulation by name means a statute or regulation of
British
Columbia of that name, as amended or replaced from time to time, and includes any enactments made under the
authority
of that statute or regulation.
</li>
<li>
<p>
The following are the Schedules attached to and incorporated into this Agreement:
</p>
<ul>
<li>
Schedule A – Specific Privacy and Security Measures
</li>
</ul>
</li>
<li>
The main body of this Agreement, the Schedules, and any documents incorporated by reference into this Agreement
are to
be interpreted so that all of the provisions are given as full effect as possible. In the event of a conflict,
unless
expressly stated to the contrary the main body of the Agreement will prevail over the Schedules, which will
prevail
over any document incorporated by reference.
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 2 – REPRESENTATIONS AND WARRANTIES</strong>
</p>
<ol type=""1""
start=""2""
class=""decimal"">
<li>
<ol type=""1"">
<li>
<p>
Organization represents and warrants to the Province, as of the date of this
Agreement and throughout its term, that:
</p>
<ol type=""a"">
<li>
the information contained in the Site Request for each Site is true and correct;
</li>
<li>
<p>
if Organization is not an individual:
</p>
<ol type=""i"">
<li>
Organization has the power and capacity to enter into this Agreement and to comply with its terms;
</li>
<li>
all necessary corporate or other proceedings have been taken to authorize the execution and delivery
of this Agreement by, or on behalf of, Organization; and
</li>
<li>
this Agreement has been legally and properly executed by, or on behalf of, the Organization and is
legally binding upon and enforceable against Organization in accordance with its terms.
</li>
</ol>
</li>
</ol>
</li>
<li>
Organization must immediately notify the Province of any change to the information contained in a Site Request,
including any change to a Site’s status, location, normal operating hours, Approved SSO, or the name and contact
information of the Signing Authority or any of the other specific roles set out in the Site Request. Such
notices
must be submitted to the Province in the form and manner directed by the Province in its published instructions
regarding the submission of updated Site Request information, as such instructions may be updated from time to
time by the Province.
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 3 – SITE ACCESS REQUIREMENTS</strong>
</p>
<ol type=""1""
start=""3""
class=""decimal"">
<li>
<ol type=""1"">
<li>
Organization must comply with the Act and all applicable law.
</li>
<li>
Organization must submit a Site Request to the Province for each physical location where it intends to provide
Site
Access, and must only provide Site Access from Sites approved in writing by the Province. For greater certainty,
a
Site Request is not required for each physical location from which remote access, as permitted under section
3.6,
may occur, but Organization must provide, with the Site Request, a list of the locations from which remote
access
may occur, and ensure this list remains current for the term of this agreement.
</li>
<li>
Organization must only provide Site Access using SSO-Provided Technology. For the purposes of remote access,
Organization must ensure that technology used meets the requirements of Schedule A.
</li>
<li>
Unless otherwise authorized by the Province in writing, Organization must at all times use the secure network or
security technology that the Province certifies or makes available to Organization for the purpose of Site
Access.
The use of any such network or technology by Organization may be subject to terms and conditions of use,
including
acceptable use policies, established by the Province and communicated to Organization from time to time in
writing.
</li>
<li>
<p>
Organization must only make Site Access available to the following individuals:
</p>
<ol type=""a"">
<li>
Authorized Users when they are physically located at a Site, and, in the case of an On-Behalf-of-User
accessing
personal information of a patient on behalf of a Regulated User, only if the Regulated User will be
delivering
care to that patient at the same Site at which the access to personal information occurs;
</li>
<li>
Representatives of an Approved SSO for technical support purposes, in accordance with section 6 of the
<em>Information Management Regulation</em>.
</li>
</ol>
</li>
<li>
Despite section 3.5(a), Organization may make Site Access available to Regulated Users who are physically
located in
British Columbia and remotely connected to a Site using a VPN or other remote access technology specifically
approved
by the Province in writing for the Site.
</li>
<li>
<p>
Organization must ensure that Authorized Users with Site Access:
</p>
<ol type=""a"">
<li>
only access PharmaNet to the extent necessary to provide health services to, or facilitate the care of, the
individual whose personal information is being accessed;
</li>
<li>
first complete any mandatory training program(s) that the Site’s Approved SSO or the Province makes
available
in relation to PharmaNet;
</li>
<li>
access PharmaNet using their own separate login identifications and credentials, and do not share or have
multiple use of any such login identifications and credentials;
</li>
<li>
secure all devices, codes and credentials that enable access to PharmaNet against unauthorized use; and
</li>
<li>
in the case of remote access, comply with the policies of the Province relating to remote access to
PharmaNet.
</li>
</ol>
</li>
<li>
If notified by the Province that an Authorized User’s access to PharmaNet has been suspended or revoked,
Organization
will immediately take any local measures necessary to remove the Authorized User’s Site Access. Organization
will
only restore Site Access to a previously suspended or revoked Authorized User upon the Province’s specific
written
direction.
</li>
<li>
<p>
For the purposes of this section:
</p>
<ol type=""a"">
<li>
<strong>"Responsible Authorized User"</strong> means, in relation to any PharmaNet Data, the
Regulated User by whom,
or on whose behalf, that data was obtained from PharmaNet; and
</li>
<li>
<strong>"Use"</strong> includes to collect, access, retain, use, de-identify, and disclose.
</li>
</ol>
<p>
The PharmaNet Data disclosed under this Agreement is disclosed by the Province solely for the Use of the
Responsible
User to whom it is disclosed.
</p>
<p>
Organization must not Use any PharmaNet Data, or permit any third party to Use PharmaNet Data, unless the
Responsible
User has authorized such Use and it is otherwise permitted under the Act, applicable law, and the limits and
conditions imposed by the Province on the Responsible User.
</p>
</li>
<li>
<p>
Organization must make all reasonable arrangements to protect PharmaNet Data against such risks as
unauthorized access,
collection, use, modification, retention, disclosure or disposal, including by:
</p>
<ol type=""a"">
<li>
taking all reasonable physical, technical and operational measures necessary to ensure Site Access operates
in
accordance with sections 3.1 to 3.9 above, and
</li>
<li>
complying with the requirements of Schedule A.
</li>
</ol>
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 4 – NON-COMPLIANCE AND INVESTIGATIONS</strong>
</p>
<ol type=""1""
start=""4""
class=""decimal"">
<li>
<ol type=""1"">
<li>
Organization must promptly notify the Province, and provide particulars, if Organization does not comply, or
anticipates
that it will be unable to comply, with the terms of this Agreement, or if Organization has knowledge of any
circumstances,
incidents or events which have or may jeopardize the security, confidentiality or integrity of PharmaNet,
including any
attempt by any person to gain unauthorized access to PharmaNet or the networks or equipment used to connect to
PharmaNet
or convey PharmaNet Data.
</li>
<li>
Organization must immediately investigate any suspected breaches of this Agreement and take all reasonable steps
to prevent
recurrences of any such breaches.
</li>
<li>
Organization must cooperate with any audits or investigations conducted by the Province (including any
independent auditor
appointed by the Province) regarding compliance with this Agreement, including by providing access upon request
to a Site
and any associated facilities, networks, equipment, systems, books, records and personnel for the purposes of
such audit
or investigation.
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 5 – SITE TERMINATION</strong>
</p>
<ol type=""1""
start=""5""
class=""decimal"">
<li>
<ol type=""1"">
<li>
<p>
The Province may terminate all Site Access at a Site immediately, upon notice to the Signing Authority for the
Site, if:
</p>
<ol type=""a"">
<li>
the Approved SSO for the Site is no longer approved by the Province to provide information technology
hardware, software,
or service in connection with PharmaNet, or
</li>
<li>
the Province determines that the SSO-Provided Technology or Associated Technology in use at the Site, or any
component
thereof, is obsolete, unsupported, or otherwise poses an unacceptable security risk to PharmaNet,
</li>
</ol>
<p>
and the Organization is unable or unwilling to remedy the problem within a timeframe acceptable to the
Province.
</p>
</li>
<li>
As a security precaution, the Province may suspend Site Access at a Site after a period of inactivity. If Site
Access at a
Site remains inactive for a period of 90 days or more, the Province may, immediately upon notice to the Signing
Authority
for the Site, terminate all further Site Access at the Site.
</li>
<li>
Organization must prevent all further Site Access at a Site immediately upon the Province’s termination, in
accordance with
this Article 5, of Site Access at the Site.
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 6 – TERM AND TERMINATION</strong>
</p>
<ol type=""1""
start=""6""
class=""decimal"">
<li>
<ol type=""1"">
<li>
The term of this Agreement begins on the date first noted above and continues until it is terminated
in accordance with this Article 6.
</li>
<li>
Organization may terminate this Agreement at any time on notice to the Province.
</li>
<li>
The Province may terminate this Agreement immediately upon notice to Organization if Organization fails to
comply with any
provision of this Agreement.
</li>
<li>
The Province may terminate this Agreement immediately upon notice to Organization in the event Organization no
longer operates
any Sites where Site Access is permitted.
</li>
<li>
The Province may terminate this Agreement for any reason upon two (2) months advance notice to Organization.
</li>
<li>
Organization must prevent any further Site Access immediately upon termination of this Agreement.
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 7 – DISCLAIMER AND INDEMNITY</strong>
</p>
<ol type=""1""
start=""7""
class=""decimal"">
<li>
<ol type=""1"">
<li>
The PharmaNet access and PharmaNet Data provided under this Agreement are provided "as is" without
warranty of any kind,
whether express or implied. All implied warranties, including, without limitation, implied warranties of
merchantability,
fitness for a particular purpose, and non-infringement, are hereby expressly disclaimed. The Province does not
warrant
the accuracy, completeness or reliability of the PharmaNet Data or the availability of PharmaNet, or that access
to or
the operation of PharmaNet will function without error, failure or interruption.
</li>
<li>
Under no circumstances will the Province be liable to any person or business entity for any direct, indirect,
special,
incidental, consequential, or other damages based on any use of PharmaNet or the PharmaNet Data, including
without
limitation any lost profits, business interruption, or loss of programs or information, even if the Province has
been specifically advised of the possibility of such damages.
</li>
<li>
Organization must indemnify and save harmless the Province, and the Province’s employees and agents (each an
<strong>""Indemnified Person""</strong>) from any losses, claims, damages, actions, causes of action, costs and
expenses that an Indemnified Person may sustain, incur, suffer or be put to at any time, either before or after
this Agreement ends, which are based upon, arise out of or occur directly or indirectly by reason of any act
or omission by Organization, or by any Authorized User at the Site, in connection with this Agreement.
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>ARTICLE 8 – GENERAL</strong>
</p>
<ol type=""1""
start=""8""
class=""decimal"">
<li>
<ol type=""1"">
<li>
<p>
<strong class=""underline"">Notice.</strong> Except where this Agreement expressly provides for another method
of delivery, any notice to be given to the Province must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Innovation<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
<p>
Any notice to be given to a Signing Authority or the Organization will be in writing and emailed, mailed,
faxed
or text messaged to the Signing Authority (in the case of notice to a Signing Authority) or all Signing
Authorities (in the case of notice to the Organization). A Signing Authority may be required to click a
URL link or to log in to the Province’s "PRIME" system to receive the content of any such notice.
</p>
<p>
Any written notice from a party, if sent electronically, will be deemed to have been received 24 hours after
the
time the notice was sent, or, if sent by mail, will be deemed to have been received 3 days (excluding
Saturdays,
Sundays and statutory holidays) after the date the notice was sent.
</p>
</li>
<li>
<strong class=""underline"">Waiver.</strong> The failure of the Province at any time to insist on performance of
any
provision of this Agreement by Organization is not a waiver of its right subsequently to insist on performance
of
that or any other provision of this Agreement. A waiver of any provision or breach of this Agreement is
effective
only if it is writing and signed by, or on behalf of, the waiving party.
</li>
<li>
<p>
<strong class=""underline"">Modification.</strong> No modification to this Agreement is effective unless it is
in writing and signed
by, or on behalf of, the parties.
</p>
<p>
Notwithstanding the foregoing, the Province may amend this Agreement, including the Schedules and this
section,
at any time in its sole discretion, by written notice to Organization, in which case the amendment will become
effective upon the later of: (i) the date notice of the amendment is delivered to Organization; and (ii) the
effective date of the amendment specified by the Province. The Province will make reasonable efforts to
provide
at least thirty (30) days advance notice of any such amendment, subject to any determination by the Province
that a shorter notice period is necessary due to changes in the Act, applicable law or applicable policies of
the Province, or is necessary to maintain privacy and security in relation to PharmaNet or PharmaNet Data.
</p>
<p>
If Organization does not agree with any amendment for which notice has been provided by the Province in
accordance with this section, Organization must promptly (and in any event prior to the effective date)
cease Site Access at all Sites and take the steps necessary to terminate this Agreement in accordance
with Article 6.
</p>
</li>
<li>
<p>
<strong class=""underline"">Governing Law.</strong> This Agreement will be governed by and will be construed
and interpreted in accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
</ol>
</li>
</ol>
<p class=""text-center"">
<strong>SCHEDULE A – SPECIFIC PRIVACY AND SECURITY MEASURES</strong>
</p>
<p>
Organization must, in relation to each Site and in relation to Remote Access:
</p>
<ol type=""a"">
<li>
secure all workstations and printers at the Site to prevent any viewing of PharmaNet Data by persons other
than Authorized Users;
</li>
<li>
<p>
implement all privacy and security measures specified in the following documents published by the Province, as
amended from time to time:
</p>
<ol type=""i"">
<li>
<p>
the PharmaNet Professional and Software Conformance Standards
</p>
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards""
target=""_blank""
rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards
</a>
</li>
<li>
<p>
Office of the Chief Information Officer: "Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity"
</p>
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/system-access/requirements-for-wireless-access-to-pharmanet""
target=""_blank""
rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/system-access/requirements-for-wireless-access-to-pharmanet
</a>
</li>
<li>
<p>
Policy for Secure Remote Access to PharmaNet
</p>
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards""
target=""_blank""
rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards
</a>
</li>
</ol>
</li>
<li>
ensure that a qualified technical support person is engaged to provide security support for the Site. This person
should be familiar with the Site’s network configurations, hardware and software, including all SSO-Provided
Technology
and Associated Technology, and should be capable of understanding and adhering to the standards set forth in this
Agreement and Schedule. Note that any such qualified technical support person must not be permitted by Organization
to access or use PharmaNet in any manner, unless otherwise permitted under this Agreement;
</li>
<li>
establish and maintain documented privacy policies that detail how Organization will meet its privacy obligations
in relation to the Site;
</li>
<li>
establish breach reporting and response processes in relation to the Site;
</li>
<li>
detail expectations for privacy protection in contracts and service agreements as applicable at the Site;
</li>
<li>
regularly review the administrative, physical and technological safeguards at the Site;
</li>
<li>
establish and maintain a program for monitoring PharmaNet use at the Site, including by making appropriate
monitoring
and reporting mechanisms available to Authorized Users for this purpose.
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 12,
AgreementType = 5,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<p class=""text-center"">
This Agreement is made the {{day}} day of {{month}}, {{year}}
</p>
<h1>---- PLACEHOLDER TEXT ----</h1>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 13,
AgreementType = 1,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 10, 22, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<h1>PHARMANET USER TERMS OF ACCESS FOR PHARMACISTS</h1>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to ensure
that appropriate measures are in place to protect the confidentiality of all such information. All access to and
use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Act”</strong> means the <em>Pharmaceutical Services Act</em>.
</li>
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which you provide Direct Patient Care
and which is approved by the Province for PharmaNet access.
</li>
<li>
<strong>“Approved SSO”</strong> means a software support organization approved by the Province that provides
you with the information technology software and/or services through which you and On-Behalf-of Users access
PharmaNet.
</li>
<li>
<strong>“Claim”</strong> means a claim made under the Act for payment in respect of a benefit under the Act.
</li>
<li>
<p>
<strong>“Conformance Standards”</strong> means the following documents published by the Province, as
amended from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards<br>
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards"" target=""_blank"" rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards
</a>; and
</li>
<li>
Office of the Chief Information Officer: “Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity”.
<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/system-access/requirements-for-wireless-access-to-pharmanet"" target=""_blank"" rel=""noopener noreferrer"">
https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/system-access/requirements-for-wireless-access-to-pharmanet
</a>
</li>
</ol>
</li>
<li>
<strong>“Device Provider”</strong> means a person enrolled under section 11 of the Act in the class of
provider known as “device provider”.
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>“Information Management Regulation”</strong> means the <em>Information Management Regulation</em>,
B.C. Reg.
74/2015.
</li>
<li>
<strong>“On-Behalf-of User”</strong> means a member of your staff who (i) requires access to PharmaNet to
carry out duties in relation to your Practice; (ii) is authorized by you to access PharmaNet on your behalf;
and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“Personal Information”</strong> means all recorded information that is about an identifiable
individual or is defined as, or deemed to be, “personal information” or “personal health information”
pursuant to any Privacy Laws.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the Information Management
Regulation.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record
or information in the custody, control or possession of you or an On-Behalf-of User that was obtained
through your or an On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>“Practice”</strong> means your practice of the health profession regulated under the <em>Health
Professions Act</em>, or your practice as a Device Provider, as identified by you through PRIME
or another mechanism provided by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for,
and manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Privacy Laws”</strong> means the Act, the
<em>Freedom of Information and Protection of Privacy Act</em>, the Personal Information Protection Act, and
any other statutory or legal obligations of privacy owed by you or the Province, whether arising under
statute, by contract or at common law.
</li>
<li>
<strong>“Provider”</strong> means a person enrolled under section 11 of the Act for the purpose of receiving
payment for providing benefits.
</li>
<li>
<strong>“Provider Regulation”</strong> means the <em>Provider Regulation</em>, B.C. Reg. 222/2014.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
<li>
<strong>“Professional College”</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>“Unauthorized Person”</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the <em>Information Management Regulation</em>.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any further limits
or conditions communicated to you in writing by the Province, unless the conflicting provision expressly
states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act, the
Information Management Regulation and all Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
specific provisions of the Act (including but not limited to sections 24, 25 and 29) and the Information
Management Regulation apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in this Agreement. The Province may from time to time, at its
discretion, amend or change the scope of your access privileges to PharmaNet as privacy, security, business and
clinical practice requirements change. In such circumstances, the Province will use reasonable efforts to notify
you of such changes.
</li>
<li>
<p>
<strong>Requirements for Access.</strong> The following requirements apply to your access to PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your registration permits
you to deliver Direct Patient Care requiring access to PharmaNet or, in the case of access as a Device
Provider, for so long as you are enrolled as a Device Provider;
</li>
<li>
you will only access PharmaNet: at the Approved Practice Site, and using only the technologies and
applications approved by the Province;
</li>
<li>
you must ensure that your On-Behalf-of-Users do not access PharmaNet on your behalf unless the access takes
place at the Approved Practice Site and the access is required in relation to patients for whom you will be
providing Direct Patient Care at the Approved Practice Site;
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct Patient Care;
</li>
<li>
you will not submit Claims on PharmaNet other than from an Approved Practice Site in respect of which a
person is enrolled as a Provider, and you will ensure that On-Behalf-of Users submit Claims on PharmaNet
only from an Approved Practice Site in respect of which a person is enrolled as a Provider;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of quality improvement, evaluation, health care planning, surveillance,
research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as
required by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Approved Practice Site to prevent
viewing of PharmaNet Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and
prohibit sharing or other multiple use of your access credential, or an On-Behalf-of User’s access
credential, for access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access
to PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards.</strong> You will comply with, and will ensure On-Behalf-of Users comply with,
the rules specified in the Conformance Standards when accessing and recording information in PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with the
Act, the Provider Regulation, and Professional College requirements and in connection with your provision of
Direct Patient Care and otherwise is in compliance with the Conformance Standards. You will not modify any
records retained in accordance with this section other than as may be expressly authorized in the Conformance
Standards. For clarity, you may annotate a discrete record provided that the discrete record is not itself
modified other than as expressly authorized in the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or “print outs” produced directly from PharmaNet, and will refer any requests for access to such records or
“print outs” to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record Contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON-COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non-Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet Access.</strong> If the Province suspends or terminates your
right, or an On-Behalf-of User’s right, to access PharmaNet under the
<em>Information Management Regulation</em>, the Province may also terminate this Agreement at any time
thereafter upon written notice to you.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by Operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the
<em>Information Management Regulation</em>.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an “as is” and “as available”
basis without warranty or condition of any kind. The Province does not warrant the accuracy, completeness or
reliability of the PharmaNet Data or the availability of PharmaNet, or that access to or the operation of
PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You Are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province If You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement or in connection with access to PharmaNet by you or an
On-Behalf-of User.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective, must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Innovation<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content of
any such notice.
</li>
<li>
<strong>Deemed Receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent by
mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays) after
the date the notice was sent.
</li>
<li>
<strong>Substitute Contact Information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(vi) (vii), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province May Modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 14,
AgreementType = 6,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Text = @"<h1>
PHARMANET TERMS OF ACCESS FOR PHARMACY OR DEVICE PROVIDER ON-BEHALF-OF USER
</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<p class=""bold underline"">
On-Behalf-of User Access
</p>
<ol>
<li>
<p>
You represent and warrant to the Province that:
</p>
<ol type=""a"">
<li>
your employment duties in relation to a Practitioner require you to access PharmaNet (and PharmaNet Data) to
support the Practitioner’s delivery of Direct Patient Care;
</li>
<li>
you are directly supervised by a Practitioner, who has been granted access to PharmaNet by the Province; and
</li>
<li>
all information provided by you in connection with your application for PharmaNet access, including all
information submitted through PRIME, is true and correct.
</li>
</ol>
</li>
</ol>
<p class=""bold underline"">
Definitions
</p>
<ol start=""2"">
<li>
<p>
In these terms, capitalized terms will have the following meanings:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which a Practitioner provides Direct
Patient Care and which is approved by the Province for PharmaNet access. For greater certainty, “Approved
Practice Site” does not include a location from which remote access to PharmaNet takes place.
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom a Practitioner provides direct patient care in the context of their Practice.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">http://www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the <em>Information Management
Regulation, B.C</em>. Reg. 74/2015.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record or
information in the custody, control or possession of you or a Practitioner that was obtained through access to
PharmaNet by anyone.
</li>
<li>
<strong>“Practice”</strong> means a Practitioner’s practice of their health profession.
</li>
<li>
<strong>“Practitioner”</strong> means a health professional regulated under the <em>Health Professions Act</em>,
or an
enrolled device provider under the <em>Provider Regulation</em>, B.C. Reg. 222/2014,who supervises your access
to and use of PharmaNet and who has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for, and
manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
</ul>
</li>
<li>
Unless otherwise specified, a reference to a statute or regulation by name means the statute or regulation of
British Columbia of that name, as amended or replaced from time to time, and includes any enactment made under the
authority of that statute or regulation.
</li>
</ol>
<p class=""bold underline"">
Terms of Access to PharmaNet
</p>
<ol start=""4"">
<li>
<p>
You must:
</p>
<ol type=""a"">
<li>
access and use PharmaNet and PharmaNet Data only at the Approved Practice Site of a Practitioner;
</li>
<li>
access and use PharmaNet and PharmaNet Data only to support Direct Patient Care delivered by a Practitioner to
the individuals whose PharmaNet Data you are accessing, and only if the Practitioner is or will be delivering
Direct Patient Care requiring that access to those individuals at the same Approved Practice Site at which the
access occurs;
</li>
<li>
only access PharmaNet as permitted by law and directed by a Practitioner;
</li>
<li>
maintain all PharmaNet Data, whether accessed on PharmaNet or otherwise disclosed to you in any manner, in
strict confidence;
</li>
<li>
maintain the security of PharmaNet, and any applications, connections, or networks used to access PharmaNet;
</li>
<li>
complete all training required by the Approved Practice Site’s PharmaNet software vendor and the Province before
accessing PharmaNet;
</li>
<li>
notify the Province if you have any reason to suspect that PharmaNet, or any PharmaNet Data, is or has been
accessed or used inappropriately by any person.
</li>
</ol>
</li>
<li>
<p>
You must not:
</p>
<ol type=""a"">
<li>
disclose PharmaNet Data for any purpose other than Direct Patient Care, except as permitted by law and directed
by a Practitioner;
</li>
<li>
permit any person to use any user IDs, passwords or credentials provided to you to access PharmaNet;
</li>
<li>
reveal, share or compromise any user IDs, passwords or credentials for PharmaNet;
</li>
<li>
use, or attempt to use, the user IDs, passwords or credentials of any other person to access PharmaNet;
</li>
<li>
take any action that might compromise the integrity of PharmaNet, its information, or the provincial drug plan,
such as altering information or submitting false information;
</li>
<li>
test the security related to PharmaNet;
</li>
<li>
attempt to access PharmaNet from any location other than the Approved Practice Site of a Practitioner, including
by VPN or other remote access technology;
</li>
<li>
access PharmaNet unless the access is for the purpose of supporting a Practitioner in providing Direct Patient
Care to a patient at the same Approved Practice Site at which your access occurs;
</li>
<li>
use PharmaNet to submit claims to PharmaCare or a third-party insurer unless directed to do so by a Practitioner
at an Approved Practice Site that is enrolled as a provider or device provider under the
<em>Provider Regulation</em>, B.C. Reg. 222/2014.
</li>
</ol>
</li>
</ol>
<ol start=""6"">
<li>
Your access to PharmaNet and use of PharmaNet Data are governed by the Pharmaceutical Services Act and you must
comply with all your duties under that Act.
</li>
<li>
The Province may, in writing and from time to time, set further limits and conditions in respect of PharmaNet,
either for you or for the Practitioner(s), and that you must comply with any such further limits and conditions.
</li>
</ol>
<p class=""bold underline"">
How to Notify the Province
</p>
<ol start=""8"">
<li>
<p>
Notice to the Province may be sent in writing to:
</p>
<address>
Director, Information and PharmaNet Innovation<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
</ol>
<p class=""bold underline"">
Province May Modify These Terms
</p>
<ol start=""9"">
<li>
<p>
The Province may amend these terms, including this section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified by the
Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will specify
the effective date of the amendment, which date will be at least thirty (30) days after the date that the
PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with (i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with (i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
</li>
</ol>
<p class=""bold underline"">
Governing Law
</p>
<ol start=""10"">
<li>
<p>
These terms will be governed by and will be construed and interpreted in accordance with the laws of British
Columbia and the laws of Canada applicable therein.
</p>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 15,
AgreementType = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 11, 12, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -8, 0, 0, 0)),
Text = @"<h1>
PHARMANET TERMS OF ACCESS FOR ON-BEHALF-OF USER<br>
</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the “Agreement”). Please read them carefully.
</p>
<p class=""bold underline"">
On Behalf-of-User Access
</p>
<ol>
<li>
<p>
You represent and warrant to the Province that:
</p>
<ol type=""a"">
<li>
your employment duties in relation to a Practitioner require you to access PharmaNet (and PharmaNet Data) to
support the Practitioner’s delivery of Direct Patient Care;
</li>
<li>
you are directly supervised by a Practitioner who has been granted access to PharmaNet by the Province; and
</li>
<li>
all information provided by you in connection with your application for PharmaNet access, including all
information submitted through PRIME, is true and correct.
</li>
</ol>
</li>
</ol>
<p class=""bold underline"">
Definitions
</p>
<ol start=""2"">
<li>
<p>
In these terms, capitalized terms will have the following meanings:
</p>
<ul class=""list-unstyled"">
<li>
<strong>“Approved Practice Site”</strong> means the physical site at which a Practitioner provides Direct
Patient Care and which is approved by the Province for PharmaNet access. For greater certainty, “Approved
Practice Site” does not include a location from which remote access to PharmaNet takes place.
</li>
<li>
<strong>“Direct Patient Care”</strong> means, for the purposes of this Agreement, the provision of health
services to an individual to whom a Practitioner provides direct patient care in the context of their Practice.
</li>
<li>
<strong>“PharmaCare Newsletter”</strong> means the PharmaCare newsletter published by the Province on the
following website (or such other website as may be specified by the Province from time to time for this
purpose):
<br><br>
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">www.gov.bc.ca/pharmacarenewsletter</a>
</li>
<li>
<strong>“PharmaNet”</strong> means PharmaNet as continued under section 2 of the <em>Information Management
Regulation</em>, B.C. Reg. 74/2015.
</li>
<li>
<strong>“PharmaNet Data”</strong> includes any record or information contained in PharmaNet and any record or
information in the custody, control or possession of you or a Practitioner that was obtained through access to
PharmaNet by anyone.
</li>
<li>
<strong>“Practice”</strong> means a Practitioner’s practice of their health profession.
</li>
<li>
<strong>“Practitioner”</strong> means a health professional regulated under the <em>Health Professions Act</em>,
or an enrolled device provide under the <em>Provider Regulation</em> B.C. Reg. 222/2014, who supervises your
access to and use of PharmaNet and who has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>“PRIME”</strong> means the online service provided by the Province that allows users to apply for, and
manage, their access to PharmaNet, and through which users are granted access by the Province.
</li>
<li>
<strong>“Province”</strong> means Her Majesty the Queen in Right of British Columbia, as represented by the
Minister of Health.
</li>
</ul>
</li>
<li>
Unless otherwise specified, a reference to a statute or regulation by name means the statute or regulation of
British Columbia of that name, as amended or replaced from time to time, and includes any enactment made under the
authority of that statute or regulation.
</li>
</ol>
<p class=""bold underline"">
Terms of Access to PharmaNet
</p>
<ol start=""4"">
<li>
<p>
You must:
</p>
<ol type=""a"">
<li>
access and use PharmaNet and PharmaNet Data only at the Approved Practice Site of a Practitioner;
</li>
<li>
access and use PharmaNet and PharmaNet Data only to support Direct Patient Care delivered by a Practitioner to
the individuals whose PharmaNet Data you are accessing, and only if the Practitioner is or will be delivering
Direct Patient Care requiring that access to those individuals at the same Approved Practice Site at which the
access occurs;
</li>
<li>
only access PharmaNet as permitted by law and directed by a Practitioner;
</li>
<li>
maintain all PharmaNet Data, whether accessed on PharmaNet or otherwise disclosed to you in any manner, in
strict confidence;
</li>
<li>
maintain the security of PharmaNet, and any applications, connections, or networks used to access PharmaNet;
</li>
<li>
complete all training required by the Approved Practice Site’s PharmaNet software vendor and the Province before
accessing PharmaNet;
</li>
<li>
notify the Province if you have any reason to suspect that PharmaNet, or any PharmaNet Data, is or has been
accessed or used inappropriately by any person.
</li>
</ol>
</li>
<li>
<p>
You must not:
</p>
<ol type=""a"">
<li>
disclose PharmaNet Data for any purpose other than Direct Patient Care, except as permitted by law and
directed by a Practitioner;
</li>
<li>
permit any person to use any user IDs, passwords or credentials provided to you to access PharmaNet;
</li>
<li>
reveal, share or compromise any user IDs, passwords or credentials for PharmaNet;
</li>
<li>
use, or attempt to use, the user IDs, passwords or credentials of any other person to access PharmaNet;
</li>
<li>
take any action that might compromise the integrity of PharmaNet, its information, or the provincial drug plan,
such as altering information or submitting false information;
</li>
<li>
test the security related to PharmaNet;
</li>
<li>
attempt to access PharmaNet from any location other than the Approved Practice Site of a Practitioner,
including by VPN or other remote access technology;
</li>
<li>
access PharmaNet unless the access is for the purpose of supporting a Practitioner in providing Direct
Patient Care to a patient at the same Approved Practice Site at which your access occurs.
</li>
</ol>
</li>
</ol>
<ol start=""6"">
<li>
Your access to PharmaNet and use of PharmaNet Data are governed by the <em>Pharmaceutical Services Act</em> and you
must comply with all your duties under that Act.
</li>
<li>
The Province may, in writing and from time to time, set further limits and conditions in respect of PharmaNet,
either for you or for the Practitioner(s), and that you must comply with any such further limits and conditions.
</li>
</ol>
<p class=""bold underline"">
How to Notify the Province
</p>
<ol start=""8"">
<li>
<p>
Notice to the Province may be sent in writing to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
</ol>
<p class=""bold underline"">
Province May Modify These Terms
</p>
<ol start=""9"">
<li>
<p>
The Province may amend these terms, including this section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the date
notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified by the
Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will specify
the effective date of the amendment, which date will be at least thirty (30) days after the date that the
PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you do not agree with any amendment for which notice has been provided by the Province in accordance with (i)
or (ii) above, you must promptly (and in any event before the effective date) cease all access or use of
PharmaNet.
</p>
<p>
Any written notice to you under (i) above will be in writing and delivered by the Province to you using any of the
contact mechanisms identified by you in PRIME, including by mail to a specified postal address, email to a
specified email address or text message to a specified cell phone number. You may be required to click a URL link
or log into PRIME to receive the contents of any such notice.
</p>
</li>
</ol>
<p class=""bold underline"">
Governing Law
</p>
<ol start=""10"">
<li>
<p>
These terms will be governed by and will be construed and interpreted in accordance with the laws of British
Columbia and the laws of Canada applicable therein.
</p>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 16,
AgreementType = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EffectiveDate = new DateTimeOffset(new DateTime(2020, 11, 27, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -8, 0, 0, 0)),
Text = @"<h1>PHARMANET REGULATED USER TERMS OF ACCESS</h1>
<p class=""bold"">
By enrolling for PharmaNet access, you agree to the following terms (the "Agreement"). Please read them carefully.
</p>
<ol>
<li>
<p class=""bold underline"">
BACKGROUND
</p>
<p>
The Province owns and is responsible for the operation of PharmaNet, the province-wide network that links B.C.
pharmacies to a central data system. Every prescription dispensed in community pharmacies in B.C. is entered into
PharmaNet.
</p>
<p>
The purpose of providing you, and the On-Behalf-of Users whom you have authorized, with access to PharmaNet is to
enhance patient care by providing timely and relevant information to persons involved in the provision of direct
patient care.
</p>
<p class=""bold underline"">
PharmaNet contains highly sensitive confidential information, including Personal Information and the proprietary
and confidential information of third-party licensors to the Province, and it is in the public interest to ensure
that appropriate measures are in place to protect the confidentiality of all such information. All access to and
use of PharmaNet and PharmaNet Data is subject to the Act and Privacy Laws.
</p>
</li>
<li>
<p class=""bold underline"">
INTERPRETATION
</p>
<ol type=""a"">
<li>
<p>
<strong>Definitions.</strong> Unless otherwise provided in this Agreement, capitalized terms will have the
meanings given below:
</p>
<ul>
<li>
<strong>"Act"</strong> means the <em>Pharmaceutical Services Act</em>.
</li>
<li>
<strong>"Approved Practice Site"</strong> means the physical site at which you provide Direct
Patient Care and which is approved by the Province for PharmaNet access. For greater certainty,
"Approved Practice Site" does not include a location from which remote access to PharmaNet takes
place;
</li>
<li>
<strong>"Approved SSO"</strong> means a software support organization approved by the Province
that provides you with the information technology software and/or services through which you and
On-Behalf-of Users access PharmaNet.
</li>
<li>
<p>
<strong>"Conformance Standards"</strong> means the following documents published by the
Province, as amended from time to time:
</p>
<ol type=""i"">
<li>
PharmaNet Professional and Software Conformance Standards; and
</li>
<li>
Office of the Chief Information Officer: "Submission for Technical Security Standard and High Level
Architecture for Wireless Local Area Network Connectivity".
</li>
</ol>
</li>
<li>
<strong>"Direct Patient Care"</strong> means, for the purposes of this Agreement, the provision of
health services to an individual to whom you provide direct patient care in the context of your Practice.
</li>
<li>
<strong>"Information Management Regulation"</strong> means the Information Management Regulation,
B.C. Reg. 74/2015.
</li>
<li>
<strong>"On-Behalf-of User"</strong> means a member of your staff who (i) requires access to
PharmaNet to carry out duties in relation to your Practice; (ii) is authorized by you to access PharmaNet
on your behalf; and (iii) has been granted access to PharmaNet by the Province.
</li>
<li>
<strong>"Personal Information"</strong> means all recorded information that is about an
identifiable individual or is defined as, or deemed to be, "personal information" or
"personal health information" pursuant to any Privacy Laws.
</li>
<li>
<strong>"PharmaCare Newsletter"</strong> means the PharmaCare newsletter published by the Province
on the following website (or such other website as may be specified by the Province from time to time for
this purpose):
<a href=""http://www.gov.bc.ca/pharmacarenewsletter"" target=""_blank"" rel=""noopener noreferrer"">
www.gov.bc.ca/pharmacarenewsletter
</a>
</li>
<li>
<strong>"PharmaNet"</strong> means PharmaNet as continued under section 2 of the Information
Management Regulation.
</li>
<li>
<strong>"PharmaNet Data"</strong> includes any record or information contained in PharmaNet and
any record or information in the custody, control or possession of you or an On-Behalf-of User that was
obtained through your or an On-Behalf-of User’s access to PharmaNet.
</li>
<li>
<strong>"Practice"</strong> means your practice of the health profession regulated under the
<em>Health Professions Act</em>, or your practice as an enrolled device provider under the Provider
Regulation, B.C. Reg. 222/2014, as identified by you through PRIME.
</li>
<li>
<strong>"PRIME"</strong> means the online service provided by the Province that allows users to
apply for, and manage, their access to PharmaNet, and through which users are granted access by the
Province.
</li>
<li>
<strong>"Privacy Laws"</strong> means the Act, the <em>Freedom of Information and Protection of
Privacy Act</em>, the <em>Personal Information Protection Act</em>, and any other statutory or legal
obligations of privacy owed by you or the Province, whether arising under statute, by contract or at common
law.
</li>
<li>
<strong>"Province"</strong> means Her Majesty the Queen in Right of British Columbia, as
represented by the Minister of Health.
</li>
<li>
<strong>"Professional College"</strong> is the regulatory body governing your Practice.
</li>
<li>
<p>
<strong>"Unauthorized Person"</strong> means any person other than:
</p>
<ol type=""i"">
<li>
you,
</li>
<li>
an On-Behalf-of User, or
</li>
<li>
a representative of an Approved SSO that is accessing PharmaNet for technical support purposes in
accordance with section 6 of the <em>Information Management Regulation</em>.
</li>
</ol>
</li>
</ul>
</li>
<li>
<strong>Reference to Enactments.</strong> Unless otherwise specified, a reference to a statute or regulation by
name means the statute or regulation of British Columbia of that name, as amended or replaced from time to time,
and includes any enactment made under the authority of that statute or regulation.
</li>
<li>
<p>
<strong>Conflicting Provisions.</strong> In the event of a conflict among provisions of this Agreement:
</p>
<ol type=""i"">
<li>
a provision in the body of this Agreement will prevail over any conflicting provision in any further
limits or conditions communicated to you in writing by the Province, unless the conflicting provision
expressly states otherwise; and
</li>
<li>
a provision referred to in (i) above will prevail over any conflicting provision in the Conformance
Standards.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
APPLICATION OF LEGISLATION
</p>
<p>
You will strictly comply with, and you will ensure that On-Behalf-of Users strictly comply with, the Act and all
Privacy Laws applicable to PharmaNet and PharmaNet Data.
</p>
</li>
<li>
<p class=""bold underline"">
NOTICE THAT SPECIFIC PROVISIONS OF THE ACT APPLY DIRECTLY TO YOU
</p>
<p>
You acknowledge that:
</p>
<ol type=""a"">
<li>
PharmaNet Data accessed by you or an On-Behalf-of User pursuant to this Agreement is disclosed to you by the
Province under the authority of the Act;
</li>
<li>
specific provisions of the Act, including the <em>Information Management Regulation</em> and sections 24, 25 and
29 of the Act, apply directly to you and to On-Behalf-of Users as a result; and
</li>
<li>
this Agreement documents limits and conditions, set by the minister in writing, that the Act requires you to
comply with.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCESS
</p>
<ol type=""a"">
<li>
<strong>Grant of Access.</strong> The Province will provide you with access to PharmaNet subject to your
compliance with the limits and conditions set out in section 5(b) below and otherwise in this Agreement. The
Province may from time to time, at its discretion, amend or change the scope of your access privileges to
PharmaNet as privacy, security, business and clinical practice requirements change. In such circumstances, the
Province will use reasonable efforts to notify you of such changes.
</li>
<li>
<p>
<strong>Limits and Conditions of Access.</strong> The following limits and conditions apply to your access to
PharmaNet:
</p>
<ol type=""i"">
<li>
you will only access PharmaNet, and you will ensure that On-Behalf-of Users only access PharmaNet, for so
long as you are a registrant in good standing with the Professional College and your registration permits
you to deliver Direct Patient Care requiring access to PharmaNet;
</li>
<li>
unless (iii) below applies, you will only access PharmaNet at the Approved Practice Site, and using only the
technologies and applications approved by the Province.
</li>
<li>
<p>
you may only access PharmaNet using remote access technology if all of the following conditions are met:
</p>
<ol>
<li>
the remote access technology used at the Approved Practice Site has been specifically approved in
writing by the Province,
</li>
<li>
the requirements of the Province’s Policy for Remote Access to PharmaNet
(<a href=""https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards"">https://www2.gov.bc.ca/gov/content/health/practitioner-professional-resources/software/conformance-standards</a>) are met,
</li>
<li>
your Approved Practice Site has registered you with the Province for remote access at the Approved
Practice Site,
</li>
<li>
you have applied to the Province for remote access at the Approved Practice Site and the Province has
approved that application in writing, and
</li>
<li>
you are physically located in British Columbia at the time of any such remote access.
</li>
</ol>
</li>
<li>
you must ensure that your On-Behalf-of-Users do not access PharmaNet on your behalf unless the access takes
place at the Approved Practice Site and the access is in relation to patients for whom you will be providing
Direct Patient Care at the Approved Practice Site requiring the access to PharmaNet;
</li>
<li>
you must ensure that your On-Behalf-of Users do not access PharmaNet using VPN or other remote access
technology
</li>
<li>
you will only access PharmaNet as necessary for your provision of Direct Patient Care, and you will ensure
that On-Behalf-of Users only access PharmaNet as necessary to support your provision of Direct Patient Care;
</li>
<li>
you will not under any circumstances access PharmaNet, or use PharmaNet Data, for the purpose of market
research, and you will ensure that no On-Behalf-of Users access PharmaNet, or use PharmaNet Data, for the
purpose of market research;
</li>
<li>
subject to section 6(b) of this Agreement, you will not use PharmaNet Data, and you will ensure that
On-Behalf-of Users do not use PharmaNet Data, for any purpose other than your provision of Direct Patient
Care, including for the purposes of deidentification or aggregation, quality improvement, evaluation, health
care planning, surveillance, research or other secondary uses;
</li>
<li>
you will not permit any Unauthorized Person to access PharmaNet, and you will take all reasonable measures
to ensure that no Unauthorized Person can access PharmaNet;
</li>
<li>
you will complete any training program(s) that your Approved SSO makes available to you in relation to
PharmaNet, and you will ensure that all On-Behalf-of Users complete such training;
</li>
<li>
you will immediately notify the Province when you or an On-Behalf-of User no longer require access to
PharmaNet, including where the On-Behalf-of User ceases to be one of your staff or takes a leave of absence
from your staff, or where the On-Behalf-of User’s access-related duties in relation to the Practice have
changed;
</li>
<li>
you will comply with, and you will ensure that On-Behalf-of Users comply with, any additional limits or
conditions applicable to you, as may be communicated to you by the Province in writing;
</li>
<li>
you represent and warrant that all information provided by you in connection with your application for
PharmaNet access, including through PRIME, is true and correct.
</li>
</ol>
</li>
<li>
<strong>Responsibility for On-Behalf-of Users.</strong> You agree that you are responsible under this Agreement
for all activities undertaken by On-Behalf-of Users in relation to their access to PharmaNet and use of
PharmaNet Data.
</li>
<li>
<p>
<strong>Privacy and Security Measures.</strong> You are responsible for taking all reasonable measures to
safeguard Personal Information, including any Personal Information in the PharmaNet Data while it is in the
custody, control or possession of yourself or an On-Behalf-of User. In particular, you will:
</p>
<ol type=""i"">
<li>
take all reasonable steps to ensure the physical security of Personal Information, generally and as required
by Privacy Laws;
</li>
<li>
secure all workstations and printers in a protected area in the Practice to prevent viewing of PharmaNet
Data by Unauthorized Persons;
</li>
<li>
ensure separate access credential (such as user name and password) for each On-Behalf-of User, and prohibit
sharing or other multiple use of your access credential, or an On-Behalf-of User’s access credential, for
access to PharmaNet;
</li>
<li>
secure any workstations used to access PharmaNet and all devices, codes or passwords that enable access to
PharmaNet by yourself or any On-Behalf-of User;
</li>
<li>
take such other privacy and security measures as the Province may reasonably require from time-to-time.
</li>
</ol>
</li>
<li>
<strong>Conformance Standards.</strong> You will comply with, and will ensure On-Behalf-of Users comply with,
the rules specified in the Conformance Standards when accessing and recording information in PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLOSURE, STORAGE, AND ACCESS REQUESTS
</p>
<ol type=""a"">
<li>
<strong>Retention of PharmaNet Data.</strong> You will not store or retain PharmaNet Data in any paper files or
any electronic system, unless such storage or retention is required for record keeping in accordance with
Professional College requirements and in connection with your provision of Direct Patient Care and otherwise
is in compliance with the Conformance Standards. You will not modify any records retained in accordance with
this section other than as may be expressly authorized in the Conformance Standards. For clarity, you may
annotate a discrete record provided that the discrete record is not itself modified other than as expressly
authorized in the Conformance Standards.
</li>
<li>
<strong>Use of Retained Records.</strong> You may use any records retained by you in accordance with section
6(a) of this Agreement for a purpose authorized under section 24(1) of the Act, including for the purpose of
monitoring your own Practice.
</li>
<li>
<strong>Disclosure to Third Parties.</strong> You will not, and will ensure that On-Behalf-of Users do not,
disclose PharmaNet Data to any Unauthorized Person, unless disclosure is required for Direct Patient Care or is
otherwise authorized under section 24(1) of the Act.
</li>
<li>
<strong>No Disclosure for Market Research.</strong> You will not, and will ensure that On-Behalf-of Users do
not, disclose PharmaNet Data for the purpose of market research.
</li>
<li>
<strong>Responding to Patient Access Requests.</strong> Aside from any records retained by you in accordance
with section 6(a) of this Agreement, you will not provide to patients any copies of records containing PharmaNet
Data or "print outs" produced directly from PharmaNet, and will refer any requests for access to such
records or "print outs" to the Province.
</li>
<li>
<strong>Responding to Requests to Correct a Record contained in PharmaNet.</strong> If you receive a request for
correction of any record or information contained in PharmaNet, you will refer the request to the Province.
</li>
<li>
<strong>Legal Demands for Records Contained in PharmaNet.</strong> You will immediately notify the Province if
you receive any order, demand or request compelling, or threatening to compel, disclosure of records contained
in PharmaNet. You will cooperate and consult with the Province in responding to any such demands. For greater
certainty, the foregoing requires that you notify the Province only with respect to any access requests or
demands for records contained in PharmaNet, and not records retained by you in accordance with section 6(a) of
this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
ACCURACY
</p>
<p>
You will make reasonable efforts to ensure that any Personal Information recorded by you or an On-Behalf-of User
in PharmaNet is accurate, complete and up to date. In the event that you become aware of a material inaccuracy or
error in such information, you will take reasonable steps to investigate the inaccuracy or error, correct it if
necessary, and notify the Province of the inaccuracy or error and any steps taken.
</p>
</li>
<li>
<p class=""bold underline"">
INVESTIGATIONS, AUDITS, AND REPORTING
</p>
<ol type=""a"">
<li>
<strong>Audits and Investigations.</strong> You will cooperate with any audits or investigations conducted by
the Province regarding your, or any On-Behalf-of User’s, compliance with the Act, Privacy Laws and this
Agreement, including providing access upon request to your facilities, data management systems, books, records
and personnel for the purposes of such audit or investigation.
</li>
<li>
<strong>Reports to College or Privacy Commissioner.</strong> You acknowledge and agree that the Province may
report any material breach of this Agreement to your Professional College or to the Information and Privacy
Commissioner of British Columbia.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE OF NON COMPLIANCE AND DUTY TO INVESTIGATE
</p>
<ol type=""a"">
<li>
<strong>Duty to Investigate.</strong> You will investigate suspected breaches of the terms of this Agreement,
and will take all reasonable steps to prevent recurrences of any such breaches, including taking any steps
necessary to cooperate with the Province in ensuring the suspension or termination of an On-Behalf-of User’s
access rights.
</li>
<li>
<p>
<strong>Non Compliance.</strong> You will promptly notify the Province, and provide particulars, if:
</p>
<ol type=""i"">
<li>
you or an On-Behalf-of User do not comply, or you anticipate that you or a On-Behalf-of User will be unable
to comply with the terms of this Agreement in any respect, or
</li>
<li>
you have knowledge of any circumstances, incidents or events which have or may jeopardize the security,
confidentiality, or integrity of PharmaNet, including any unauthorized attempt, by any person, to access
PharmaNet.
</li>
</ol>
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
TERM OF AGREEMENT, SUSPENSION & TERMINATION
</p>
<ol type=""a"">
<li>
<strong>Term.</strong> The term of this Agreement begins on the date you are granted access to PharmaNet by the
Province and will continue until the date this Agreement is terminated under paragraph (b), (c), (d) or (e)
below.
</li>
<li>
<strong>Termination for Any Reason.</strong> You may terminate this Agreement at any time on written notice to
the Province.
</li>
<li>
<strong>Suspension or Termination of PharmaNet access.</strong> If the Province suspends or terminates your
right to access PharmaNet under the <em>Information Management Regulation</em>, this Agreement will
automatically terminate as of the date of such suspension or termination.
</li>
<li>
<strong>Termination for Breach.</strong> Notwithstanding paragraph (c) above, the Province may terminate this
Agreement, and any or all access to PharmaNet by you or an On-Behalf-of User, immediately upon notice to you if
you or an On-Behalf-of User fail to comply with any provision of this Agreement.
</li>
<li>
<strong>Termination by operation of the Information Management Regulation.</strong> This Agreement will
terminate automatically if your access to PharmaNet ends by operation of section 18 of the
<em>Information Management Regulation</em>.
</li>
<li>
<strong>Suspension of Account for Inactivity.</strong> As a security precaution, the Province may suspend your
account or an On-Behalf-of User’s account after a period of inactivity, in accordance with the Province’s
policies. Please contact the Province immediately if your account has been suspended for inactivity but you
still require access to PharmaNet.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
DISCLAIMER OF WARRANTY, LIMITATION OF LIABILITY AND INDEMNITY
</p>
<ol type=""a"">
<li>
<strong>Information Provided As Is.</strong> You acknowledge and agree that any use of PharmaNet and PharmaNet
Data is solely at your own risk. All such access and information is provided on an "as is" and
"as available" basis without warranty or condition of any kind. The Province does not warrant the
accuracy, completeness or reliability of the PharmaNet Data or the availability of PharmaNet, or that access
to or the operation of PharmaNet will function without error, failure or interruption.
</li>
<li>
<strong>You are Responsible.</strong> You are responsible for verifying the accuracy of information disclosed to
you as a result of your access to PharmaNet or otherwise pursuant to this Agreement before relying or acting
upon such information. The clinical or other information disclosed to you or an On-Behalf-of User pursuant to
this Agreement is in no way intended to be a substitute for professional judgment.
</li>
<li>
<strong>The Province Not Liable for Loss.</strong> No action may be brought by any person against the Province
for any loss or damage of any kind caused by any reason or purpose related to reliance on PharmaNet or PharmaNet
Data.
</li>
<li>
<strong>You Must Indemnify the Province if You Cause a Loss or Claim.</strong> You agree to indemnify and save
harmless the Province, and the Province’s employees and agents (each an <strong>""Indemnified Person""</strong>)
from any losses, claims, damages, actions, causes of action, costs and expenses that an Indemnified Person may
sustain, incur, suffer or be put to at any time, either before or after this Agreement ends, which are based
upon, arise out of or occur directly or indirectly by reason of any act or omission by you, or by any
On-Behalf-of User, in connection with this Agreement.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
NOTICE
</p>
<ol type=""a"">
<li>
<p>
<strong>Notice to Province.</strong> Except where this Agreement expressly provides for another method of
delivery, any notice to be given by you to the Province that is contemplated by this Agreement, to be
effective, must be in writing and emailed or mailed to:
</p>
<address>
Director, Information and PharmaNet Development<br>
Ministry of Health<br>
PO Box 9652, STN PROV GOVT<br>
Victoria, BC V8W 9P4<br>
<br>
<a href=""mailto:PRIMESupport@gov.bc.ca"">PRIMESupport@gov.bc.ca</a>
</address>
</li>
<li>
<strong>Notice to You.</strong> Any notice to you to be delivered under the terms of this Agreement will be in
writing and delivered by the Province to you using any of the contact mechanisms identified by you in PRIME,
including by mail to a specified postal address, email to a specified email address or text message to the
specified cell phone number. You may be required to click a URL link or log into PRIME to receive the content
of any such notice.
</li>
<li>
<strong>Deemed receipt.</strong> Any written communication from a party, if personally delivered or sent
electronically, will be deemed to have been received 24 hours after the time the notice was sent, or, if sent
by mail, will be deemed to have been received 3 days (excluding Saturdays, Sundays and statutory holidays)
after the date the notice was sent.
</li>
<li>
<strong>Substitute contact information.</strong> You may notify the Province of a substitute contact mechanism
by updating your contact information in PRIME.
</li>
</ol>
</li>
<li>
<p class=""bold underline"">
GENERAL
</p>
<ol type=""a"">
<li>
<p>
<strong>Severability.</strong> Each provision in this Agreement constitutes a separate covenant and is
severable from any other covenant, and if any of them are held by a court, or other decision-maker, to be
invalid, this Agreement will be interpreted as if such provisions were not included.
</p>
</li>
<li>
<p>
<strong>Survival.</strong> Sections 3, 4, 5(b)(vii) (viii), 5(c), 5(d), 6(a)(b)(c)(d), 8, 9, 11, and any other
provision of this Agreement that expressly or by its nature continues after termination, shall survive
termination of this Agreement.
</p>
</li>
<li>
<p>
<strong>Governing Law.</strong> This Agreement will be governed by and will be construed and interpreted in
accordance with the laws of British Columbia and the laws of Canada applicable therein.
</p>
</li>
<li>
<p>
<strong>Assignment Restricted.</strong> Your rights and obligations under this Agreement may not be assigned
without the prior written approval of the Province.
</p>
</li>
<li>
<p>
<strong>Waiver.</strong> The failure of the Province at any time to insist on performance of any provision of
this Agreement by you is not a waiver of its right subsequently to insist on performance of that or any other
provision of this Agreement.
</p>
</li>
<li>
<p>
<strong>Province may modify this Agreement.</strong> The Province may amend this Agreement, including this
section, at any time in its sole discretion:
</p>
<ol type=""i"">
<li>
by written notice to you, in which case the amendment will become effective upon the later of (A) the
date notice of the amendment is first delivered to you, or (B) the effective date of the amendment specified
by the Province, if any; or
</li>
<li>
by publishing notice of any such amendment in the PharmaCare Newsletter, in which case the notice will
specify the effective date of the amendment, which date will be at least 30 (thirty) days after the date
that the PharmaCare Newsletter containing the notice is first published.
</li>
</ol>
<p>
If you or an On-Behalf-of User access or use PharmaNet after the effective date of an amendment described in
(i) or (ii) above, you will be deemed to have accepted the corresponding amendment, and this Agreement will be
deemed to have been so amended as of the effective date. If you do not agree with any amendment for which
notice has been provided by the Province in accordance with (i) or (ii) above, you must promptly (and in any
event before the effective date) cease all access or use of PharmaNet by yourself and all On-Behalf-of Users,
and take the steps necessary to terminate this Agreement in accordance with section 10.
</p>
</li>
</ol>
</li>
</ol>
",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
});
});
modelBuilder.Entity("Prime.Models.AssignedPrivilege", b =>
{
b.Property<int>("PrivilegeId")
.HasColumnType("integer");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("PrivilegeId", "EnrolleeId");
b.HasIndex("EnrolleeId");
b.ToTable("AssignedPrivilege");
});
modelBuilder.Entity("Prime.Models.AuthorizedUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("EmploymentIdentifier")
.HasColumnType("text");
b.Property<int>("HealthAuthorityCode")
.HasColumnType("integer");
b.Property<int>("PartyId")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("HealthAuthorityCode");
b.HasIndex("PartyId");
b.ToTable("AuthorizedUsers");
});
modelBuilder.Entity("Prime.Models.Banner", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("BannerLocationCode")
.HasColumnType("integer");
b.Property<int>("BannerType")
.HasColumnType("integer");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTime>("EndTimestamp")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("StartTimestamp")
.HasColumnType("timestamp without time zone");
b.Property<string>("Title")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("Banner");
});
modelBuilder.Entity("Prime.Models.BusinessDay", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("Day")
.HasColumnType("integer");
b.Property<TimeSpan>("EndTime")
.HasColumnType("interval");
b.Property<int?>("HealthAuthoritySiteId")
.HasColumnType("integer");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<TimeSpan>("StartTime")
.HasColumnType("interval");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("HealthAuthoritySiteId");
b.HasIndex("SiteId");
b.ToTable("BusinessDay");
});
modelBuilder.Entity("Prime.Models.BusinessEvent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AdminId")
.HasColumnType("integer");
b.Property<int>("BusinessEventTypeCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<int?>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("EventDate")
.HasColumnType("timestamp with time zone");
b.Property<int?>("OrganizationId")
.HasColumnType("integer");
b.Property<int?>("PartyId")
.HasColumnType("integer");
b.Property<int?>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdminId");
b.HasIndex("BusinessEventTypeCode");
b.HasIndex("EnrolleeId");
b.HasIndex("OrganizationId");
b.HasIndex("PartyId");
b.HasIndex("SiteId");
b.ToTable("BusinessEvent");
});
modelBuilder.Entity("Prime.Models.BusinessEventType", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("BusinessEventTypeLookup");
b.HasData(
new
{
Code = 1,
Name = "Status Change"
},
new
{
Code = 2,
Name = "Email"
},
new
{
Code = 3,
Name = "Note"
},
new
{
Code = 4,
Name = "Admin Claim"
},
new
{
Code = 5,
Name = "Enrollee"
},
new
{
Code = 6,
Name = "Site"
},
new
{
Code = 7,
Name = "Admin View"
},
new
{
Code = 8,
Name = "Organization"
},
new
{
Code = 9,
Name = "Pharmanet API Call"
});
});
modelBuilder.Entity("Prime.Models.BusinessLicence", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("DeferredLicenceReason")
.HasColumnType("text");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("SiteId")
.IsUnique();
b.ToTable("BusinessLicence");
});
modelBuilder.Entity("Prime.Models.BusinessLicenceDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("BusinessLicenceId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("BusinessLicenceId")
.IsUnique();
b.ToTable("BusinessLicenceDocument");
});
modelBuilder.Entity("Prime.Models.CareSetting", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("CareSettingLookup");
b.HasData(
new
{
Code = 1,
Name = "Health Authority"
},
new
{
Code = 2,
Name = "Private Community Health Practice"
},
new
{
Code = 3,
Name = "Community Pharmacy"
},
new
{
Code = 4,
Name = "Device Provider"
});
});
modelBuilder.Entity("Prime.Models.Certification", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("CollegeCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<int>("LicenseCode")
.HasColumnType("integer");
b.Property<string>("LicenseNumber")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("PracticeCode")
.HasColumnType("integer");
b.Property<string>("PractitionerId")
.HasColumnType("text");
b.Property<DateTimeOffset>("RenewalDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CollegeCode");
b.HasIndex("EnrolleeId");
b.HasIndex("LicenseCode");
b.HasIndex("PracticeCode");
b.ToTable("Certification");
});
modelBuilder.Entity("Prime.Models.ClientLog", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("CreatedDate")
.HasColumnType("timestamp without time zone");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Data")
.HasColumnType("text");
b.Property<int>("LogType")
.HasColumnType("integer");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("ClientLog");
});
modelBuilder.Entity("Prime.Models.College", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("CollegeLookup");
b.HasData(
new
{
Code = 1,
Name = "College of Physicians and Surgeons of BC (CPSBC)"
},
new
{
Code = 2,
Name = "College of Pharmacists of BC (CPBC)"
},
new
{
Code = 3,
Name = "BC College of Nurses and Midwives (BCCNM)"
},
new
{
Code = 4,
Name = "College of Chiropractors of BC"
},
new
{
Code = 5,
Name = "College of Dental Hygenists of BC"
},
new
{
Code = 6,
Name = "College of Dental Technicians of BC"
},
new
{
Code = 7,
Name = "College of Dental Surgeons of BC"
},
new
{
Code = 8,
Name = "College of Denturists of BC"
},
new
{
Code = 9,
Name = "College of Dietitians of BC"
},
new
{
Code = 10,
Name = "College of Massage Therapists of BC"
},
new
{
Code = 11,
Name = "College of Naturopathic Physicians of BC"
},
new
{
Code = 12,
Name = "College of Occupational Therapists of BC"
},
new
{
Code = 13,
Name = "College of Opticians of BC"
},
new
{
Code = 14,
Name = "College of Optometrists of BC"
},
new
{
Code = 15,
Name = "College of Physical Therapists of BC"
},
new
{
Code = 16,
Name = "College of Psychologists of BC"
},
new
{
Code = 17,
Name = "College of Speech and Hearing Health Professionals of BC"
},
new
{
Code = 18,
Name = "College of Traditional Chinese Medicine Practitioners and Acupuncturists of BC"
});
});
modelBuilder.Entity("Prime.Models.CollegeLicense", b =>
{
b.Property<int>("CollegeCode")
.HasColumnType("integer");
b.Property<int>("LicenseCode")
.HasColumnType("integer");
b.Property<int?>("CollegeLicenseGroupingCode")
.HasColumnType("integer");
b.HasKey("CollegeCode", "LicenseCode");
b.HasIndex("CollegeLicenseGroupingCode");
b.HasIndex("LicenseCode");
b.ToTable("CollegeLicense");
b.HasData(
new
{
CollegeCode = 1,
LicenseCode = 1
},
new
{
CollegeCode = 1,
LicenseCode = 2
},
new
{
CollegeCode = 1,
LicenseCode = 3
},
new
{
CollegeCode = 1,
LicenseCode = 4
},
new
{
CollegeCode = 1,
LicenseCode = 5
},
new
{
CollegeCode = 1,
LicenseCode = 6
},
new
{
CollegeCode = 1,
LicenseCode = 7
},
new
{
CollegeCode = 1,
LicenseCode = 8
},
new
{
CollegeCode = 1,
LicenseCode = 9
},
new
{
CollegeCode = 1,
LicenseCode = 10
},
new
{
CollegeCode = 1,
LicenseCode = 11
},
new
{
CollegeCode = 1,
LicenseCode = 12
},
new
{
CollegeCode = 1,
LicenseCode = 13
},
new
{
CollegeCode = 1,
LicenseCode = 14
},
new
{
CollegeCode = 1,
LicenseCode = 15
},
new
{
CollegeCode = 1,
LicenseCode = 16
},
new
{
CollegeCode = 1,
LicenseCode = 17
},
new
{
CollegeCode = 1,
LicenseCode = 18
},
new
{
CollegeCode = 1,
LicenseCode = 19
},
new
{
CollegeCode = 1,
LicenseCode = 20
},
new
{
CollegeCode = 1,
LicenseCode = 21
},
new
{
CollegeCode = 1,
LicenseCode = 22
},
new
{
CollegeCode = 1,
LicenseCode = 23
},
new
{
CollegeCode = 1,
LicenseCode = 24
},
new
{
CollegeCode = 1,
LicenseCode = 59
},
new
{
CollegeCode = 1,
LicenseCode = 65
},
new
{
CollegeCode = 1,
LicenseCode = 66
},
new
{
CollegeCode = 1,
LicenseCode = 67
},
new
{
CollegeCode = 2,
LicenseCode = 25
},
new
{
CollegeCode = 2,
LicenseCode = 26
},
new
{
CollegeCode = 2,
LicenseCode = 27
},
new
{
CollegeCode = 2,
LicenseCode = 28
},
new
{
CollegeCode = 2,
LicenseCode = 29
},
new
{
CollegeCode = 2,
LicenseCode = 30
},
new
{
CollegeCode = 2,
LicenseCode = 31
},
new
{
CollegeCode = 2,
LicenseCode = 68
},
new
{
CollegeCode = 3,
LicenseCode = 32,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 33,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 34,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 35,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 36,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 37,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 39,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 40,
CollegeLicenseGroupingCode = 2
},
new
{
CollegeCode = 3,
LicenseCode = 41,
CollegeLicenseGroupingCode = 3
},
new
{
CollegeCode = 3,
LicenseCode = 42,
CollegeLicenseGroupingCode = 3
},
new
{
CollegeCode = 3,
LicenseCode = 43,
CollegeLicenseGroupingCode = 3
},
new
{
CollegeCode = 3,
LicenseCode = 45,
CollegeLicenseGroupingCode = 3
},
new
{
CollegeCode = 3,
LicenseCode = 46,
CollegeLicenseGroupingCode = 3
},
new
{
CollegeCode = 3,
LicenseCode = 47,
CollegeLicenseGroupingCode = 4
},
new
{
CollegeCode = 3,
LicenseCode = 48,
CollegeLicenseGroupingCode = 4
},
new
{
CollegeCode = 3,
LicenseCode = 49,
CollegeLicenseGroupingCode = 4
},
new
{
CollegeCode = 3,
LicenseCode = 51,
CollegeLicenseGroupingCode = 4
},
new
{
CollegeCode = 3,
LicenseCode = 52,
CollegeLicenseGroupingCode = 1
},
new
{
CollegeCode = 3,
LicenseCode = 53,
CollegeLicenseGroupingCode = 1
},
new
{
CollegeCode = 3,
LicenseCode = 54,
CollegeLicenseGroupingCode = 1
},
new
{
CollegeCode = 3,
LicenseCode = 55,
CollegeLicenseGroupingCode = 1
},
new
{
CollegeCode = 3,
LicenseCode = 60,
CollegeLicenseGroupingCode = 5
},
new
{
CollegeCode = 3,
LicenseCode = 61,
CollegeLicenseGroupingCode = 5
},
new
{
CollegeCode = 3,
LicenseCode = 62,
CollegeLicenseGroupingCode = 5
},
new
{
CollegeCode = 3,
LicenseCode = 63,
CollegeLicenseGroupingCode = 5
},
new
{
CollegeCode = 3,
LicenseCode = 69,
CollegeLicenseGroupingCode = 5
},
new
{
CollegeCode = 4,
LicenseCode = 64
},
new
{
CollegeCode = 5,
LicenseCode = 64
},
new
{
CollegeCode = 6,
LicenseCode = 64
},
new
{
CollegeCode = 7,
LicenseCode = 64
},
new
{
CollegeCode = 8,
LicenseCode = 64
},
new
{
CollegeCode = 9,
LicenseCode = 64
},
new
{
CollegeCode = 10,
LicenseCode = 64
},
new
{
CollegeCode = 11,
LicenseCode = 64
},
new
{
CollegeCode = 12,
LicenseCode = 64
},
new
{
CollegeCode = 13,
LicenseCode = 64
},
new
{
CollegeCode = 14,
LicenseCode = 64
},
new
{
CollegeCode = 15,
LicenseCode = 64
},
new
{
CollegeCode = 16,
LicenseCode = 64
},
new
{
CollegeCode = 17,
LicenseCode = 64
},
new
{
CollegeCode = 18,
LicenseCode = 64
});
});
modelBuilder.Entity("Prime.Models.CollegeLicenseGrouping", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Weight")
.HasColumnType("integer");
b.HasKey("Code");
b.ToTable("CollegeLicenseGroupingLookup");
b.HasData(
new
{
Code = 1,
Name = "Licensed Practical Nurse",
Weight = 1
},
new
{
Code = 2,
Name = "Registered Nurse/Licensed Graduate Nurse",
Weight = 2
},
new
{
Code = 3,
Name = "Registered Psychiatric Nurse",
Weight = 3
},
new
{
Code = 4,
Name = "Nurse Practitioner",
Weight = 4
},
new
{
Code = 5,
Name = "Midwife",
Weight = 5
});
});
modelBuilder.Entity("Prime.Models.CollegePractice", b =>
{
b.Property<int>("CollegeCode")
.HasColumnType("integer");
b.Property<int>("PracticeCode")
.HasColumnType("integer");
b.HasKey("CollegeCode", "PracticeCode");
b.HasIndex("PracticeCode");
b.ToTable("CollegePractice");
b.HasData(
new
{
CollegeCode = 3,
PracticeCode = 1
},
new
{
CollegeCode = 3,
PracticeCode = 2
},
new
{
CollegeCode = 3,
PracticeCode = 3
},
new
{
CollegeCode = 3,
PracticeCode = 4
});
});
modelBuilder.Entity("Prime.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("Fax")
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("JobRoleTitle")
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<int?>("PhysicalAddressId")
.HasColumnType("integer");
b.Property<string>("SMSPhone")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("PhysicalAddressId");
b.ToTable("Contact");
});
modelBuilder.Entity("Prime.Models.Country", b =>
{
b.Property<string>("Code")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("CountryLookup");
b.HasData(
new
{
Code = "CA",
Name = "Canada"
},
new
{
Code = "US",
Name = "United States"
});
});
modelBuilder.Entity("Prime.Models.Credential", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset?>("AcceptedCredentialDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Alias")
.HasColumnType("text");
b.Property<string>("Base64QRCode")
.HasColumnType("text");
b.Property<string>("ConnectionId")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("CredentialDefinitionId")
.HasColumnType("text");
b.Property<string>("CredentialExchangeId")
.HasColumnType("text");
b.Property<DateTimeOffset?>("RevokedCredentialDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("SchemaId")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("Credential");
});
modelBuilder.Entity("Prime.Models.DefaultPrivilege", b =>
{
b.Property<int>("PrivilegeId")
.HasColumnType("integer");
b.Property<int>("LicenseCode")
.HasColumnType("integer");
b.HasKey("PrivilegeId", "LicenseCode");
b.HasIndex("LicenseCode");
b.ToTable("DefaultPrivilege");
b.HasData(
new
{
PrivilegeId = 1,
LicenseCode = 25
},
new
{
PrivilegeId = 2,
LicenseCode = 25
},
new
{
PrivilegeId = 3,
LicenseCode = 25
},
new
{
PrivilegeId = 4,
LicenseCode = 25
},
new
{
PrivilegeId = 5,
LicenseCode = 25
},
new
{
PrivilegeId = 6,
LicenseCode = 25
},
new
{
PrivilegeId = 7,
LicenseCode = 25
},
new
{
PrivilegeId = 8,
LicenseCode = 25
},
new
{
PrivilegeId = 9,
LicenseCode = 25
},
new
{
PrivilegeId = 10,
LicenseCode = 25
},
new
{
PrivilegeId = 11,
LicenseCode = 25
},
new
{
PrivilegeId = 12,
LicenseCode = 25
},
new
{
PrivilegeId = 13,
LicenseCode = 25
},
new
{
PrivilegeId = 14,
LicenseCode = 25
},
new
{
PrivilegeId = 15,
LicenseCode = 25
},
new
{
PrivilegeId = 16,
LicenseCode = 25
},
new
{
PrivilegeId = 19,
LicenseCode = 25
},
new
{
PrivilegeId = 1,
LicenseCode = 26
},
new
{
PrivilegeId = 2,
LicenseCode = 26
},
new
{
PrivilegeId = 3,
LicenseCode = 26
},
new
{
PrivilegeId = 4,
LicenseCode = 26
},
new
{
PrivilegeId = 5,
LicenseCode = 26
},
new
{
PrivilegeId = 6,
LicenseCode = 26
},
new
{
PrivilegeId = 7,
LicenseCode = 26
},
new
{
PrivilegeId = 8,
LicenseCode = 26
},
new
{
PrivilegeId = 9,
LicenseCode = 26
},
new
{
PrivilegeId = 10,
LicenseCode = 26
},
new
{
PrivilegeId = 11,
LicenseCode = 26
},
new
{
PrivilegeId = 12,
LicenseCode = 26
},
new
{
PrivilegeId = 13,
LicenseCode = 26
},
new
{
PrivilegeId = 14,
LicenseCode = 26
},
new
{
PrivilegeId = 15,
LicenseCode = 26
},
new
{
PrivilegeId = 16,
LicenseCode = 26
},
new
{
PrivilegeId = 19,
LicenseCode = 26
},
new
{
PrivilegeId = 1,
LicenseCode = 27
},
new
{
PrivilegeId = 2,
LicenseCode = 27
},
new
{
PrivilegeId = 3,
LicenseCode = 27
},
new
{
PrivilegeId = 4,
LicenseCode = 27
},
new
{
PrivilegeId = 5,
LicenseCode = 27
},
new
{
PrivilegeId = 6,
LicenseCode = 27
},
new
{
PrivilegeId = 7,
LicenseCode = 27
},
new
{
PrivilegeId = 8,
LicenseCode = 27
},
new
{
PrivilegeId = 9,
LicenseCode = 27
},
new
{
PrivilegeId = 10,
LicenseCode = 27
},
new
{
PrivilegeId = 11,
LicenseCode = 27
},
new
{
PrivilegeId = 12,
LicenseCode = 27
},
new
{
PrivilegeId = 13,
LicenseCode = 27
},
new
{
PrivilegeId = 14,
LicenseCode = 27
},
new
{
PrivilegeId = 15,
LicenseCode = 27
},
new
{
PrivilegeId = 16,
LicenseCode = 27
},
new
{
PrivilegeId = 19,
LicenseCode = 27
},
new
{
PrivilegeId = 1,
LicenseCode = 28
},
new
{
PrivilegeId = 2,
LicenseCode = 28
},
new
{
PrivilegeId = 3,
LicenseCode = 28
},
new
{
PrivilegeId = 4,
LicenseCode = 28
},
new
{
PrivilegeId = 5,
LicenseCode = 28
},
new
{
PrivilegeId = 6,
LicenseCode = 28
},
new
{
PrivilegeId = 7,
LicenseCode = 28
},
new
{
PrivilegeId = 8,
LicenseCode = 28
},
new
{
PrivilegeId = 9,
LicenseCode = 28
},
new
{
PrivilegeId = 10,
LicenseCode = 28
},
new
{
PrivilegeId = 11,
LicenseCode = 28
},
new
{
PrivilegeId = 12,
LicenseCode = 28
},
new
{
PrivilegeId = 13,
LicenseCode = 28
},
new
{
PrivilegeId = 14,
LicenseCode = 28
},
new
{
PrivilegeId = 15,
LicenseCode = 28
},
new
{
PrivilegeId = 16,
LicenseCode = 28
},
new
{
PrivilegeId = 5,
LicenseCode = 1
},
new
{
PrivilegeId = 6,
LicenseCode = 1
},
new
{
PrivilegeId = 7,
LicenseCode = 1
},
new
{
PrivilegeId = 8,
LicenseCode = 1
},
new
{
PrivilegeId = 9,
LicenseCode = 1
},
new
{
PrivilegeId = 10,
LicenseCode = 1
},
new
{
PrivilegeId = 11,
LicenseCode = 1
},
new
{
PrivilegeId = 12,
LicenseCode = 1
},
new
{
PrivilegeId = 13,
LicenseCode = 1
},
new
{
PrivilegeId = 14,
LicenseCode = 1
},
new
{
PrivilegeId = 15,
LicenseCode = 1
},
new
{
PrivilegeId = 16,
LicenseCode = 1
},
new
{
PrivilegeId = 19,
LicenseCode = 1
},
new
{
PrivilegeId = 5,
LicenseCode = 2
},
new
{
PrivilegeId = 6,
LicenseCode = 2
},
new
{
PrivilegeId = 7,
LicenseCode = 2
},
new
{
PrivilegeId = 8,
LicenseCode = 2
},
new
{
PrivilegeId = 9,
LicenseCode = 2
},
new
{
PrivilegeId = 10,
LicenseCode = 2
},
new
{
PrivilegeId = 11,
LicenseCode = 2
},
new
{
PrivilegeId = 12,
LicenseCode = 2
},
new
{
PrivilegeId = 13,
LicenseCode = 2
},
new
{
PrivilegeId = 14,
LicenseCode = 2
},
new
{
PrivilegeId = 15,
LicenseCode = 2
},
new
{
PrivilegeId = 16,
LicenseCode = 2
},
new
{
PrivilegeId = 19,
LicenseCode = 2
},
new
{
PrivilegeId = 5,
LicenseCode = 3
},
new
{
PrivilegeId = 6,
LicenseCode = 3
},
new
{
PrivilegeId = 7,
LicenseCode = 3
},
new
{
PrivilegeId = 8,
LicenseCode = 3
},
new
{
PrivilegeId = 9,
LicenseCode = 3
},
new
{
PrivilegeId = 10,
LicenseCode = 3
},
new
{
PrivilegeId = 11,
LicenseCode = 3
},
new
{
PrivilegeId = 12,
LicenseCode = 3
},
new
{
PrivilegeId = 13,
LicenseCode = 3
},
new
{
PrivilegeId = 14,
LicenseCode = 3
},
new
{
PrivilegeId = 15,
LicenseCode = 3
},
new
{
PrivilegeId = 16,
LicenseCode = 3
},
new
{
PrivilegeId = 19,
LicenseCode = 3
},
new
{
PrivilegeId = 5,
LicenseCode = 4
},
new
{
PrivilegeId = 6,
LicenseCode = 4
},
new
{
PrivilegeId = 7,
LicenseCode = 4
},
new
{
PrivilegeId = 8,
LicenseCode = 4
},
new
{
PrivilegeId = 9,
LicenseCode = 4
},
new
{
PrivilegeId = 10,
LicenseCode = 4
},
new
{
PrivilegeId = 11,
LicenseCode = 4
},
new
{
PrivilegeId = 12,
LicenseCode = 4
},
new
{
PrivilegeId = 13,
LicenseCode = 4
},
new
{
PrivilegeId = 14,
LicenseCode = 4
},
new
{
PrivilegeId = 15,
LicenseCode = 4
},
new
{
PrivilegeId = 16,
LicenseCode = 4
},
new
{
PrivilegeId = 19,
LicenseCode = 4
},
new
{
PrivilegeId = 5,
LicenseCode = 5
},
new
{
PrivilegeId = 6,
LicenseCode = 5
},
new
{
PrivilegeId = 7,
LicenseCode = 5
},
new
{
PrivilegeId = 8,
LicenseCode = 5
},
new
{
PrivilegeId = 9,
LicenseCode = 5
},
new
{
PrivilegeId = 10,
LicenseCode = 5
},
new
{
PrivilegeId = 11,
LicenseCode = 5
},
new
{
PrivilegeId = 12,
LicenseCode = 5
},
new
{
PrivilegeId = 13,
LicenseCode = 5
},
new
{
PrivilegeId = 14,
LicenseCode = 5
},
new
{
PrivilegeId = 15,
LicenseCode = 5
},
new
{
PrivilegeId = 16,
LicenseCode = 5
},
new
{
PrivilegeId = 19,
LicenseCode = 5
},
new
{
PrivilegeId = 5,
LicenseCode = 6
},
new
{
PrivilegeId = 6,
LicenseCode = 6
},
new
{
PrivilegeId = 7,
LicenseCode = 6
},
new
{
PrivilegeId = 8,
LicenseCode = 6
},
new
{
PrivilegeId = 9,
LicenseCode = 6
},
new
{
PrivilegeId = 10,
LicenseCode = 6
},
new
{
PrivilegeId = 11,
LicenseCode = 6
},
new
{
PrivilegeId = 12,
LicenseCode = 6
},
new
{
PrivilegeId = 13,
LicenseCode = 6
},
new
{
PrivilegeId = 14,
LicenseCode = 6
},
new
{
PrivilegeId = 15,
LicenseCode = 6
},
new
{
PrivilegeId = 16,
LicenseCode = 6
},
new
{
PrivilegeId = 19,
LicenseCode = 6
},
new
{
PrivilegeId = 5,
LicenseCode = 7
},
new
{
PrivilegeId = 6,
LicenseCode = 7
},
new
{
PrivilegeId = 7,
LicenseCode = 7
},
new
{
PrivilegeId = 8,
LicenseCode = 7
},
new
{
PrivilegeId = 9,
LicenseCode = 7
},
new
{
PrivilegeId = 10,
LicenseCode = 7
},
new
{
PrivilegeId = 11,
LicenseCode = 7
},
new
{
PrivilegeId = 12,
LicenseCode = 7
},
new
{
PrivilegeId = 13,
LicenseCode = 7
},
new
{
PrivilegeId = 14,
LicenseCode = 7
},
new
{
PrivilegeId = 15,
LicenseCode = 7
},
new
{
PrivilegeId = 16,
LicenseCode = 7
},
new
{
PrivilegeId = 5,
LicenseCode = 8
},
new
{
PrivilegeId = 6,
LicenseCode = 8
},
new
{
PrivilegeId = 7,
LicenseCode = 8
},
new
{
PrivilegeId = 8,
LicenseCode = 8
},
new
{
PrivilegeId = 9,
LicenseCode = 8
},
new
{
PrivilegeId = 10,
LicenseCode = 8
},
new
{
PrivilegeId = 11,
LicenseCode = 8
},
new
{
PrivilegeId = 12,
LicenseCode = 8
},
new
{
PrivilegeId = 13,
LicenseCode = 8
},
new
{
PrivilegeId = 14,
LicenseCode = 8
},
new
{
PrivilegeId = 15,
LicenseCode = 8
},
new
{
PrivilegeId = 16,
LicenseCode = 8
},
new
{
PrivilegeId = 5,
LicenseCode = 9
},
new
{
PrivilegeId = 6,
LicenseCode = 9
},
new
{
PrivilegeId = 7,
LicenseCode = 9
},
new
{
PrivilegeId = 8,
LicenseCode = 9
},
new
{
PrivilegeId = 9,
LicenseCode = 9
},
new
{
PrivilegeId = 10,
LicenseCode = 9
},
new
{
PrivilegeId = 11,
LicenseCode = 9
},
new
{
PrivilegeId = 12,
LicenseCode = 9
},
new
{
PrivilegeId = 13,
LicenseCode = 9
},
new
{
PrivilegeId = 14,
LicenseCode = 9
},
new
{
PrivilegeId = 15,
LicenseCode = 9
},
new
{
PrivilegeId = 16,
LicenseCode = 9
},
new
{
PrivilegeId = 19,
LicenseCode = 9
},
new
{
PrivilegeId = 5,
LicenseCode = 10
},
new
{
PrivilegeId = 6,
LicenseCode = 10
},
new
{
PrivilegeId = 7,
LicenseCode = 10
},
new
{
PrivilegeId = 8,
LicenseCode = 10
},
new
{
PrivilegeId = 9,
LicenseCode = 10
},
new
{
PrivilegeId = 10,
LicenseCode = 10
},
new
{
PrivilegeId = 11,
LicenseCode = 10
},
new
{
PrivilegeId = 12,
LicenseCode = 10
},
new
{
PrivilegeId = 13,
LicenseCode = 10
},
new
{
PrivilegeId = 14,
LicenseCode = 10
},
new
{
PrivilegeId = 15,
LicenseCode = 10
},
new
{
PrivilegeId = 16,
LicenseCode = 10
},
new
{
PrivilegeId = 5,
LicenseCode = 12
},
new
{
PrivilegeId = 6,
LicenseCode = 12
},
new
{
PrivilegeId = 7,
LicenseCode = 12
},
new
{
PrivilegeId = 8,
LicenseCode = 12
},
new
{
PrivilegeId = 9,
LicenseCode = 12
},
new
{
PrivilegeId = 10,
LicenseCode = 12
},
new
{
PrivilegeId = 11,
LicenseCode = 12
},
new
{
PrivilegeId = 12,
LicenseCode = 12
},
new
{
PrivilegeId = 13,
LicenseCode = 12
},
new
{
PrivilegeId = 14,
LicenseCode = 12
},
new
{
PrivilegeId = 15,
LicenseCode = 12
},
new
{
PrivilegeId = 16,
LicenseCode = 12
},
new
{
PrivilegeId = 19,
LicenseCode = 12
},
new
{
PrivilegeId = 5,
LicenseCode = 13
},
new
{
PrivilegeId = 6,
LicenseCode = 13
},
new
{
PrivilegeId = 7,
LicenseCode = 13
},
new
{
PrivilegeId = 8,
LicenseCode = 13
},
new
{
PrivilegeId = 9,
LicenseCode = 13
},
new
{
PrivilegeId = 10,
LicenseCode = 13
},
new
{
PrivilegeId = 11,
LicenseCode = 13
},
new
{
PrivilegeId = 12,
LicenseCode = 13
},
new
{
PrivilegeId = 13,
LicenseCode = 13
},
new
{
PrivilegeId = 14,
LicenseCode = 13
},
new
{
PrivilegeId = 15,
LicenseCode = 13
},
new
{
PrivilegeId = 16,
LicenseCode = 13
},
new
{
PrivilegeId = 19,
LicenseCode = 13
},
new
{
PrivilegeId = 5,
LicenseCode = 14
},
new
{
PrivilegeId = 6,
LicenseCode = 14
},
new
{
PrivilegeId = 7,
LicenseCode = 14
},
new
{
PrivilegeId = 8,
LicenseCode = 14
},
new
{
PrivilegeId = 9,
LicenseCode = 14
},
new
{
PrivilegeId = 10,
LicenseCode = 14
},
new
{
PrivilegeId = 11,
LicenseCode = 14
},
new
{
PrivilegeId = 12,
LicenseCode = 14
},
new
{
PrivilegeId = 13,
LicenseCode = 14
},
new
{
PrivilegeId = 14,
LicenseCode = 14
},
new
{
PrivilegeId = 15,
LicenseCode = 14
},
new
{
PrivilegeId = 16,
LicenseCode = 14
},
new
{
PrivilegeId = 19,
LicenseCode = 14
},
new
{
PrivilegeId = 5,
LicenseCode = 15
},
new
{
PrivilegeId = 6,
LicenseCode = 15
},
new
{
PrivilegeId = 7,
LicenseCode = 15
},
new
{
PrivilegeId = 8,
LicenseCode = 15
},
new
{
PrivilegeId = 9,
LicenseCode = 15
},
new
{
PrivilegeId = 10,
LicenseCode = 15
},
new
{
PrivilegeId = 11,
LicenseCode = 15
},
new
{
PrivilegeId = 12,
LicenseCode = 15
},
new
{
PrivilegeId = 13,
LicenseCode = 15
},
new
{
PrivilegeId = 14,
LicenseCode = 15
},
new
{
PrivilegeId = 15,
LicenseCode = 15
},
new
{
PrivilegeId = 16,
LicenseCode = 15
},
new
{
PrivilegeId = 5,
LicenseCode = 18
},
new
{
PrivilegeId = 6,
LicenseCode = 18
},
new
{
PrivilegeId = 7,
LicenseCode = 18
},
new
{
PrivilegeId = 8,
LicenseCode = 18
},
new
{
PrivilegeId = 9,
LicenseCode = 18
},
new
{
PrivilegeId = 10,
LicenseCode = 18
},
new
{
PrivilegeId = 11,
LicenseCode = 18
},
new
{
PrivilegeId = 12,
LicenseCode = 18
},
new
{
PrivilegeId = 13,
LicenseCode = 18
},
new
{
PrivilegeId = 14,
LicenseCode = 18
},
new
{
PrivilegeId = 15,
LicenseCode = 18
},
new
{
PrivilegeId = 16,
LicenseCode = 18
},
new
{
PrivilegeId = 19,
LicenseCode = 18
},
new
{
PrivilegeId = 5,
LicenseCode = 19
},
new
{
PrivilegeId = 6,
LicenseCode = 19
},
new
{
PrivilegeId = 7,
LicenseCode = 19
},
new
{
PrivilegeId = 8,
LicenseCode = 19
},
new
{
PrivilegeId = 9,
LicenseCode = 19
},
new
{
PrivilegeId = 10,
LicenseCode = 19
},
new
{
PrivilegeId = 11,
LicenseCode = 19
},
new
{
PrivilegeId = 12,
LicenseCode = 19
},
new
{
PrivilegeId = 13,
LicenseCode = 19
},
new
{
PrivilegeId = 14,
LicenseCode = 19
},
new
{
PrivilegeId = 15,
LicenseCode = 19
},
new
{
PrivilegeId = 16,
LicenseCode = 19
},
new
{
PrivilegeId = 19,
LicenseCode = 19
},
new
{
PrivilegeId = 5,
LicenseCode = 24
},
new
{
PrivilegeId = 6,
LicenseCode = 24
},
new
{
PrivilegeId = 7,
LicenseCode = 24
},
new
{
PrivilegeId = 8,
LicenseCode = 24
},
new
{
PrivilegeId = 9,
LicenseCode = 24
},
new
{
PrivilegeId = 10,
LicenseCode = 24
},
new
{
PrivilegeId = 11,
LicenseCode = 24
},
new
{
PrivilegeId = 12,
LicenseCode = 24
},
new
{
PrivilegeId = 13,
LicenseCode = 24
},
new
{
PrivilegeId = 14,
LicenseCode = 24
},
new
{
PrivilegeId = 15,
LicenseCode = 24
},
new
{
PrivilegeId = 16,
LicenseCode = 24
},
new
{
PrivilegeId = 8,
LicenseCode = 17
},
new
{
PrivilegeId = 9,
LicenseCode = 17
},
new
{
PrivilegeId = 10,
LicenseCode = 17
},
new
{
PrivilegeId = 11,
LicenseCode = 17
},
new
{
PrivilegeId = 12,
LicenseCode = 17
},
new
{
PrivilegeId = 13,
LicenseCode = 17
},
new
{
PrivilegeId = 14,
LicenseCode = 17
},
new
{
PrivilegeId = 15,
LicenseCode = 17
},
new
{
PrivilegeId = 16,
LicenseCode = 17
},
new
{
PrivilegeId = 19,
LicenseCode = 17
},
new
{
PrivilegeId = 8,
LicenseCode = 22
},
new
{
PrivilegeId = 9,
LicenseCode = 22
},
new
{
PrivilegeId = 10,
LicenseCode = 22
},
new
{
PrivilegeId = 11,
LicenseCode = 22
},
new
{
PrivilegeId = 12,
LicenseCode = 22
},
new
{
PrivilegeId = 13,
LicenseCode = 22
},
new
{
PrivilegeId = 14,
LicenseCode = 22
},
new
{
PrivilegeId = 15,
LicenseCode = 22
},
new
{
PrivilegeId = 16,
LicenseCode = 22
},
new
{
PrivilegeId = 5,
LicenseCode = 47
},
new
{
PrivilegeId = 6,
LicenseCode = 47
},
new
{
PrivilegeId = 7,
LicenseCode = 47
},
new
{
PrivilegeId = 8,
LicenseCode = 47
},
new
{
PrivilegeId = 9,
LicenseCode = 47
},
new
{
PrivilegeId = 10,
LicenseCode = 47
},
new
{
PrivilegeId = 11,
LicenseCode = 47
},
new
{
PrivilegeId = 12,
LicenseCode = 47
},
new
{
PrivilegeId = 13,
LicenseCode = 47
},
new
{
PrivilegeId = 14,
LicenseCode = 47
},
new
{
PrivilegeId = 15,
LicenseCode = 47
},
new
{
PrivilegeId = 16,
LicenseCode = 47
},
new
{
PrivilegeId = 19,
LicenseCode = 47
},
new
{
PrivilegeId = 5,
LicenseCode = 48
},
new
{
PrivilegeId = 6,
LicenseCode = 48
},
new
{
PrivilegeId = 7,
LicenseCode = 48
},
new
{
PrivilegeId = 8,
LicenseCode = 48
},
new
{
PrivilegeId = 9,
LicenseCode = 48
},
new
{
PrivilegeId = 10,
LicenseCode = 48
},
new
{
PrivilegeId = 11,
LicenseCode = 48
},
new
{
PrivilegeId = 12,
LicenseCode = 48
},
new
{
PrivilegeId = 13,
LicenseCode = 48
},
new
{
PrivilegeId = 14,
LicenseCode = 48
},
new
{
PrivilegeId = 15,
LicenseCode = 48
},
new
{
PrivilegeId = 16,
LicenseCode = 48
},
new
{
PrivilegeId = 19,
LicenseCode = 48
},
new
{
PrivilegeId = 5,
LicenseCode = 51
},
new
{
PrivilegeId = 6,
LicenseCode = 51
},
new
{
PrivilegeId = 7,
LicenseCode = 51
},
new
{
PrivilegeId = 8,
LicenseCode = 51
},
new
{
PrivilegeId = 9,
LicenseCode = 51
},
new
{
PrivilegeId = 10,
LicenseCode = 51
},
new
{
PrivilegeId = 11,
LicenseCode = 51
},
new
{
PrivilegeId = 12,
LicenseCode = 51
},
new
{
PrivilegeId = 13,
LicenseCode = 51
},
new
{
PrivilegeId = 14,
LicenseCode = 51
},
new
{
PrivilegeId = 15,
LicenseCode = 51
},
new
{
PrivilegeId = 16,
LicenseCode = 51
},
new
{
PrivilegeId = 19,
LicenseCode = 51
});
});
modelBuilder.Entity("Prime.Models.DocumentAccessToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("DocumentAccessToken");
});
modelBuilder.Entity("Prime.Models.EmailLog", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Body")
.HasColumnType("text");
b.Property<string>("Cc")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset?>("DateSent")
.HasColumnType("timestamp with time zone");
b.Property<string>("LatestStatus")
.HasColumnType("text");
b.Property<Guid?>("MsgId")
.HasColumnType("uuid");
b.Property<string>("SendType")
.HasColumnType("text");
b.Property<string>("SentTo")
.HasColumnType("text");
b.Property<string>("StatusMessage")
.HasColumnType("text");
b.Property<string>("Subject")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("EmailLog");
});
modelBuilder.Entity("Prime.Models.EmailTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EmailType")
.HasColumnType("integer");
b.Property<DateTimeOffset>("ModifiedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Template")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EmailType")
.IsUnique();
b.ToTable("EmailTemplate");
b.HasData(
new
{
Id = 1,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 1,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<p> Your PRIME application status has changed since you last viewed it. Please click <a href=\"@Model.Url\">here</a> to log into PRIME and view your status. </p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 2,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<style> .underline { text-decoration: underline; } .list-item-mb { margin-bottom: 0.75rem; } </style>To: Clinic Manager (person responsible for coordinating PharmaNet access):<br><br>@Model.EnrolleeFullName has been approved for Private Community Health Practice Access to PharmaNet.<br><br> <strong> To set up their access, you must forward this PRIME Enrolment Confirmation and the information specified below to your <span class=\"underline\">PharmaNet Software Vendor</span>. </strong> <br><br> <ol> <li class=\"list-item-mb\"> Name of medical clinic: </li> <li class=\"list-item-mb\"> Clinic address: </li> <li class=\"list-item-mb\"> Pharmacy equivalency code (PEC): <i>This is your PharmaNet site ID; ask your vendor if you don’t know it:</i> </li> <li class=\"list-item-mb\"> For <strong> physicians, pharmacists, and nurse practitioners:</strong> <br><br> College name and College ID of this user <em>(leave blank if this user is not a physician, pharmacist or nurse practitioner)</em> </li> <li class=\"list-item-mb\"> For users who work <strong>On Behalf Of</strong> a physician, pharmacist, or nurse practitioner: <br><br> College name(s) and College ID(s) of the physicians, pharmacists or nurse practitioners who this user will access PharmaNet on behalf of: <em>(leave this blank if this user is a pharmacist, nurse practitioner or physician)</em> </li> </ol> <a href=\"@Model.TokenUrl\">@Model.TokenUrl</a> <br> <strong>This link will expire after @Model.ExpiresInDays days.</strong> <br><br> Thank you,<br><br> PRIME<br><br> 1-844-397-7463<br><br> <a href='mailto:PRIMEsupport@gov.bc.ca' target='_top'>PRIMEsupport@gov.bc.ca</a>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 3,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "To: Whom it may concern, <br> <br> @Model.EnrolleeFullName has been approved for <strong>Community Pharmacy Access to PharmaNet.</strong> They can now be set up with their PharmaNet Access account in your local software. You must include their <strong>Global PharmaNet ID (GPID)</strong> on their account profile. You can access their GPID via this link below. <br> <br> <a href=\"@Model.TokenUrl\">@Model.TokenUrl</a> <br> <strong>This link will expire after @Model.ExpiresInDays days</strong>. <br> <br> Thank you.",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 4,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 4,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "To: PharmNet Access administrator <br> <br> @Model.EnrolleeFullName has been approved for <strong>Health Authority Access to PharmaNet.</strong> <br> They can now be set up with their PharmaNet Access account in your local software. You must include their <strong>Global PharmaNet ID (GPID)</strong> on their account profile. <br> You can access their GPID via this link here. <br> <a href=\"@Model.TokenUrl\">@Model.TokenUrl</a> <br> <strong>This link will expire after @Model.ExpiresInDays days</strong>.",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 5,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 5,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "The Ministry of Health has been notified that you require Remote Access at <br> Organization Name: @Model.OrganizationName <br> Site Address: @Model.SiteStreetAddress, @Model.SiteCity <br> <br> To complete your approval for Remote Access, please ensure you have indicated you require Remote Access on your profile at <a href=\"@Model.PrimeUrl\">@Model.PrimeUrl</a>.",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 6,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 6,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "@{ var pecText = string.IsNullOrWhiteSpace(Model.SitePec) ? \"Not Assigned\" : Model.SitePec; } <p> Notification: The list of Remote Practitioners at @Model.SiteStreetAddress of @Model.OrganizationName (PEC: @pecText) has been updated. The Remote Practitioners at this site are: </p> <h2 class=\"mb-2\">Remote Users</h2> @foreach (var name in Model.RemoteUserNames) { <div class=\"ml-2 mb-2\"> <h5>Name</h5> <span class=\"ml-2\">@name</span> </div> } <h2 class=\"mb-2\">Site Information</h2> <p> See the attached registration and organization agreement for more information. @if (!string.IsNullOrWhiteSpace(Model.DocumentUrl)) { @(\"To access the Business Licence, click this\") <a href=\"@Model.DocumentUrl\" target=\"_blank\">link</a>@(\".\") } </p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 7,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 7,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<p>@Model.DoingBusinessAs with PEC/SiteID @Model.Pec has been approved by the Ministry of Health for PharmaNet access. Please notify the PharmaNet software vendor for this site and complete any remaining tasks to activate the site.</p><p>Thank you.</p><p>PRIME Support Team.</p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 8,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 8,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "@{ var renewalDate = Model.RenewalDate.Date.ToShortDateString(); } Dear @Model.EnrolleeName, <br> <br> Your enrolment for PharmaNet access will expire on @renewalDate. In order to continue to use PharmaNet, you must renew your enrolment information. <br> Click here to visit PRIME. <a href=\"@Model.PrimeUrl\">@Model.PrimeUrl</a>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 9,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 9,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<p> A user has uploaded business licence to their PharmaNet site registration. @if (!string.IsNullOrWhiteSpace(Model.Url)) { @(\"To access the Business Licence, click this\") <a href=\"@Model.Url\" target=\"_blank\">link</a>@(\".\") } </p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 10,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 10,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "Dear @Model.EnrolleeName, <br> <br> Your enrolment has not been renewed. PRIME will be notifying your PharmaNet software vendor to deactivate your account.",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 11,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 11,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<p> Your site registration has been approved. The site must now be set up and activated in PharmaNet. Your PharmaNet software vendor will be notified when the site has been activated, and you will hear from them when you can start to use PharmaNet. </p> <p> Individuals who will be accessing PharmaNet at your site should enrol in PRIME now if they have not already done so. For more information, please visit <a href=\"https://www.gov.bc.ca/pharmanet/PRIME\" target=\"_blank\">https://www.gov.bc.ca/pharmanet/PRIME</a>. [for private community practice only: If you have registered any physicians or nurse practitioners for remote access to PharmaNet, they must enroll in PRIME before they use remote access, which they can do here: <a href=\"https://pharmanetenrolment.gov.bc.ca\" target=\"_blank\">https://pharmanetenrolment.gov.bc.ca</a>. You must not permit remote use of PharmaNet until these users are approved in PRIME.] </p> <p> If you have any questions or concerns, please phone 1-844-397-7463 or email <a href=\"mailto:PRIMEsupport@gov.bc.ca\" target=\"_top\">PRIMESupport@gov.bc.ca</a>. </p> <p> Thank you. </p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 12,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 12,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<p> The site you registered in PRIME, @Model.DoingBusinessAs, has been approved by the Ministry of Health. Your SiteID is @Model.Pec. </p> <p> Health Insurance BC has been notified of the site’s approval and will contact your software vendor. Your vendor will complete any remaining setup for your site and may contact you or the PharmaNet Administrator at your site. </p> <p> If you need to update any information in PRIME regarding your site, you may log in at any time using your mobile BC Services Card. If you have any questions or concerns, please phone 1-844-397-7463 or email PRIMESupport@gov.bc.ca. </p> <p> Thank you. </p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 13,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
EmailType = 13,
ModifiedDate = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
Template = "<p> A new PharmaNet site registration has been received. See the attached registration and organization agreement for more information. @if (!string.IsNullOrWhiteSpace(Model.Url)) { @(\"To access the Business Licence, click this\") <a href=\"@Model.Url\" target=\"_blank\">link</a>@(\".\") } </p>",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
});
});
modelBuilder.Entity("Prime.Models.Enrollee", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AdjudicatorId")
.HasColumnType("integer");
b.Property<bool>("AlwaysManual")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("timestamp without time zone");
b.Property<string>("DeviceProviderNumber")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("GPID")
.HasColumnType("character varying(20)")
.HasMaxLength(20);
b.Property<string>("GivenNames")
.IsRequired()
.HasColumnType("text");
b.Property<string>("HPDID")
.HasColumnType("character varying(255)")
.HasMaxLength(255);
b.Property<int>("IdentityAssuranceLevel")
.HasColumnType("integer");
b.Property<string>("IdentityProvider")
.HasColumnType("text");
b.Property<bool?>("IsInsulinPumpProvider")
.HasColumnType("boolean");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<string>("PhoneExtension")
.HasColumnType("text");
b.Property<string>("PreferredFirstName")
.HasColumnType("text");
b.Property<string>("PreferredLastName")
.HasColumnType("text");
b.Property<string>("PreferredMiddleName")
.HasColumnType("text");
b.Property<bool>("ProfileCompleted")
.HasColumnType("boolean");
b.Property<string>("SmsPhone")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("GPID")
.IsUnique();
b.HasIndex("HPDID")
.IsUnique();
b.HasIndex("UserId")
.IsUnique();
b.ToTable("Enrollee");
});
modelBuilder.Entity("Prime.Models.EnrolleeAddress", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AddressId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AddressId");
b.HasIndex("EnrolleeId", "AddressId")
.IsUnique();
b.ToTable("EnrolleeAddress");
});
modelBuilder.Entity("Prime.Models.EnrolleeAdjudicationDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdjudicatorId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("EnrolleeId");
b.ToTable("EnrolleeAdjudicationDocument");
});
modelBuilder.Entity("Prime.Models.EnrolleeCareSetting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("CareSettingCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CareSettingCode");
b.HasIndex("EnrolleeId");
b.ToTable("EnrolleeCareSetting");
});
modelBuilder.Entity("Prime.Models.EnrolleeCredential", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("CredentialId")
.HasColumnType("integer");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CredentialId");
b.HasIndex("EnrolleeId");
b.ToTable("EnrolleeCredential");
});
modelBuilder.Entity("Prime.Models.EnrolleeHealthAuthority", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<int>("HealthAuthorityCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("HealthAuthorityCode");
b.ToTable("EnrolleeHealthAuthority");
});
modelBuilder.Entity("Prime.Models.EnrolleeNote", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdjudicatorId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("NoteDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("EnrolleeId");
b.ToTable("EnrolleeNote");
});
modelBuilder.Entity("Prime.Models.EnrolleeNotification", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdminId")
.HasColumnType("integer");
b.Property<int>("AssigneeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeNoteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdminId");
b.HasIndex("AssigneeId");
b.HasIndex("EnrolleeNoteId")
.IsUnique();
b.ToTable("EnrolleeNotification");
});
modelBuilder.Entity("Prime.Models.EnrolleeRemoteUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<int>("RemoteUserId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("RemoteUserId");
b.ToTable("EnrolleeRemoteUser");
});
modelBuilder.Entity("Prime.Models.EnrolmentCertificateAccessToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("Active")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("Expires")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<int>("ViewCount")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.ToTable("EnrolmentCertificateAccessToken");
});
modelBuilder.Entity("Prime.Models.EnrolmentStatus", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<int>("StatusCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("StatusDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("StatusCode");
b.ToTable("EnrolmentStatus");
});
modelBuilder.Entity("Prime.Models.EnrolmentStatusReason", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolmentStatusId")
.HasColumnType("integer");
b.Property<string>("ReasonNote")
.HasColumnType("text");
b.Property<int>("StatusReasonCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolmentStatusId");
b.HasIndex("StatusReasonCode");
b.ToTable("EnrolmentStatusReason");
});
modelBuilder.Entity("Prime.Models.EnrolmentStatusReference", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AdjudicatorNoteId")
.HasColumnType("integer");
b.Property<int?>("AdminId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolmentStatusId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdjudicatorNoteId")
.IsUnique();
b.HasIndex("AdminId");
b.HasIndex("EnrolmentStatusId")
.IsUnique();
b.ToTable("EnrolmentStatusReference");
});
modelBuilder.Entity("Prime.Models.Facility", b =>
{
b.Property<int>("Code")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("FacilityLookup");
b.HasData(
new
{
Code = 1,
Name = "Acute/ambulatory care"
},
new
{
Code = 2,
Name = "Long-term care"
},
new
{
Code = 3,
Name = "In-patient pharmacy"
},
new
{
Code = 4,
Name = "Out-patient pharmacy"
},
new
{
Code = 5,
Name = "Outpatient or community-based clinic"
});
});
modelBuilder.Entity("Prime.Models.GisEnrolment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset?>("LdapLoginSuccessDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("LdapUsername")
.HasColumnType("text");
b.Property<string>("Organization")
.HasColumnType("text");
b.Property<int>("PartyId")
.HasColumnType("integer");
b.Property<string>("Role")
.HasColumnType("text");
b.Property<DateTimeOffset?>("SubmittedDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("PartyId");
b.ToTable("GisEnrolment");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.CareType", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("CareTypeLookup");
b.HasData(
new
{
Code = 1,
Name = "Ambulatory Care"
},
new
{
Code = 2,
Name = "Acute Care"
});
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityCareType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("CareType")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("HealthAuthorityOrganizationId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("HealthAuthorityOrganizationId");
b.ToTable("HealthAuthorityCareType");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityContact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("ContactId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Discriminator")
.IsRequired()
.HasColumnType("text");
b.Property<int>("HealthAuthorityOrganizationId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ContactId");
b.ToTable("HealthAuthorityContact");
b.HasDiscriminator<string>("Discriminator").HasValue("HealthAuthorityContact");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("HealthAuthorityOrganization");
b.HasData(
new
{
Id = 1,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
Name = "Northern Health",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 2,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
Name = "Interior Health",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 3,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
Name = "Vancouver Coastal Health",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 4,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
Name = "Island Health",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 5,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
Name = "Fraser Health",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
},
new
{
Id = 6,
CreatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
CreatedUserId = new Guid("00000000-0000-0000-0000-000000000000"),
Name = "Provincial Health Services Authority",
UpdatedTimeStamp = new DateTimeOffset(new DateTime(2019, 9, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, -7, 0, 0, 0)),
UpdatedUserId = new Guid("00000000-0000-0000-0000-000000000000")
});
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthoritySite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AdjudicatorId")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("ApprovedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareType")
.HasColumnType("text");
b.Property<bool>("Completed")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("HealthAuthorityOrganizationId")
.HasColumnType("integer");
b.Property<int?>("HealthAuthorityPharmanetAdministratorId")
.HasColumnType("integer");
b.Property<string>("PEC")
.HasColumnType("text");
b.Property<int?>("PhysicalAddressId")
.HasColumnType("integer");
b.Property<int?>("ProvisionerId")
.HasColumnType("integer");
b.Property<string>("SecurityGroup")
.HasColumnType("text");
b.Property<string>("SiteId")
.HasColumnType("text");
b.Property<string>("SiteName")
.HasColumnType("text");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("SubmittedDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<int>("VendorCode")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("HealthAuthorityOrganizationId");
b.HasIndex("HealthAuthorityPharmanetAdministratorId");
b.HasIndex("PhysicalAddressId");
b.ToTable("HealthAuthoritySite");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityVendor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("HealthAuthorityOrganizationId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<int>("VendorCode")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("HealthAuthorityOrganizationId");
b.HasIndex("VendorCode");
b.ToTable("HealthAuthorityVendor");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.PrivacyOffice", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<int>("HealthAuthorityOrganizationId")
.HasColumnType("integer");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<int?>("PhysicalAddressId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("HealthAuthorityOrganizationId")
.IsUnique();
b.HasIndex("PhysicalAddressId");
b.ToTable("PrivacyOffice");
});
modelBuilder.Entity("Prime.Models.HealthAuthority", b =>
{
b.Property<int>("Code")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("HealthAuthorityLookup");
b.HasData(
new
{
Code = 1,
Name = "Northern Health"
},
new
{
Code = 2,
Name = "Interior Health"
},
new
{
Code = 3,
Name = "Vancouver Coastal Health"
},
new
{
Code = 4,
Name = "Island Health"
},
new
{
Code = 5,
Name = "Fraser Health"
},
new
{
Code = 6,
Name = "Provincial Health Services Authority"
});
});
modelBuilder.Entity("Prime.Models.IdentificationDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.ToTable("IdentificationDocument");
});
modelBuilder.Entity("Prime.Models.IdentifierType", b =>
{
b.Property<string>("Code")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("IdentifierTypeLookup");
b.HasData(
new
{
Code = "2.16.840.1.113883.3.40.2.19",
Name = "RNID"
},
new
{
Code = "2.16.840.1.113883.3.40.2.20",
Name = "RNPID"
},
new
{
Code = "2.16.840.1.113883.4.608",
Name = "RPNRC"
},
new
{
Code = "2.16.840.1.113883.3.40.2.14",
Name = "PHID"
},
new
{
Code = "2.16.840.1.113883.4.454",
Name = "RACID"
},
new
{
Code = "2.16.840.1.113883.3.40.2.18",
Name = "RMID"
},
new
{
Code = "2.16.840.1.113883.3.40.2.10",
Name = "LPNID"
},
new
{
Code = "2.16.840.1.113883.3.40.2.4",
Name = "CPSID"
},
new
{
Code = "2.16.840.1.113883.4.429",
Name = "OPTID"
},
new
{
Code = "2.16.840.1.113883.3.40.2.6",
Name = "DENID"
},
new
{
Code = "2.16.840.1.113883.4.363",
Name = "CCID"
},
new
{
Code = "2.16.840.1.113883.4.364",
Name = "OTID"
},
new
{
Code = "2.16.840.1.113883.4.362",
Name = "PSYCHID"
},
new
{
Code = "2.16.840.1.113883.4.361",
Name = "SWID"
},
new
{
Code = "2.16.840.1.113883.4.422",
Name = "CHIROID"
},
new
{
Code = "2.16.840.1.113883.4.414",
Name = "PHYSIOID"
},
new
{
Code = "2.16.840.1.113883.4.433",
Name = "RMTID"
},
new
{
Code = "2.16.840.1.113883.4.439",
Name = "KNID"
},
new
{
Code = "2.16.840.1.113883.4.401",
Name = "PHTID"
},
new
{
Code = "2.16.840.1.113883.4.477",
Name = "COUNID"
},
new
{
Code = "2.16.840.1.113883.4.452",
Name = "MFTID"
},
new
{
Code = "2.16.840.1.113883.4.530",
Name = "RDID"
});
});
modelBuilder.Entity("Prime.Models.Job", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.ToTable("Job");
});
modelBuilder.Entity("Prime.Models.JobName", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("JobNameLookup");
b.HasData(
new
{
Code = 1,
Name = "Medical office assistant"
},
new
{
Code = 2,
Name = "Pharmacy assistant"
},
new
{
Code = 3,
Name = "Registration clerk"
},
new
{
Code = 4,
Name = "Ward clerk"
},
new
{
Code = 5,
Name = "Nursing unit assistant"
});
});
modelBuilder.Entity("Prime.Models.License", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<bool>("LicensedToProvideCare")
.HasColumnType("boolean");
b.Property<bool>("Manual")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("NamedInImReg")
.HasColumnType("boolean");
b.Property<string>("Prefix")
.HasColumnType("text");
b.Property<int?>("PrescriberIdType")
.HasColumnType("integer");
b.Property<bool>("Validate")
.HasColumnType("boolean");
b.Property<int>("Weight")
.HasColumnType("integer");
b.HasKey("Code");
b.ToTable("LicenseLookup");
b.HasData(
new
{
Code = 1,
LicensedToProvideCare = true,
Manual = false,
Name = "Full - Family",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 1
},
new
{
Code = 2,
LicensedToProvideCare = true,
Manual = false,
Name = "Full - Specialty",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 2
},
new
{
Code = 5,
LicensedToProvideCare = true,
Manual = false,
Name = "Provisional - Family",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 3
},
new
{
Code = 6,
LicensedToProvideCare = true,
Manual = false,
Name = "Provisional - Specialty",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 4
},
new
{
Code = 9,
LicensedToProvideCare = true,
Manual = true,
Name = "Conditional - Practice Setting",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 5
},
new
{
Code = 8,
LicensedToProvideCare = true,
Manual = true,
Name = "Conditional - Practice Limitations",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 6
},
new
{
Code = 10,
LicensedToProvideCare = true,
Manual = true,
Name = "Conditional - Disciplined",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 7
},
new
{
Code = 22,
LicensedToProvideCare = true,
Manual = false,
Name = "Surgical Assistant",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 8
},
new
{
Code = 16,
LicensedToProvideCare = true,
Manual = false,
Name = "Clinical Observership",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 9
},
new
{
Code = 7,
LicensedToProvideCare = true,
Manual = true,
Name = "Academic",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 10
},
new
{
Code = 4,
LicensedToProvideCare = true,
Manual = false,
Name = "Osteopathic",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 11
},
new
{
Code = 3,
LicensedToProvideCare = true,
Manual = true,
Name = "Special",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 12
},
new
{
Code = 17,
LicensedToProvideCare = true,
Manual = true,
Name = "Visitor",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 13
},
new
{
Code = 12,
LicensedToProvideCare = true,
Manual = false,
Name = "Educational - Postgraduate Resident",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 14
},
new
{
Code = 13,
LicensedToProvideCare = true,
Manual = false,
Name = "Educational - Postgraduate Resident Elective",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 15
},
new
{
Code = 14,
LicensedToProvideCare = true,
Manual = false,
Name = "Educational - Postgraduate Fellow",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 16
},
new
{
Code = 15,
LicensedToProvideCare = true,
Manual = false,
Name = "Educational - Postgraduate Trainee",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 17
},
new
{
Code = 11,
LicensedToProvideCare = true,
Manual = false,
Name = "Educational - Medical Student",
NamedInImReg = false,
Prefix = "91",
Validate = false,
Weight = 18
},
new
{
Code = 23,
LicensedToProvideCare = false,
Manual = true,
Name = "Administrative",
NamedInImReg = false,
Prefix = "91",
Validate = true,
Weight = 19
},
new
{
Code = 20,
LicensedToProvideCare = false,
Manual = true,
Name = "Retired - Life ",
NamedInImReg = false,
Prefix = "91",
Validate = true,
Weight = 20
},
new
{
Code = 24,
LicensedToProvideCare = true,
Manual = true,
Name = "Assessment",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 21
},
new
{
Code = 18,
LicensedToProvideCare = true,
Manual = false,
Name = "Emergency - Family",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 22
},
new
{
Code = 19,
LicensedToProvideCare = true,
Manual = false,
Name = "Emergency - Specialty",
NamedInImReg = true,
Prefix = "91",
Validate = true,
Weight = 23
},
new
{
Code = 21,
LicensedToProvideCare = false,
Manual = true,
Name = "Temporarily Inactive",
NamedInImReg = false,
Prefix = "91",
Validate = true,
Weight = 24
},
new
{
Code = 59,
LicensedToProvideCare = true,
Manual = true,
Name = "Podiatric Surgeon",
NamedInImReg = false,
Prefix = "93",
Validate = true,
Weight = 25
},
new
{
Code = 65,
LicensedToProvideCare = true,
Manual = true,
Name = "Educational - Podiatric Surgeon Student (Elective)",
NamedInImReg = false,
Prefix = "93",
Validate = true,
Weight = 26
},
new
{
Code = 66,
LicensedToProvideCare = true,
Manual = true,
Name = "Educational - Podiatric Surgeon Resident (Elective)",
NamedInImReg = false,
Prefix = "93",
Validate = true,
Weight = 27
},
new
{
Code = 67,
LicensedToProvideCare = true,
Manual = true,
Name = "Conditional - Podiatric Surgeon Disciplined",
NamedInImReg = false,
Prefix = "93",
Validate = true,
Weight = 28
},
new
{
Code = 25,
LicensedToProvideCare = true,
Manual = false,
Name = "Full Pharmacist",
NamedInImReg = true,
Prefix = "P1",
Validate = true,
Weight = 1
},
new
{
Code = 26,
LicensedToProvideCare = true,
Manual = false,
Name = "Limited Pharmacist",
NamedInImReg = true,
Prefix = "P1",
Validate = true,
Weight = 2
},
new
{
Code = 28,
LicensedToProvideCare = true,
Manual = false,
Name = "Student Pharmacist",
NamedInImReg = false,
Prefix = "P1",
Validate = false,
Weight = 3
},
new
{
Code = 27,
LicensedToProvideCare = true,
Manual = false,
Name = "Temporary Pharmacist",
NamedInImReg = true,
Prefix = "P1",
Validate = true,
Weight = 4
},
new
{
Code = 30,
LicensedToProvideCare = false,
Manual = true,
Name = "Non-Practicing Pharmacist",
NamedInImReg = true,
Prefix = "P1",
Validate = true,
Weight = 5
},
new
{
Code = 29,
LicensedToProvideCare = true,
Manual = false,
Name = "Pharmacy Technician",
NamedInImReg = false,
Prefix = "T9",
Validate = false,
Weight = 6
},
new
{
Code = 31,
LicensedToProvideCare = false,
Manual = true,
Name = "Non-Practicing Pharmacy Technician",
NamedInImReg = false,
Prefix = "T9",
Validate = false,
Weight = 7
},
new
{
Code = 68,
LicensedToProvideCare = true,
Manual = true,
Name = "Temporary Pharmacy Technician",
NamedInImReg = false,
Prefix = "T9",
Validate = false,
Weight = 8
},
new
{
Code = 47,
LicensedToProvideCare = true,
Manual = false,
Name = "Practicing Nurse Practitioner",
NamedInImReg = true,
Prefix = "96",
PrescriberIdType = 2,
Validate = true,
Weight = 1
},
new
{
Code = 48,
LicensedToProvideCare = true,
Manual = true,
Name = "Provisional Nurse Practitioner",
NamedInImReg = true,
Prefix = "96",
Validate = false,
Weight = 2
},
new
{
Code = 51,
LicensedToProvideCare = true,
Manual = false,
Name = "Temporary Nurse Practitioner (Emergency)",
NamedInImReg = true,
Prefix = "96",
PrescriberIdType = 2,
Validate = true,
Weight = 4
},
new
{
Code = 49,
LicensedToProvideCare = false,
Manual = true,
Name = "Non-Practicing Nurse Practitioner",
NamedInImReg = true,
Prefix = "96",
Validate = true,
Weight = 5
},
new
{
Code = 32,
LicensedToProvideCare = true,
Manual = false,
Name = "Practicing Registered Nurse",
NamedInImReg = false,
Prefix = "R9",
PrescriberIdType = 1,
Validate = true,
Weight = 6
},
new
{
Code = 33,
LicensedToProvideCare = true,
Manual = false,
Name = "Provisional Registered Nurse",
NamedInImReg = false,
Prefix = "R9",
Validate = false,
Weight = 7
},
new
{
Code = 39,
LicensedToProvideCare = true,
Manual = false,
Name = "Temporary Registered Nurse (Emergency)",
NamedInImReg = false,
Prefix = "R9",
PrescriberIdType = 1,
Validate = true,
Weight = 9
},
new
{
Code = 34,
LicensedToProvideCare = false,
Manual = true,
Name = "Non-Practicing Registered Nurse",
NamedInImReg = false,
Prefix = "R9",
Validate = false,
Weight = 10
},
new
{
Code = 40,
LicensedToProvideCare = true,
Manual = false,
Name = "Employed Student Nurse",
NamedInImReg = false,
Prefix = "R9",
Validate = false,
Weight = 11
},
new
{
Code = 35,
LicensedToProvideCare = true,
Manual = true,
Name = "Practicing Licensed Graduate Nurse",
NamedInImReg = false,
Prefix = "R9",
PrescriberIdType = 1,
Validate = false,
Weight = 12
},
new
{
Code = 36,
LicensedToProvideCare = true,
Manual = true,
Name = "Provisional Licensed Graduate Nurse",
NamedInImReg = false,
Prefix = "R9",
Validate = false,
Weight = 13
},
new
{
Code = 37,
LicensedToProvideCare = false,
Manual = false,
Name = "Non-Practicing Licensed Graduate Nurse",
NamedInImReg = false,
Prefix = "R9",
Validate = true,
Weight = 14
},
new
{
Code = 41,
LicensedToProvideCare = true,
Manual = false,
Name = "Practicing Registered Psychiatric Nurse",
NamedInImReg = false,
Prefix = "Y9",
PrescriberIdType = 1,
Validate = true,
Weight = 15
},
new
{
Code = 42,
LicensedToProvideCare = true,
Manual = false,
Name = "Provisional Registered Psychiatric Nurse",
NamedInImReg = false,
Prefix = "Y9",
Validate = false,
Weight = 16
},
new
{
Code = 45,
LicensedToProvideCare = true,
Manual = false,
Name = "Temporary Registered Psychiatric Nurse (Emergency)",
NamedInImReg = false,
Prefix = "Y9",
PrescriberIdType = 1,
Validate = true,
Weight = 18
},
new
{
Code = 43,
LicensedToProvideCare = false,
Manual = true,
Name = "Non-Practicing Registered Psychiatric Nurse",
NamedInImReg = false,
Prefix = "Y9",
Validate = false,
Weight = 19
},
new
{
Code = 46,
LicensedToProvideCare = true,
Manual = false,
Name = "Employed Student Psychiatric Nurse",
NamedInImReg = false,
Prefix = "Y9",
Validate = false,
Weight = 20
},
new
{
Code = 52,
LicensedToProvideCare = true,
Manual = false,
Name = "Practicing Licensed Practical Nurse",
NamedInImReg = false,
Prefix = "L9",
Validate = false,
Weight = 21
},
new
{
Code = 53,
LicensedToProvideCare = true,
Manual = false,
Name = "Provisional Licensed Practical Nurse",
NamedInImReg = false,
Prefix = "L9",
Validate = false,
Weight = 22
},
new
{
Code = 55,
LicensedToProvideCare = true,
Manual = false,
Name = "Temporary Licensed Practical Nurse (Emergency)",
NamedInImReg = false,
Prefix = "L9",
Validate = false,
Weight = 23
},
new
{
Code = 54,
LicensedToProvideCare = false,
Manual = true,
Name = "Non-Practicing Licensed Practical Nurse",
NamedInImReg = false,
Prefix = "L9",
Validate = false,
Weight = 25
},
new
{
Code = 60,
LicensedToProvideCare = true,
Manual = false,
Name = "Practising Midwife",
NamedInImReg = false,
Prefix = "98",
Validate = false,
Weight = 28
},
new
{
Code = 61,
LicensedToProvideCare = true,
Manual = false,
Name = "Provisional Midwife",
NamedInImReg = false,
Prefix = "98",
Validate = false,
Weight = 29
},
new
{
Code = 62,
LicensedToProvideCare = true,
Manual = false,
Name = "Temporary Midwife (Emergency)",
NamedInImReg = false,
Prefix = "98",
Validate = false,
Weight = 30
},
new
{
Code = 63,
LicensedToProvideCare = true,
Manual = true,
Name = "Non-Practising Midwife",
NamedInImReg = false,
Prefix = "98",
Validate = false,
Weight = 31
},
new
{
Code = 69,
LicensedToProvideCare = true,
Manual = true,
Name = "Student Midwife",
NamedInImReg = false,
Prefix = "98",
Validate = false,
Weight = 32
},
new
{
Code = 64,
LicensedToProvideCare = false,
Manual = true,
Name = "Not Displayed",
NamedInImReg = false,
Prefix = "",
Validate = false,
Weight = 1
});
});
modelBuilder.Entity("Prime.Models.LimitsConditionsClause", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("EffectiveDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Text")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("LimitsConditionsClause");
});
modelBuilder.Entity("Prime.Models.OboSite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("CareSettingCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("FacilityName")
.HasColumnType("text");
b.Property<int?>("HealthAuthorityCode")
.HasColumnType("integer");
b.Property<string>("JobTitle")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PEC")
.HasColumnType("text");
b.Property<int>("PhysicalAddressId")
.HasColumnType("integer");
b.Property<string>("SiteName")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CareSettingCode");
b.HasIndex("EnrolleeId");
b.HasIndex("HealthAuthorityCode");
b.HasIndex("PhysicalAddressId");
b.ToTable("OboSite");
});
modelBuilder.Entity("Prime.Models.Organization", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<bool>("Completed")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("DoingBusinessAs")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("RegistrationId")
.HasColumnType("text");
b.Property<int>("SigningAuthorityId")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("SubmittedDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("SigningAuthorityId");
b.ToTable("Organization");
});
modelBuilder.Entity("Prime.Models.Party", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("timestamp without time zone");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("Fax")
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("GivenNames")
.HasColumnType("text");
b.Property<string>("HPDID")
.HasColumnType("character varying(255)")
.HasMaxLength(255);
b.Property<string>("JobRoleTitle")
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<string>("PhoneExtension")
.HasColumnType("text");
b.Property<string>("PreferredFirstName")
.HasColumnType("text");
b.Property<string>("PreferredLastName")
.HasColumnType("text");
b.Property<string>("PreferredMiddleName")
.HasColumnType("text");
b.Property<string>("SMSPhone")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("Party");
});
modelBuilder.Entity("Prime.Models.PartyAddress", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AddressId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("PartyId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AddressId");
b.HasIndex("PartyId", "AddressId")
.IsUnique();
b.ToTable("PartyAddress");
});
modelBuilder.Entity("Prime.Models.PartyEnrolment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("PartyId")
.HasColumnType("integer");
b.Property<int>("PartyType")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("PartyId");
b.ToTable("PartyEnrolment");
});
modelBuilder.Entity("Prime.Models.PlrProvider", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Address1Line1")
.HasColumnType("text");
b.Property<string>("Address1Line2")
.HasColumnType("text");
b.Property<string>("Address1Line3")
.HasColumnType("text");
b.Property<DateTime>("Address1StartDate")
.HasColumnType("timestamp without time zone");
b.Property<string>("Address2Line1")
.HasColumnType("text");
b.Property<string>("Address2Line2")
.HasColumnType("text");
b.Property<string>("Address2Line3")
.HasColumnType("text");
b.Property<DateTime>("Address2StartDate")
.HasColumnType("timestamp without time zone");
b.Property<string>("City1")
.HasColumnType("text");
b.Property<string>("City2")
.HasColumnType("text");
b.Property<string>("CollegeId")
.HasColumnType("text");
b.Property<string>("ConditionCode")
.HasColumnType("text");
b.Property<string>("Country1")
.HasColumnType("text");
b.Property<string>("Country2")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Credentials")
.HasColumnType("text");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("timestamp without time zone");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("Expertise")
.HasColumnType("text");
b.Property<string>("FaxAreaCode")
.HasColumnType("text");
b.Property<string>("FaxNumber")
.HasColumnType("text");
b.Property<string>("FirstName")
.HasColumnType("text");
b.Property<string>("Gender")
.HasColumnType("text");
b.Property<string>("IdentifierType")
.HasColumnType("text");
b.Property<string>("Ipc")
.HasColumnType("text");
b.Property<string>("Languages")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("MspId")
.HasColumnType("text");
b.Property<string>("NamePrefix")
.HasColumnType("text");
b.Property<string>("PostalCode1")
.HasColumnType("text");
b.Property<string>("PostalCode2")
.HasColumnType("text");
b.Property<string>("ProviderRoleType")
.HasColumnType("text");
b.Property<string>("Province1")
.HasColumnType("text");
b.Property<string>("Province2")
.HasColumnType("text");
b.Property<string>("SecondName")
.HasColumnType("text");
b.Property<string>("StatusCode")
.HasColumnType("text");
b.Property<DateTime>("StatusExpiryDate")
.HasColumnType("timestamp without time zone");
b.Property<string>("StatusReasonCode")
.HasColumnType("text");
b.Property<DateTime>("StatusStartDate")
.HasColumnType("timestamp without time zone");
b.Property<string>("Suffix")
.HasColumnType("text");
b.Property<string>("TelephoneAreaCode")
.HasColumnType("text");
b.Property<string>("TelephoneNumber")
.HasColumnType("text");
b.Property<string>("ThirdName")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("Ipc")
.IsUnique();
b.ToTable("PlrProvider");
});
modelBuilder.Entity("Prime.Models.Practice", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("PracticeLookup");
b.HasData(
new
{
Code = 1,
Name = "Remote Practice"
},
new
{
Code = 2,
Name = "Reproductive Health - Sexually Transmitted Infections"
},
new
{
Code = 3,
Name = "Reproductive Health - Contraceptive Management"
},
new
{
Code = 4,
Name = "First Call"
});
});
modelBuilder.Entity("Prime.Models.PreApprovedRegistration", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PartyType")
.HasColumnType("integer");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("PreApprovedRegistration");
});
modelBuilder.Entity("Prime.Models.Privilege", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Description")
.HasColumnType("text");
b.Property<int>("PrivilegeGroupCode")
.HasColumnType("integer");
b.Property<string>("TransactionType")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("PrivilegeGroupCode");
b.ToTable("Privilege");
b.HasData(
new
{
Id = 1,
Description = "Update Claims History",
PrivilegeGroupCode = 1,
TransactionType = "TAC"
},
new
{
Id = 2,
Description = "Query Claims History",
PrivilegeGroupCode = 1,
TransactionType = "TDT"
},
new
{
Id = 3,
Description = "Pt Profile Mail Request",
PrivilegeGroupCode = 1,
TransactionType = "TPM"
},
new
{
Id = 4,
Description = "Maintain Pt Keyword",
PrivilegeGroupCode = 1,
TransactionType = "TCP"
},
new
{
Id = 5,
Description = "New PHN",
PrivilegeGroupCode = 2,
TransactionType = "TPH"
},
new
{
Id = 6,
Description = "Address Update",
PrivilegeGroupCode = 2,
TransactionType = "TPA"
},
new
{
Id = 7,
Description = "Medication Update",
PrivilegeGroupCode = 2,
TransactionType = "TMU"
},
new
{
Id = 8,
Description = "Drug Monograph",
PrivilegeGroupCode = 3,
TransactionType = "TDR"
},
new
{
Id = 9,
Description = "Patient Details",
PrivilegeGroupCode = 3,
TransactionType = "TID"
},
new
{
Id = 10,
Description = "Location Details",
PrivilegeGroupCode = 3,
TransactionType = "TIL"
},
new
{
Id = 11,
Description = "Prescriber Details",
PrivilegeGroupCode = 3,
TransactionType = "TIP"
},
new
{
Id = 12,
Description = "Name Search",
PrivilegeGroupCode = 3,
TransactionType = "TPN"
},
new
{
Id = 13,
Description = "Pt Profile Request",
PrivilegeGroupCode = 3,
TransactionType = "TRP"
},
new
{
Id = 14,
Description = "Most Recent Profile",
PrivilegeGroupCode = 3,
TransactionType = "TBR"
},
new
{
Id = 15,
Description = "Filled Elsewhere Profile",
PrivilegeGroupCode = 3,
TransactionType = "TRS"
},
new
{
Id = 16,
Description = "DUE Inquiry",
PrivilegeGroupCode = 3,
TransactionType = "TDU"
},
new
{
Id = 19,
Description = "Regulated User that can have OBOs",
PrivilegeGroupCode = 5,
TransactionType = "RU with OBOs"
});
});
modelBuilder.Entity("Prime.Models.PrivilegeGroup", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("PrivilegeTypeCode")
.HasColumnType("integer");
b.HasKey("Code");
b.HasIndex("PrivilegeTypeCode");
b.ToTable("PrivilegeGroupLookup");
b.HasData(
new
{
Code = 1,
Name = "Submit and Access Claims",
PrivilegeTypeCode = 2
},
new
{
Code = 2,
Name = "Record Medical History",
PrivilegeTypeCode = 2
},
new
{
Code = 3,
Name = "Access Medical History",
PrivilegeTypeCode = 2
},
new
{
Code = 5,
Name = "RU That Can Have OBOs",
PrivilegeTypeCode = 1
});
});
modelBuilder.Entity("Prime.Models.PrivilegeType", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("PrivilegeTypeLookup");
b.HasData(
new
{
Code = 1,
Name = "Allowable Role"
},
new
{
Code = 2,
Name = "Allowable Transaction"
});
});
modelBuilder.Entity("Prime.Models.Province", b =>
{
b.Property<string>("Code")
.HasColumnType("text");
b.Property<string>("CountryCode")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.HasIndex("CountryCode");
b.ToTable("ProvinceLookup");
b.HasData(
new
{
Code = "AB",
CountryCode = "CA",
Name = "Alberta"
},
new
{
Code = "BC",
CountryCode = "CA",
Name = "British Columbia"
},
new
{
Code = "MB",
CountryCode = "CA",
Name = "Manitoba"
},
new
{
Code = "NB",
CountryCode = "CA",
Name = "New Brunswick"
},
new
{
Code = "NL",
CountryCode = "CA",
Name = "Newfoundland and Labrador"
},
new
{
Code = "NS",
CountryCode = "CA",
Name = "Nova Scotia"
},
new
{
Code = "ON",
CountryCode = "CA",
Name = "Ontario"
},
new
{
Code = "PE",
CountryCode = "CA",
Name = "Prince Edward Island"
},
new
{
Code = "QC",
CountryCode = "CA",
Name = "Quebec"
},
new
{
Code = "SK",
CountryCode = "CA",
Name = "Saskatchewan"
},
new
{
Code = "NT",
CountryCode = "CA",
Name = "Northwest Territories"
},
new
{
Code = "NU",
CountryCode = "CA",
Name = "Nunavut"
},
new
{
Code = "YT",
CountryCode = "CA",
Name = "Yukon"
},
new
{
Code = "AL",
CountryCode = "US",
Name = "Alabama"
},
new
{
Code = "AK",
CountryCode = "US",
Name = "Alaska"
},
new
{
Code = "AS",
CountryCode = "US",
Name = "American Samoa"
},
new
{
Code = "AZ",
CountryCode = "US",
Name = "Arizona"
},
new
{
Code = "AR",
CountryCode = "US",
Name = "Arkansas"
},
new
{
Code = "CA",
CountryCode = "US",
Name = "California"
},
new
{
Code = "CO",
CountryCode = "US",
Name = "Colorado"
},
new
{
Code = "CT",
CountryCode = "US",
Name = "Connecticut"
},
new
{
Code = "DE",
CountryCode = "US",
Name = "Delaware"
},
new
{
Code = "DC",
CountryCode = "US",
Name = "District of Columbia"
},
new
{
Code = "FL",
CountryCode = "US",
Name = "Florida"
},
new
{
Code = "GA",
CountryCode = "US",
Name = "Georgia"
},
new
{
Code = "GU",
CountryCode = "US",
Name = "Guam"
},
new
{
Code = "HI",
CountryCode = "US",
Name = "Hawaii"
},
new
{
Code = "ID",
CountryCode = "US",
Name = "Idaho"
},
new
{
Code = "IL",
CountryCode = "US",
Name = "Illinois"
},
new
{
Code = "IN",
CountryCode = "US",
Name = "Indiana"
},
new
{
Code = "IA",
CountryCode = "US",
Name = "Iowa"
},
new
{
Code = "KS",
CountryCode = "US",
Name = "Kansas"
},
new
{
Code = "KY",
CountryCode = "US",
Name = "Kentucky"
},
new
{
Code = "LA",
CountryCode = "US",
Name = "Louisiana"
},
new
{
Code = "ME",
CountryCode = "US",
Name = "Maine"
},
new
{
Code = "MD",
CountryCode = "US",
Name = "Maryland"
},
new
{
Code = "MA",
CountryCode = "US",
Name = "Massachusetts"
},
new
{
Code = "MI",
CountryCode = "US",
Name = "Michigan"
},
new
{
Code = "MN",
CountryCode = "US",
Name = "Minnesota"
},
new
{
Code = "MS",
CountryCode = "US",
Name = "Mississippi"
},
new
{
Code = "MO",
CountryCode = "US",
Name = "Missouri"
},
new
{
Code = "MT",
CountryCode = "US",
Name = "Montana"
},
new
{
Code = "NE",
CountryCode = "US",
Name = "Nebraska"
},
new
{
Code = "NV",
CountryCode = "US",
Name = "Nevada"
},
new
{
Code = "NH",
CountryCode = "US",
Name = "New Hampshire"
},
new
{
Code = "NJ",
CountryCode = "US",
Name = "New Jersey"
},
new
{
Code = "NM",
CountryCode = "US",
Name = "New Mexico"
},
new
{
Code = "NY",
CountryCode = "US",
Name = "New York"
},
new
{
Code = "NC",
CountryCode = "US",
Name = "North Carolina"
},
new
{
Code = "ND",
CountryCode = "US",
Name = "North Dakota"
},
new
{
Code = "MP",
CountryCode = "US",
Name = "Northern Mariana Islands"
},
new
{
Code = "OH",
CountryCode = "US",
Name = "Ohio"
},
new
{
Code = "OK",
CountryCode = "US",
Name = "Oklahoma"
},
new
{
Code = "OR",
CountryCode = "US",
Name = "Oregon"
},
new
{
Code = "PA",
CountryCode = "US",
Name = "Pennsylvania"
},
new
{
Code = "PR",
CountryCode = "US",
Name = "Puerto Rico"
},
new
{
Code = "RI",
CountryCode = "US",
Name = "Rhode Island"
},
new
{
Code = "SC",
CountryCode = "US",
Name = "South Carolina"
},
new
{
Code = "SD",
CountryCode = "US",
Name = "South Dakota"
},
new
{
Code = "TN",
CountryCode = "US",
Name = "Tennessee"
},
new
{
Code = "TX",
CountryCode = "US",
Name = "Texas"
},
new
{
Code = "UM",
CountryCode = "US",
Name = "United States Minor Outlying Islands"
},
new
{
Code = "UT",
CountryCode = "US",
Name = "Utah"
},
new
{
Code = "VT",
CountryCode = "US",
Name = "Vermont"
},
new
{
Code = "VI",
CountryCode = "US",
Name = "Virgin Islands, U.S."
},
new
{
Code = "VA",
CountryCode = "US",
Name = "Virginia"
},
new
{
Code = "WA",
CountryCode = "US",
Name = "Washington"
},
new
{
Code = "WV",
CountryCode = "US",
Name = "West Virginia"
},
new
{
Code = "WI",
CountryCode = "US",
Name = "Wisconsin"
},
new
{
Code = "WY",
CountryCode = "US",
Name = "Wyoming"
});
});
modelBuilder.Entity("Prime.Models.RemoteAccessLocation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("InternetProvider")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PhysicalAddressId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("PhysicalAddressId");
b.ToTable("RemoteAccessLocation");
});
modelBuilder.Entity("Prime.Models.RemoteAccessSite", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("SiteId");
b.ToTable("RemoteAccessSite");
});
modelBuilder.Entity("Prime.Models.RemoteUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("HealthAuthoritySiteId")
.HasColumnType("integer");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("HealthAuthoritySiteId");
b.HasIndex("SiteId");
b.ToTable("RemoteUser");
});
modelBuilder.Entity("Prime.Models.RemoteUserCertification", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("CollegeCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("LicenseCode")
.HasColumnType("integer");
b.Property<string>("LicenseNumber")
.IsRequired()
.HasColumnType("text");
b.Property<int>("RemoteUserId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CollegeCode");
b.HasIndex("LicenseCode");
b.HasIndex("RemoteUserId");
b.ToTable("RemoteUserCertification");
});
modelBuilder.Entity("Prime.Models.SelfDeclaration", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("SelfDeclarationDetails")
.HasColumnType("text");
b.Property<int>("SelfDeclarationTypeCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("SelfDeclarationTypeCode");
b.ToTable("SelfDeclaration");
});
modelBuilder.Entity("Prime.Models.SelfDeclarationDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<int>("SelfDeclarationTypeCode")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.HasIndex("SelfDeclarationTypeCode");
b.ToTable("SelfDeclarationDocument");
});
modelBuilder.Entity("Prime.Models.SelfDeclarationType", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("SelfDeclarationTypeLookup");
b.HasData(
new
{
Code = 1,
Name = "Has Conviction"
},
new
{
Code = 2,
Name = "Has Registration Suspended"
},
new
{
Code = 3,
Name = "Has Disciplinary Action"
},
new
{
Code = 4,
Name = "Has PharmaNet Suspended"
});
});
modelBuilder.Entity("Prime.Models.SignedAgreementDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AgreementId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AgreementId")
.IsUnique();
b.ToTable("SignedAgreementDocument");
});
modelBuilder.Entity("Prime.Models.Site", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AdjudicatorId")
.HasColumnType("integer");
b.Property<int?>("AdministratorPharmaNetId")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("ApprovedDate")
.HasColumnType("timestamp with time zone");
b.Property<int?>("CareSettingCode")
.HasColumnType("integer");
b.Property<bool>("Completed")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<string>("DoingBusinessAs")
.HasColumnType("text");
b.Property<int>("OrganizationId")
.HasColumnType("integer");
b.Property<string>("PEC")
.HasColumnType("text");
b.Property<int?>("PhysicalAddressId")
.HasColumnType("integer");
b.Property<int?>("PrivacyOfficerId")
.HasColumnType("integer");
b.Property<int?>("ProvisionerId")
.HasColumnType("integer");
b.Property<DateTimeOffset?>("SubmittedDate")
.HasColumnType("timestamp with time zone");
b.Property<int?>("TechnicalSupportId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("AdministratorPharmaNetId");
b.HasIndex("CareSettingCode");
b.HasIndex("OrganizationId");
b.HasIndex("PhysicalAddressId");
b.HasIndex("PrivacyOfficerId");
b.HasIndex("ProvisionerId");
b.HasIndex("TechnicalSupportId");
b.ToTable("Site");
});
modelBuilder.Entity("Prime.Models.SiteAdjudicationDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdjudicatorId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<int?>("HealthAuthoritySiteId")
.HasColumnType("integer");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("HealthAuthoritySiteId");
b.HasIndex("SiteId");
b.ToTable("SiteAdjudicationDocument");
});
modelBuilder.Entity("Prime.Models.SiteNotification", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdminId")
.HasColumnType("integer");
b.Property<int>("AssigneeId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("SiteRegistrationNoteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdminId");
b.HasIndex("AssigneeId");
b.HasIndex("SiteRegistrationNoteId")
.IsUnique();
b.ToTable("SiteNotification");
});
modelBuilder.Entity("Prime.Models.SiteRegistrationNote", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("AdjudicatorId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int?>("HealthAuthoritySiteId")
.HasColumnType("integer");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("NoteDate")
.HasColumnType("timestamp with time zone");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("AdjudicatorId");
b.HasIndex("HealthAuthoritySiteId");
b.HasIndex("SiteId");
b.ToTable("SiteRegistrationNote");
});
modelBuilder.Entity("Prime.Models.SiteRegistrationReviewDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<Guid>("DocumentGuid")
.HasColumnType("uuid");
b.Property<string>("Filename")
.HasColumnType("text");
b.Property<int?>("HealthAuthoritySiteId")
.HasColumnType("integer");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("UploadedDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("HealthAuthoritySiteId");
b.HasIndex("SiteId");
b.ToTable("SiteRegistrationReviewDocument");
});
modelBuilder.Entity("Prime.Models.SiteStatus", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("StatusDate")
.HasColumnType("timestamp with time zone");
b.Property<int>("StatusType")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("SiteId");
b.ToTable("SiteStatus");
});
modelBuilder.Entity("Prime.Models.SiteVendor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.Property<int>("VendorCode")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("SiteId");
b.HasIndex("VendorCode");
b.ToTable("SiteVendor");
});
modelBuilder.Entity("Prime.Models.Status", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("StatusLookup");
b.HasData(
new
{
Code = 1,
Name = "Editable"
},
new
{
Code = 2,
Name = "Under Review"
},
new
{
Code = 3,
Name = "Requires TOA"
},
new
{
Code = 4,
Name = "Locked"
},
new
{
Code = 5,
Name = "Declined"
});
});
modelBuilder.Entity("Prime.Models.StatusReason", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Code");
b.ToTable("StatusReasonLookup");
b.HasData(
new
{
Code = 1,
Name = "Automatically Adjudicated"
},
new
{
Code = 2,
Name = "Manually Adjudicated"
},
new
{
Code = 3,
Name = "PharmaNet Error, License could not be validated"
},
new
{
Code = 4,
Name = "College License or Practitioner ID not in PharmaNet table"
},
new
{
Code = 6,
Name = "Birthdate discrepancy in PharmaNet practitioner table"
},
new
{
Code = 5,
Name = "Name discrepancy in PharmaNet practitioner table"
},
new
{
Code = 7,
Name = "Listed as Non-Practicing in PharmaNet practitioner table"
},
new
{
Code = 8,
Name = "Insulin Pump Provider"
},
new
{
Code = 9,
Name = "Licence Class requires manual adjudication"
},
new
{
Code = 10,
Name = "Answered one or more Self Declaration questions \"Yes\""
},
new
{
Code = 11,
Name = "Contact Address or Identity Address not in British Columbia"
},
new
{
Code = 12,
Name = "Admin has flagged the applicant for manual adjudication"
},
new
{
Code = 13,
Name = "User does not have high enough identity assurance level"
},
new
{
Code = 14,
Name = "User authenticated with a method other than BC Services Card"
},
new
{
Code = 15,
Name = "User has Requested Remote Access"
},
new
{
Code = 16,
Name = "Terms of Access to be determined by an Adjudicator"
},
new
{
Code = 17,
Name = "No address from BCSC. Enrollee entered address."
},
new
{
Code = 18,
Name = "Manually entered paper enrolment"
});
});
modelBuilder.Entity("Prime.Models.Submission", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("AgreementType")
.HasColumnType("integer");
b.Property<bool>("Confirmed")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("CreatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedUserId")
.HasColumnType("uuid");
b.Property<int>("EnrolleeId")
.HasColumnType("integer");
b.Property<string>("ProfileSnapshot")
.IsRequired()
.HasColumnType("json");
b.Property<bool>("RequestedRemoteAccess")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("UpdatedTimeStamp")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedUserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("EnrolleeId");
b.ToTable("Submission");
});
modelBuilder.Entity("Prime.Models.Vendor", b =>
{
b.Property<int>("Code")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("CareSettingCode")
.HasColumnType("integer");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Code");
b.HasIndex("CareSettingCode");
b.ToTable("VendorLookup");
b.HasData(
new
{
Code = 1,
CareSettingCode = 2,
Email = "CareConnect@phsa.ca",
Name = "CareConnect"
},
new
{
Code = 2,
CareSettingCode = 2,
Email = "support@excelleris.com",
Name = "Excelleris"
},
new
{
Code = 3,
CareSettingCode = 2,
Email = "help@iclinicemr.com",
Name = "iClinic"
},
new
{
Code = 4,
CareSettingCode = 2,
Email = "prime@medinet.ca",
Name = "Medinet"
},
new
{
Code = 5,
CareSettingCode = 2,
Email = "service@plexia.ca",
Name = "Plexia"
},
new
{
Code = 6,
CareSettingCode = 3,
Email = "",
Name = "PharmaClik"
},
new
{
Code = 7,
CareSettingCode = 3,
Email = "",
Name = "Nexxsys"
},
new
{
Code = 8,
CareSettingCode = 3,
Email = "",
Name = "Kroll"
},
new
{
Code = 9,
CareSettingCode = 3,
Email = "",
Name = "Assyst Rx-A"
},
new
{
Code = 10,
CareSettingCode = 3,
Email = "",
Name = "WinRx"
},
new
{
Code = 11,
CareSettingCode = 3,
Email = "",
Name = "Shoppers Drug Mart HealthWatch NG"
},
new
{
Code = 12,
CareSettingCode = 3,
Email = "",
Name = "Commander Group"
},
new
{
Code = 13,
CareSettingCode = 3,
Email = "",
Name = "BDM"
});
});
modelBuilder.Entity("Prime.Models.MailingAddress", b =>
{
b.HasBaseType("Prime.Models.Address");
b.ToTable("Address");
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("Prime.Models.PhysicalAddress", b =>
{
b.HasBaseType("Prime.Models.Address");
b.ToTable("Address");
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("Prime.Models.VerifiedAddress", b =>
{
b.HasBaseType("Prime.Models.Address");
b.ToTable("Address");
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityPharmanetAdministrator", b =>
{
b.HasBaseType("Prime.Models.HealthAuthorities.HealthAuthorityContact");
b.HasIndex("HealthAuthorityOrganizationId");
b.ToTable("HealthAuthorityContact");
b.HasDiscriminator().HasValue("HealthAuthorityPharmanetAdministrator");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityPrivacyOfficer", b =>
{
b.HasBaseType("Prime.Models.HealthAuthorities.HealthAuthorityContact");
b.HasIndex("HealthAuthorityOrganizationId")
.HasName("IX_HealthAuthorityContact_HealthAuthorityOrganizationId1");
b.ToTable("HealthAuthorityContact");
b.HasDiscriminator().HasValue("HealthAuthorityPrivacyOfficer");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityTechnicalSupport", b =>
{
b.HasBaseType("Prime.Models.HealthAuthorities.HealthAuthorityContact");
b.HasIndex("HealthAuthorityOrganizationId")
.HasName("IX_HealthAuthorityContact_HealthAuthorityOrganizationId2");
b.ToTable("HealthAuthorityContact");
b.HasDiscriminator().HasValue("HealthAuthorityTechnicalSupport");
});
modelBuilder.Entity("Prime.Models.AccessAgreementNote", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany()
.HasForeignKey("AdjudicatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithOne("AccessAgreementNote")
.HasForeignKey("Prime.Models.AccessAgreementNote", "EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Address", b =>
{
b.HasOne("Prime.Models.Country", "Country")
.WithMany()
.HasForeignKey("CountryCode");
b.HasOne("Prime.Models.Province", "Province")
.WithMany()
.HasForeignKey("ProvinceCode");
});
modelBuilder.Entity("Prime.Models.Agreement", b =>
{
b.HasOne("Prime.Models.AgreementVersion", "AgreementVersion")
.WithMany()
.HasForeignKey("AgreementVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("Agreements")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Prime.Models.LimitsConditionsClause", "LimitsConditionsClause")
.WithMany()
.HasForeignKey("LimitsConditionsClauseId");
b.HasOne("Prime.Models.Organization", "Organization")
.WithMany("Agreements")
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Prime.Models.Party", "Party")
.WithMany("Agreements")
.HasForeignKey("PartyId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Prime.Models.AssignedPrivilege", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("AssignedPrivileges")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Privilege", "Privilege")
.WithMany("AssignedPrivileges")
.HasForeignKey("PrivilegeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.AuthorizedUser", b =>
{
b.HasOne("Prime.Models.HealthAuthority", "HealthAuthority")
.WithMany()
.HasForeignKey("HealthAuthorityCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Party", "Party")
.WithMany()
.HasForeignKey("PartyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.BusinessDay", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthoritySite", null)
.WithMany("BusinessHours")
.HasForeignKey("HealthAuthoritySiteId");
b.HasOne("Prime.Models.Site", "Site")
.WithMany("BusinessHours")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.BusinessEvent", b =>
{
b.HasOne("Prime.Models.Admin", "Admin")
.WithMany()
.HasForeignKey("AdminId");
b.HasOne("Prime.Models.BusinessEventType", "BusinessEventType")
.WithMany("BusinessEvents")
.HasForeignKey("BusinessEventTypeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany()
.HasForeignKey("EnrolleeId");
b.HasOne("Prime.Models.Organization", "Organization")
.WithMany()
.HasForeignKey("OrganizationId");
b.HasOne("Prime.Models.Party", "Party")
.WithMany()
.HasForeignKey("PartyId");
b.HasOne("Prime.Models.Site", "Site")
.WithMany()
.HasForeignKey("SiteId");
});
modelBuilder.Entity("Prime.Models.BusinessLicence", b =>
{
b.HasOne("Prime.Models.Site", "Site")
.WithOne("BusinessLicence")
.HasForeignKey("Prime.Models.BusinessLicence", "SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.BusinessLicenceDocument", b =>
{
b.HasOne("Prime.Models.BusinessLicence", "BusinessLicence")
.WithOne("BusinessLicenceDocument")
.HasForeignKey("Prime.Models.BusinessLicenceDocument", "BusinessLicenceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Certification", b =>
{
b.HasOne("Prime.Models.College", "College")
.WithMany("Certifications")
.HasForeignKey("CollegeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("Certifications")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.License", "License")
.WithMany("Certifications")
.HasForeignKey("LicenseCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Practice", "Practice")
.WithMany("Certifications")
.HasForeignKey("PracticeCode");
});
modelBuilder.Entity("Prime.Models.CollegeLicense", b =>
{
b.HasOne("Prime.Models.College", "College")
.WithMany("CollegeLicenses")
.HasForeignKey("CollegeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.CollegeLicenseGrouping", "CollegeLicenseGrouping")
.WithMany()
.HasForeignKey("CollegeLicenseGroupingCode");
b.HasOne("Prime.Models.License", "License")
.WithMany("CollegeLicenses")
.HasForeignKey("LicenseCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.CollegePractice", b =>
{
b.HasOne("Prime.Models.College", "College")
.WithMany("CollegePractices")
.HasForeignKey("CollegeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Practice", "Practice")
.WithMany("CollegePractices")
.HasForeignKey("PracticeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Contact", b =>
{
b.HasOne("Prime.Models.PhysicalAddress", "PhysicalAddress")
.WithMany()
.HasForeignKey("PhysicalAddressId");
});
modelBuilder.Entity("Prime.Models.DefaultPrivilege", b =>
{
b.HasOne("Prime.Models.License", "License")
.WithMany("DefaultPrivileges")
.HasForeignKey("LicenseCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Privilege", "Privilege")
.WithMany("DefaultPrivileges")
.HasForeignKey("PrivilegeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Enrollee", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany("Enrollees")
.HasForeignKey("AdjudicatorId");
});
modelBuilder.Entity("Prime.Models.EnrolleeAddress", b =>
{
b.HasOne("Prime.Models.Address", "Address")
.WithMany()
.HasForeignKey("AddressId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("Addresses")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeAdjudicationDocument", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany()
.HasForeignKey("AdjudicatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("EnrolleeAdjudicationDocuments")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeCareSetting", b =>
{
b.HasOne("Prime.Models.CareSetting", "CareSetting")
.WithMany("EnrolleeCareSettings")
.HasForeignKey("CareSettingCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("EnrolleeCareSettings")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeCredential", b =>
{
b.HasOne("Prime.Models.Credential", "Credential")
.WithMany()
.HasForeignKey("CredentialId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("EnrolleeCredentials")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeHealthAuthority", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("EnrolleeHealthAuthorities")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.HealthAuthority", "HealthAuthority")
.WithMany()
.HasForeignKey("HealthAuthorityCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeNote", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany("AdjudicatorNotes")
.HasForeignKey("AdjudicatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("AdjudicatorNotes")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeNotification", b =>
{
b.HasOne("Prime.Models.Admin", "Admin")
.WithMany()
.HasForeignKey("AdminId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Admin", "Assignee")
.WithMany()
.HasForeignKey("AssigneeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.EnrolleeNote", "EnrolleeNote")
.WithOne("EnrolleeNotification")
.HasForeignKey("Prime.Models.EnrolleeNotification", "EnrolleeNoteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolleeRemoteUser", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("EnrolleeRemoteUsers")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.RemoteUser", "RemoteUser")
.WithMany()
.HasForeignKey("RemoteUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolmentCertificateAccessToken", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany()
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolmentStatus", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("EnrolmentStatuses")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Status", "Status")
.WithMany("EnrolmentStatuses")
.HasForeignKey("StatusCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolmentStatusReason", b =>
{
b.HasOne("Prime.Models.EnrolmentStatus", "EnrolmentStatus")
.WithMany("EnrolmentStatusReasons")
.HasForeignKey("EnrolmentStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.StatusReason", "StatusReason")
.WithMany("EnrolmentStatusReasons")
.HasForeignKey("StatusReasonCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.EnrolmentStatusReference", b =>
{
b.HasOne("Prime.Models.EnrolleeNote", "AdjudicatorNote")
.WithOne("EnrolmentStatusReference")
.HasForeignKey("Prime.Models.EnrolmentStatusReference", "AdjudicatorNoteId");
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany("EnrolmentStatusReference")
.HasForeignKey("AdminId");
b.HasOne("Prime.Models.EnrolmentStatus", "EnrolmentStatus")
.WithOne("EnrolmentStatusReference")
.HasForeignKey("Prime.Models.EnrolmentStatusReference", "EnrolmentStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.GisEnrolment", b =>
{
b.HasOne("Prime.Models.Party", "Party")
.WithMany()
.HasForeignKey("PartyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityCareType", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "HealthAuthorityOrganization")
.WithMany("CareTypes")
.HasForeignKey("HealthAuthorityOrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityContact", b =>
{
b.HasOne("Prime.Models.Contact", "Contact")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthoritySite", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany()
.HasForeignKey("AdjudicatorId");
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "Organization")
.WithMany()
.HasForeignKey("HealthAuthorityOrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityPharmanetAdministrator", "HealthAuthorityPharmanetAdministrator")
.WithMany()
.HasForeignKey("HealthAuthorityPharmanetAdministratorId");
b.HasOne("Prime.Models.PhysicalAddress", "PhysicalAddress")
.WithMany()
.HasForeignKey("PhysicalAddressId");
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityVendor", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "HealthAuthorityOrganization")
.WithMany("Vendors")
.HasForeignKey("HealthAuthorityOrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Vendor", "Vendor")
.WithMany()
.HasForeignKey("VendorCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.PrivacyOffice", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "HealthAuthorityOrganization")
.WithOne("PrivacyOffice")
.HasForeignKey("Prime.Models.HealthAuthorities.PrivacyOffice", "HealthAuthorityOrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.PhysicalAddress", "PhysicalAddress")
.WithMany()
.HasForeignKey("PhysicalAddressId");
});
modelBuilder.Entity("Prime.Models.IdentificationDocument", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("IdentificationDocuments")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Job", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany()
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.OboSite", b =>
{
b.HasOne("Prime.Models.CareSetting", "CareSetting")
.WithMany()
.HasForeignKey("CareSettingCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("OboSites")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.HealthAuthority", "HealthAuthority")
.WithMany()
.HasForeignKey("HealthAuthorityCode");
b.HasOne("Prime.Models.PhysicalAddress", "PhysicalAddress")
.WithMany()
.HasForeignKey("PhysicalAddressId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Organization", b =>
{
b.HasOne("Prime.Models.Party", "SigningAuthority")
.WithMany()
.HasForeignKey("SigningAuthorityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.PartyAddress", b =>
{
b.HasOne("Prime.Models.Address", "Address")
.WithMany()
.HasForeignKey("AddressId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Party", "Party")
.WithMany("Addresses")
.HasForeignKey("PartyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.PartyEnrolment", b =>
{
b.HasOne("Prime.Models.Party", "Party")
.WithMany("PartyEnrolments")
.HasForeignKey("PartyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Privilege", b =>
{
b.HasOne("Prime.Models.PrivilegeGroup", "PrivilegeGroup")
.WithMany("Privileges")
.HasForeignKey("PrivilegeGroupCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.PrivilegeGroup", b =>
{
b.HasOne("Prime.Models.PrivilegeType", "PrivilegeType")
.WithMany("PrivilegeGroups")
.HasForeignKey("PrivilegeTypeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Province", b =>
{
b.HasOne("Prime.Models.Country", "Country")
.WithMany()
.HasForeignKey("CountryCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.RemoteAccessLocation", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("RemoteAccessLocations")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.PhysicalAddress", "PhysicalAddress")
.WithMany()
.HasForeignKey("PhysicalAddressId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.RemoteAccessSite", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("RemoteAccessSites")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Site", "Site")
.WithMany()
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.RemoteUser", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthoritySite", null)
.WithMany("RemoteUsers")
.HasForeignKey("HealthAuthoritySiteId");
b.HasOne("Prime.Models.Site", "Site")
.WithMany("RemoteUsers")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.RemoteUserCertification", b =>
{
b.HasOne("Prime.Models.College", "College")
.WithMany()
.HasForeignKey("CollegeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.License", "License")
.WithMany()
.HasForeignKey("LicenseCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.RemoteUser", "RemoteUser")
.WithMany("RemoteUserCertifications")
.HasForeignKey("RemoteUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SelfDeclaration", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("SelfDeclarations")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.SelfDeclarationType", "SelfDeclarationType")
.WithMany("SelfDeclarations")
.HasForeignKey("SelfDeclarationTypeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SelfDeclarationDocument", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("SelfDeclarationDocuments")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.SelfDeclarationType", "SelfDeclarationType")
.WithMany("SelfDeclarationDocuments")
.HasForeignKey("SelfDeclarationTypeCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SignedAgreementDocument", b =>
{
b.HasOne("Prime.Models.Agreement", "Agreement")
.WithOne("SignedAgreement")
.HasForeignKey("Prime.Models.SignedAgreementDocument", "AgreementId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Site", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany()
.HasForeignKey("AdjudicatorId");
b.HasOne("Prime.Models.Contact", "AdministratorPharmaNet")
.WithMany()
.HasForeignKey("AdministratorPharmaNetId");
b.HasOne("Prime.Models.CareSetting", "CareSetting")
.WithMany()
.HasForeignKey("CareSettingCode");
b.HasOne("Prime.Models.Organization", "Organization")
.WithMany("Sites")
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.PhysicalAddress", "PhysicalAddress")
.WithMany()
.HasForeignKey("PhysicalAddressId");
b.HasOne("Prime.Models.Contact", "PrivacyOfficer")
.WithMany()
.HasForeignKey("PrivacyOfficerId");
b.HasOne("Prime.Models.Party", "Provisioner")
.WithMany()
.HasForeignKey("ProvisionerId");
b.HasOne("Prime.Models.Contact", "TechnicalSupport")
.WithMany()
.HasForeignKey("TechnicalSupportId");
});
modelBuilder.Entity("Prime.Models.SiteAdjudicationDocument", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany()
.HasForeignKey("AdjudicatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthoritySite", null)
.WithMany("SiteAdjudicationDocuments")
.HasForeignKey("HealthAuthoritySiteId");
b.HasOne("Prime.Models.Site", "Site")
.WithMany("SiteAdjudicationDocuments")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SiteNotification", b =>
{
b.HasOne("Prime.Models.Admin", "Admin")
.WithMany()
.HasForeignKey("AdminId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Admin", "Assignee")
.WithMany()
.HasForeignKey("AssigneeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.SiteRegistrationNote", "SiteRegistrationNote")
.WithOne("SiteNotification")
.HasForeignKey("Prime.Models.SiteNotification", "SiteRegistrationNoteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SiteRegistrationNote", b =>
{
b.HasOne("Prime.Models.Admin", "Adjudicator")
.WithMany()
.HasForeignKey("AdjudicatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthoritySite", null)
.WithMany("SiteRegistrationNotes")
.HasForeignKey("HealthAuthoritySiteId");
b.HasOne("Prime.Models.Site", "Site")
.WithMany("SiteRegistrationNotes")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SiteRegistrationReviewDocument", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthoritySite", null)
.WithMany("SiteRegistrationReviewDocuments")
.HasForeignKey("HealthAuthoritySiteId");
b.HasOne("Prime.Models.Site", "Site")
.WithMany("SiteRegistrationReviewDocuments")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SiteStatus", b =>
{
b.HasOne("Prime.Models.Site", "Site")
.WithMany("SiteStatuses")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.SiteVendor", b =>
{
b.HasOne("Prime.Models.Site", "Site")
.WithMany("SiteVendors")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Prime.Models.Vendor", "Vendor")
.WithMany("SiteVendors")
.HasForeignKey("VendorCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Submission", b =>
{
b.HasOne("Prime.Models.Enrollee", "Enrollee")
.WithMany("Submissions")
.HasForeignKey("EnrolleeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.Vendor", b =>
{
b.HasOne("Prime.Models.CareSetting", "CareSetting")
.WithMany()
.HasForeignKey("CareSettingCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityPharmanetAdministrator", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "HealthAuthorityOrganization")
.WithMany("PharmanetAdministrators")
.HasForeignKey("HealthAuthorityOrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityPrivacyOfficer", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "HealthAuthorityOrganization")
.WithMany("PrivacyOfficers")
.HasForeignKey("HealthAuthorityOrganizationId")
.HasConstraintName("FK_HealthAuthorityContact_HealthAuthorityOrganization_HealthA~1")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Prime.Models.HealthAuthorities.HealthAuthorityTechnicalSupport", b =>
{
b.HasOne("Prime.Models.HealthAuthorities.HealthAuthorityOrganization", "HealthAuthorityOrganization")
.WithMany("TechnicalSupports")
.HasForeignKey("HealthAuthorityOrganizationId")
.HasConstraintName("FK_HealthAuthorityContact_HealthAuthorityOrganization_HealthA~2")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
| 41.426173 | 1,687 | 0.489925 | [
"Apache-2.0"
] | WadeBarnes/moh-prime | prime-dotnet-webapi/Migrations/20210715213428_CreateClientLogModels.Designer.cs | 694,497 | C# |
#pragma checksum "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\Account\Manage\ResetAuthenticator.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "4aefd4ae22f0d15fda4517e69e24cd9eb891864a"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Areas_Identity_Pages_Account_Manage_ResetAuthenticator), @"mvc.1.0.razor-page", @"/Areas/Identity/Pages/Account/Manage/ResetAuthenticator.cshtml")]
namespace AspNetCore
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#nullable restore
#line 1 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\_ViewImports.cshtml"
using Microsoft.AspNetCore.Identity;
#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\_ViewImports.cshtml"
using Come.Areas.Identity;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\_ViewImports.cshtml"
using Come.Areas.Identity.Pages;
#line default
#line hidden
#nullable disable
#nullable restore
#line 1 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\Account\_ViewImports.cshtml"
using Come.Areas.Identity.Pages.Account;
#line default
#line hidden
#nullable disable
#nullable restore
#line 1 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\Account\Manage\_ViewImports.cshtml"
using Come.Areas.Identity.Pages.Account.Manage;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4aefd4ae22f0d15fda4517e69e24cd9eb891864a", @"/Areas/Identity/Pages/Account/Manage/ResetAuthenticator.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"dc68e5476e00f936967546ec9e3e793e9def9d2a", @"/Areas/Identity/Pages/_ViewImports.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"1a0f0acca595357e2963a042af9a90c40069e739", @"/Areas/Identity/Pages/Account/_ViewImports.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"dbc0f4b234abd1cb07d0fc79f7fb3bc93c670657", @"/Areas/Identity/Pages/Account/Manage/_ViewImports.cshtml")]
public class Areas_Identity_Pages_Account_Manage_ResetAuthenticator : global::Microsoft.AspNetCore.Mvc.RazorPages.Page
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("name", "_StatusMessage", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("reset-authenticator-form"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form-group"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line hidden
#pragma warning disable 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext;
#pragma warning restore 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
#pragma warning disable 0169
private string __tagHelperStringValueBuffer;
#pragma warning restore 0169
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
{
get
{
if (__backed__tagHelperScopeManager == null)
{
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
}
return __backed__tagHelperScopeManager;
}
}
private global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
#nullable restore
#line 3 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\Account\Manage\ResetAuthenticator.cshtml"
ViewData["Title"] = "Reset authenticator key";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "4aefd4ae22f0d15fda4517e69e24cd9eb891864a6171", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#nullable restore
#line 8 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\Account\Manage\ResetAuthenticator.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.StatusMessage);
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n<h4>");
#nullable restore
#line 9 "C:\Users\Yusuf\source\repos\Come\Come\Areas\Identity\Pages\Account\Manage\ResetAuthenticator.cshtml"
Write(ViewData["Title"]);
#line default
#line hidden
#nullable disable
WriteLiteral(@"</h4>
<div class=""alert alert-warning"" role=""alert"">
<p>
<span class=""glyphicon glyphicon-warning-sign""></span>
<strong>If you reset your authenticator key your authenticator app will not work until you reconfigure it.</strong>
</p>
<p>
This process disables 2FA until you verify your authenticator app.
If you do not complete your authenticator app configuration you may lose access to your account.
</p>
</div>
<div>
");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "4aefd4ae22f0d15fda4517e69e24cd9eb891864a8567", async() => {
WriteLiteral("\r\n <button id=\"reset-authenticator-button\" class=\"btn btn-danger\" type=\"submit\">Reset authenticator key</button>\r\n ");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n</div>");
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<ResetAuthenticatorModel> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<ResetAuthenticatorModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<ResetAuthenticatorModel>)PageContext?.ViewData;
public ResetAuthenticatorModel Model => ViewData.Model;
}
}
#pragma warning restore 1591
| 65.664773 | 360 | 0.760838 | [
"Apache-2.0"
] | cemre-2187/Come | Come/obj/Debug/netcoreapp3.1/win-x86/Razor/Areas/Identity/Pages/Account/Manage/ResetAuthenticator.cshtml.g.cs | 11,557 | C# |
#region LICENSE
// The contents of this file are subject to the Common Public Attribution
// License Version 1.0. (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// https://github.com/NiclasOlofsson/MiNET/blob/master/LICENSE.
// The License is based on the Mozilla Public License Version 1.1, but Sections 14
// and 15 have been added to cover use of software over a computer network and
// provide for limited attribution for the Original Developer. In addition, Exhibit A has
// been modified to be consistent with Exhibit B.
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
// the specific language governing rights and limitations under the License.
//
// The Original Code is MiNET.
//
// The Original Developer is the Initial Developer. The Initial Developer of
// the Original Code is Niclas Olofsson.
//
// All portions of the code written by Niclas Olofsson are Copyright (c) 2014-2017 Niclas Olofsson.
// All Rights Reserved.
#endregion
using System.Numerics;
using log4net;
using MiNET.BlockEntities;
using MiNET.Items;
using MiNET.Utils;
using MiNET.Worlds;
namespace MiNET.Blocks
{
public class Bed : Block
{
public Bed() : base(26)
{
BlastResistance = 1;
Hardness = 0.2f;
IsTransparent = true;
//IsFlammable = true; // It can catch fire from lava, but not other means.
}
public override Item[] GetDrops(Item tool)
{
return new[] {ItemFactory.GetItem(355, _color)};
}
protected override bool CanPlace(Level world, Player player, BlockCoordinates blockCoordinates, BlockCoordinates targetCoordinates, BlockFace face)
{
_color = Metadata; // from item
byte direction = player.GetDirection();
switch (direction)
{
case 1:
Metadata = 0;
break; // West
case 2:
Metadata = 1;
break; // North
case 3:
Metadata = 2;
break; // East
case 0:
Metadata = 3;
break; // South
}
return world.GetBlock(blockCoordinates).IsReplacible && world.GetBlock(GetOtherPart()).IsReplacible;
}
public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
{
world.SetBlockEntity(new BedBlockEntity
{
Coordinates = Coordinates,
Color = _color
});
var otherCoord = GetOtherPart();
Bed blockOther = new Bed
{
Coordinates = otherCoord,
Metadata = (byte) (Metadata | 0x08)
};
world.SetBlock(blockOther);
world.SetBlockEntity(new BedBlockEntity
{
Coordinates = blockOther.Coordinates,
Color = _color
});
return false;
}
public override void BreakBlock(Level level, bool silent = false)
{
if(level.GetBlockEntity(Coordinates) is BedBlockEntity blockEntiy)
{
_color = blockEntiy.Color;
}
base.BreakBlock(level, silent);
var other = GetOtherPart();
level.SetAir(other);
level.RemoveBlockEntity(other);
}
private BlockCoordinates GetOtherPart()
{
BlockCoordinates direction = new BlockCoordinates();
switch (Metadata & 0x07)
{
case 0:
direction = Level.North;
break; // West
case 1:
direction = Level.East;
break; // South
case 2:
direction = Level.South;
break; // East
case 3:
direction = Level.West;
break; // North
}
// Remove bed
if ((Metadata & 0x08) != 0x08)
{
direction = direction*-1;
}
return Coordinates + direction;
}
private static readonly ILog Log = LogManager.GetLogger(typeof (Bed));
private byte _color;
public override bool Interact(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoord)
{
if ((Metadata & 0x04) == 0x04)
{
Log.Debug($"Bed at {Coordinates} is already occupied"); // Send proper message to player
return true;
}
SetOccupied(world, true);
player.IsSleeping = true;
player.SpawnPosition = blockCoordinates;
player.BroadcastSetEntityData();
return true;
}
public void SetOccupied(Level world, bool isOccupied)
{
var other = world.GetBlock(GetOtherPart());
if (isOccupied)
{
world.SetData(Coordinates, (byte) (Metadata | 0x04));
world.SetData(other.Coordinates, (byte) (other.Metadata | 0x04));
}
else
{
world.SetData(Coordinates, (byte) (Metadata & ~0x04));
world.SetData(other.Coordinates, (byte) (other.Metadata & ~0x04));
}
}
}
} | 25.909091 | 149 | 0.686184 | [
"MPL-2.0"
] | TruDan/MiNET | src/MiNET/MiNET/Blocks/Bed.cs | 4,560 | C# |
using System.Collections;
using System.Collections.Generic;
using System;
using u3dExtensions.IOC;
namespace u3dExtensions.Engine.Runtime
{
public class BindingProviderAttribute : System.Attribute
{
public object Name = InnerBindingNames.Empty;
public int DependencyCount = 0;
public object[] DependencieNames = new object[0];
}
}
| 20.235294 | 57 | 0.781977 | [
"MIT"
] | MarcoNacao/u3dframeworkExtension | UnityProject/Assets/u3dFrameworkExtensions/Runtime/Binding/Attributes/BindingProvider.cs | 346 | C# |
using SoulsFormats;
using System;
using System.Linq;
using System.Windows.Forms;
namespace TAEDX.TaeEditor
{
public partial class TaeInspectorWinFormsControl : UserControl
{
public event EventHandler<EventArgs> TaeEventValueChanged;
protected virtual void OnTaeEventValueChanged(EventArgs e)
{
TaeEventValueChanged?.Invoke(this, e);
}
private TaeEditAnimEventBox _selectedEventBox;
public TaeEditAnimEventBox SelectedEventBox
{
get => _selectedEventBox;
set
{
DumpDataGridValuesToEvent();
dataGridView1.CellValueChanged -= DataGridView1_CellValueChanged;
_selectedEventBox = value;
ReconstructDataGrid();
}
}
private void ReconstructDataGrid()
{
dataGridView1.Rows.Clear();
if (SelectedEventBox != null)
{
var ev = SelectedEventBox.MyEvent;
if (ev.Template != null)
{
foreach (var p in ev.Parameters.Template.Where(kvp => kvp.Value.ValueToAssert == null))
{
if (p.Value.EnumEntries != null)
{
var cell = new DataGridViewComboBoxCell();
cell.DataSource = p.Value.EnumEntries.Keys.ToList();
cell.Value = p.Value.ValueToString(ev.Parameters[p.Key]);
var row = new DataGridViewRow();
row.Cells.Add(new DataGridViewTextBoxCell() { Value = p.Value.Type });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = p.Value.Name });
row.Cells.Add(cell);
dataGridView1.Rows.Add(row);
}
else if (p.Value.Type == TAE.Template.ParamType.b)
{
var cell = new DataGridViewCheckBoxCell();
cell.Value = (bool)ev.Parameters[p.Key];
var row = new DataGridViewRow();
row.Cells.Add(new DataGridViewTextBoxCell() { Value = p.Value.Type });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = p.Value.Name });
row.Cells.Add(cell);
dataGridView1.Rows.Add(row);
}
else
{
//var cell = new DataGridViewTextBoxCell();
//cell.Value = p.Value.ValueToString(ev.Parameters[p.Key]);
//var row = new DataGridViewRow();
//row.Cells.Add(new DataGridViewTextBoxCell() { Value = p.Value.Type });
//row.Cells.Add(new DataGridViewTextBoxCell() { Value = p.Value.Name });
//row.Cells.Add(cell);
//dataGridView1.Rows.Add(row);
dataGridView1.Rows.Add(p.Value.Type, p.Value.Name, p.Value.ValueToString(ev.Parameters[p.Key]));
}
//dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[2].ValueType = p.Value.GetValueObjectType();
}
}
else
{
var bytes = ev.GetParameterBytes(SelectedEventBox.OwnerPane.MainScreen.SelectedTae.BigEndian);
for (int i = 0; i < bytes.Length; i++)
{
dataGridView1.Rows.Add(TAE.Template.ParamType.x8, $"Byte[{i}]", bytes[i].ToString("X2"));
//dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[2].ValueType = typeof(byte);
}
}
dataGridView1.CellValueChanged += DataGridView1_CellValueChanged;
dataGridView1.CellValidating += DataGridView1_CellValidating;
}
}
private void DataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
SaveDataGridRowValueToEvent(e.RowIndex);
}
private void DataGridView1_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
{
SaveDataGridRowValueToEvent(e.RowIndex);
}
private void DataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
SaveDataGridRowValueToEvent(e.RowIndex);
}
private bool SaveDataGridRowValueToEvent(int row)
{
if (SelectedEventBox == null)
return true;
var r = dataGridView1.Rows[row];
var ev = SelectedEventBox.MyEvent;
if (ev.Template != null)
{
var name = (string)r.Cells[1].Value;
var value = (dataGridView1.IsCurrentCellDirty ? r.Cells[2].EditedFormattedValue.ToString() : r.Cells[2].FormattedValue.ToString());
try
{
ev.Parameters[name] = ev.Template[name].StringToValue(value);
r.Cells[2].ErrorText = string.Empty;
}
catch (InvalidCastException)
{
r.Cells[2].ErrorText = "Invalid value type entered.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
catch (OverflowException)
{
r.Cells[2].ErrorText = "Value entered is too large for this value type to hold.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
catch (FormatException)
{
r.Cells[2].ErrorText = "Value is in the wrong format.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
catch (Exception)
{
r.Cells[2].ErrorText = "Failed to store value. Make sure it is in a valid format.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
}
else
{
try
{
byte[] bytes = SelectedEventBox.MyEvent.GetParameterBytes(SelectedEventBox.OwnerPane.MainScreen.SelectedTae.BigEndian);
bytes[row] = byte.Parse(dataGridView1.IsCurrentCellDirty ? r.Cells[2].EditedFormattedValue.ToString() : r.Cells[2].FormattedValue.ToString(), System.Globalization.NumberStyles.HexNumber);
SelectedEventBox.MyEvent.SetParameterBytes(SelectedEventBox.OwnerPane.MainScreen.SelectedTae.BigEndian, bytes);
r.Cells[2].ErrorText = string.Empty;
}
catch (InvalidCastException)
{
r.Cells[2].ErrorText = "Invalid value type entered.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
catch (OverflowException)
{
r.Cells[2].ErrorText = "Value entered is too large for this value type to hold.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
catch (FormatException)
{
r.Cells[2].ErrorText = "Value is in the wrong format.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
catch (Exception)
{
r.Cells[2].ErrorText = "Failed to store value. Make sure it is in a valid format.";
dataGridView1.UpdateCellErrorText(2, row);
return false;
}
}
SelectedEventBox.UpdateEventText();
OnTaeEventValueChanged(EventArgs.Empty);
return true;
}
public bool DumpDataGridValuesToEvent()
{
bool failed = false;
if (SelectedEventBox != null)
{
for (int i = 0; i < dataGridView1.RowCount; i++)
{
if (!SaveDataGridRowValueToEvent(i))
failed = true;
}
}
return !failed;
}
public TaeInspectorWinFormsControl()
{
InitializeComponent();
dataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.EditingControlShowing += DataGridView1_EditingControlShowing;
dataGridView1.AllowUserToOrderColumns = false;
}
IDataGridViewEditingControl _iDataGridViewEditingControl;
private void DataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (_iDataGridViewEditingControl is DataGridViewTextBoxEditingControl)
{
DataGridViewTextBoxEditingControl iDataGridViewEditingControl = _iDataGridViewEditingControl as DataGridViewTextBoxEditingControl;
iDataGridViewEditingControl.KeyPress -= Control_KeyPress;
}
if (e.Control is DataGridViewTextBoxEditingControl)
{
DataGridViewTextBoxEditingControl iDataGridViewEditingControl = e.Control as DataGridViewTextBoxEditingControl;
iDataGridViewEditingControl.KeyPress += Control_KeyPress;
_iDataGridViewEditingControl = iDataGridViewEditingControl;
}
}
private void Control_KeyPress(object sender, KeyPressEventArgs e)
{
if (dataGridView1.IsCurrentCellInEditMode)
{
if (dataGridView1.SelectedCells.Count != 1)
return;
var selectedCell = dataGridView1.SelectedCells[0];
string paramName = selectedCell.OwningRow.Cells[1].FormattedValue.ToString();
TAE.Template.ParamType p = TAE.Template.ParamType.x8;
switch (e.KeyChar)
{
case (char)Keys.Back:
case (char)Keys.Enter:
break;
case ' ':
if (SelectedEventBox.MyEvent.Template == null)
{
e.Handled = true;
BEEP();
break;
}
else
{
p = SelectedEventBox.MyEvent.Parameters.Template[paramName].Type;
if (p != TAE.Template.ParamType.aob)
{
e.Handled = true;
BEEP();
}
}
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break;
case '-':
if (SelectedEventBox.MyEvent.Template == null)
{
e.Handled = true;
BEEP();
break;
}
else
{
p = SelectedEventBox.MyEvent.Parameters.Template[paramName].Type;
switch (p)
{
case TAE.Template.ParamType.s8:
case TAE.Template.ParamType.s16:
case TAE.Template.ParamType.s32:
case TAE.Template.ParamType.s64:
case TAE.Template.ParamType.f32:
case TAE.Template.ParamType.f64:
break;
default:
e.Handled = true;
BEEP();
break;
}
}
break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
if (SelectedEventBox.MyEvent.Template == null)
{
switch (e.KeyChar)
{
case 'a': e.KeyChar = 'A'; break;
case 'b': e.KeyChar = 'B'; break;
case 'c': e.KeyChar = 'C'; break;
case 'd': e.KeyChar = 'D'; break;
case 'e': e.KeyChar = 'E'; break;
case 'f': e.KeyChar = 'F'; break;
default: break;
}
break;
}
p = SelectedEventBox.MyEvent.Parameters.Template[paramName].Type;
switch (p)
{
case TAE.Template.ParamType.x8:
case TAE.Template.ParamType.x16:
case TAE.Template.ParamType.x32:
case TAE.Template.ParamType.x64:
case TAE.Template.ParamType.aob:
switch (e.KeyChar)
{
case 'a': e.KeyChar = 'A'; break;
case 'b': e.KeyChar = 'B'; break;
case 'c': e.KeyChar = 'C'; break;
case 'd': e.KeyChar = 'D'; break;
case 'e': e.KeyChar = 'E'; break;
case 'f': e.KeyChar = 'F'; break;
default: break;
}
break;
default:
e.Handled = true;
BEEP();
break;
}
break;
case ',':
case '.':
if (SelectedEventBox.MyEvent.Template == null)
{
e.Handled = true;
BEEP();
break;
}
var isValidFloatingPoint = (System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(e.KeyChar));
p = SelectedEventBox.MyEvent.Parameters.Template[paramName].Type;
if ((p != TAE.Template.ParamType.f32 && p != TAE.Template.ParamType.f64) || !isValidFloatingPoint)
{
e.Handled = true;
BEEP();
}
break;
default:
e.Handled = true;
BEEP();
break;
}
}
}
private void BEEP()
{
System.Media.SystemSounds.Beep.Play();
}
private void label1_Click(object sender, EventArgs e)
{
}
}
}
| 39.133333 | 207 | 0.434777 | [
"MIT"
] | katalash/TAE-DX | TAEDX/TaeEditor/TaeInspectorWinFormsControl.cs | 16,438 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
namespace WeatherAPI.Areas.HelpPage
{
/// <summary>
/// This class will create an object of a given type and populate it with sample data.
/// </summary>
public class ObjectGenerator
{
internal const int DefaultCollectionSize = 2;
private readonly SimpleTypeObjectGenerator SimpleObjectGenerator = new SimpleTypeObjectGenerator();
/// <summary>
/// Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types:
/// Simple types: <see cref="int"/>, <see cref="string"/>, <see cref="Enum"/>, <see cref="DateTime"/>, <see cref="Uri"/>, etc.
/// Complex types: POCO types.
/// Nullables: <see cref="Nullable{T}"/>.
/// Arrays: arrays of simple types or complex types.
/// Key value pairs: <see cref="KeyValuePair{TKey,TValue}"/>
/// Tuples: <see cref="Tuple{T1}"/>, <see cref="Tuple{T1,T2}"/>, etc
/// Dictionaries: <see cref="IDictionary{TKey,TValue}"/> or anything deriving from <see cref="IDictionary{TKey,TValue}"/>.
/// Collections: <see cref="IList{T}"/>, <see cref="IEnumerable{T}"/>, <see cref="ICollection{T}"/>, <see cref="IList"/>, <see cref="IEnumerable"/>, <see cref="ICollection"/> or anything deriving from <see cref="ICollection{T}"/> or <see cref="IList"/>.
/// Queryables: <see cref="IQueryable"/>, <see cref="IQueryable{T}"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>An object of the given type.</returns>
public object GenerateObject(Type type)
{
return GenerateObject(type, new Dictionary<Type, object>());
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Here we just want to return null if anything goes wrong.")]
private object GenerateObject(Type type, Dictionary<Type, object> createdObjectReferences)
{
try
{
if (SimpleTypeObjectGenerator.CanGenerateObject(type))
{
return SimpleObjectGenerator.GenerateObject(type);
}
if (type.IsArray)
{
return GenerateArray(type, DefaultCollectionSize, createdObjectReferences);
}
if (type.IsGenericType)
{
return GenerateGenericType(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IDictionary))
{
return GenerateDictionary(typeof(Hashtable), DefaultCollectionSize, createdObjectReferences);
}
if (typeof(IDictionary).IsAssignableFrom(type))
{
return GenerateDictionary(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IList) ||
type == typeof(IEnumerable) ||
type == typeof(ICollection))
{
return GenerateCollection(typeof(ArrayList), DefaultCollectionSize, createdObjectReferences);
}
if (typeof(IList).IsAssignableFrom(type))
{
return GenerateCollection(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IQueryable))
{
return GenerateQueryable(type, DefaultCollectionSize, createdObjectReferences);
}
if (type.IsEnum)
{
return GenerateEnum(type);
}
if (type.IsPublic || type.IsNestedPublic)
{
return GenerateComplexObject(type, createdObjectReferences);
}
}
catch
{
// Returns null if anything fails
return null;
}
return null;
}
private static object GenerateGenericType(Type type, int collectionSize, Dictionary<Type, object> createdObjectReferences)
{
Type genericTypeDefinition = type.GetGenericTypeDefinition();
if (genericTypeDefinition == typeof(Nullable<>))
{
return GenerateNullable(type, createdObjectReferences);
}
if (genericTypeDefinition == typeof(KeyValuePair<,>))
{
return GenerateKeyValuePair(type, createdObjectReferences);
}
if (IsTuple(genericTypeDefinition))
{
return GenerateTuple(type, createdObjectReferences);
}
Type[] genericArguments = type.GetGenericArguments();
if (genericArguments.Length == 1)
{
if (genericTypeDefinition == typeof(IList<>) ||
genericTypeDefinition == typeof(IEnumerable<>) ||
genericTypeDefinition == typeof(ICollection<>))
{
Type collectionType = typeof(List<>).MakeGenericType(genericArguments);
return GenerateCollection(collectionType, collectionSize, createdObjectReferences);
}
if (genericTypeDefinition == typeof(IQueryable<>))
{
return GenerateQueryable(type, collectionSize, createdObjectReferences);
}
Type closedCollectionType = typeof(ICollection<>).MakeGenericType(genericArguments[0]);
if (closedCollectionType.IsAssignableFrom(type))
{
return GenerateCollection(type, collectionSize, createdObjectReferences);
}
}
if (genericArguments.Length == 2)
{
if (genericTypeDefinition == typeof(IDictionary<,>))
{
Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(genericArguments);
return GenerateDictionary(dictionaryType, collectionSize, createdObjectReferences);
}
Type closedDictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments[0], genericArguments[1]);
if (closedDictionaryType.IsAssignableFrom(type))
{
return GenerateDictionary(type, collectionSize, createdObjectReferences);
}
}
if (type.IsPublic || type.IsNestedPublic)
{
return GenerateComplexObject(type, createdObjectReferences);
}
return null;
}
private static object GenerateTuple(Type type, Dictionary<Type, object> createdObjectReferences)
{
Type[] genericArgs = type.GetGenericArguments();
object[] parameterValues = new object[genericArgs.Length];
bool failedToCreateTuple = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < genericArgs.Length; i++)
{
parameterValues[i] = objectGenerator.GenerateObject(genericArgs[i], createdObjectReferences);
failedToCreateTuple &= parameterValues[i] == null;
}
if (failedToCreateTuple)
{
return null;
}
object result = Activator.CreateInstance(type, parameterValues);
return result;
}
private static bool IsTuple(Type genericTypeDefinition)
{
return genericTypeDefinition == typeof(Tuple<>) ||
genericTypeDefinition == typeof(Tuple<,>) ||
genericTypeDefinition == typeof(Tuple<,,>) ||
genericTypeDefinition == typeof(Tuple<,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,,,>);
}
private static object GenerateKeyValuePair(Type keyValuePairType, Dictionary<Type, object> createdObjectReferences)
{
Type[] genericArgs = keyValuePairType.GetGenericArguments();
Type typeK = genericArgs[0];
Type typeV = genericArgs[1];
ObjectGenerator objectGenerator = new ObjectGenerator();
object keyObject = objectGenerator.GenerateObject(typeK, createdObjectReferences);
object valueObject = objectGenerator.GenerateObject(typeV, createdObjectReferences);
if (keyObject == null && valueObject == null)
{
// Failed to create key and values
return null;
}
object result = Activator.CreateInstance(keyValuePairType, keyObject, valueObject);
return result;
}
private static object GenerateArray(Type arrayType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type type = arrayType.GetElementType();
Array result = Array.CreateInstance(type, size);
bool areAllElementsNull = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
result.SetValue(element, i);
areAllElementsNull &= element == null;
}
if (areAllElementsNull)
{
return null;
}
return result;
}
private static object GenerateDictionary(Type dictionaryType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type typeK = typeof(object);
Type typeV = typeof(object);
if (dictionaryType.IsGenericType)
{
Type[] genericArgs = dictionaryType.GetGenericArguments();
typeK = genericArgs[0];
typeV = genericArgs[1];
}
object result = Activator.CreateInstance(dictionaryType);
MethodInfo addMethod = dictionaryType.GetMethod("Add") ?? dictionaryType.GetMethod("TryAdd");
MethodInfo containsMethod = dictionaryType.GetMethod("Contains") ?? dictionaryType.GetMethod("ContainsKey");
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object newKey = objectGenerator.GenerateObject(typeK, createdObjectReferences);
if (newKey == null)
{
// Cannot generate a valid key
return null;
}
bool containsKey = (bool)containsMethod.Invoke(result, new object[] { newKey });
if (!containsKey)
{
object newValue = objectGenerator.GenerateObject(typeV, createdObjectReferences);
addMethod.Invoke(result, new object[] { newKey, newValue });
}
}
return result;
}
private static object GenerateEnum(Type enumType)
{
Array possibleValues = Enum.GetValues(enumType);
if (possibleValues.Length > 0)
{
return possibleValues.GetValue(0);
}
return null;
}
private static object GenerateQueryable(Type queryableType, int size, Dictionary<Type, object> createdObjectReferences)
{
bool isGeneric = queryableType.IsGenericType;
object list;
if (isGeneric)
{
Type listType = typeof(List<>).MakeGenericType(queryableType.GetGenericArguments());
list = GenerateCollection(listType, size, createdObjectReferences);
}
else
{
list = GenerateArray(typeof(object[]), size, createdObjectReferences);
}
if (list == null)
{
return null;
}
if (isGeneric)
{
Type argumentType = typeof(IEnumerable<>).MakeGenericType(queryableType.GetGenericArguments());
MethodInfo asQueryableMethod = typeof(Queryable).GetMethod("AsQueryable", new[] { argumentType });
return asQueryableMethod.Invoke(null, new[] { list });
}
return Queryable.AsQueryable((IEnumerable)list);
}
private static object GenerateCollection(Type collectionType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type type = collectionType.IsGenericType ?
collectionType.GetGenericArguments()[0] :
typeof(object);
object result = Activator.CreateInstance(collectionType);
MethodInfo addMethod = collectionType.GetMethod("Add");
bool areAllElementsNull = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
addMethod.Invoke(result, new object[] { element });
areAllElementsNull &= element == null;
}
if (areAllElementsNull)
{
return null;
}
return result;
}
private static object GenerateNullable(Type nullableType, Dictionary<Type, object> createdObjectReferences)
{
Type type = nullableType.GetGenericArguments()[0];
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type, createdObjectReferences);
}
private static object GenerateComplexObject(Type type, Dictionary<Type, object> createdObjectReferences)
{
object result = null;
if (createdObjectReferences.TryGetValue(type, out result))
{
// The object has been created already, just return it. This will handle the circular reference case.
return result;
}
if (type.IsValueType)
{
result = Activator.CreateInstance(type);
}
else
{
ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes);
if (defaultCtor == null)
{
// Cannot instantiate the type because it doesn't have a default constructor
return null;
}
result = defaultCtor.Invoke(new object[0]);
}
createdObjectReferences.Add(type, result);
SetPublicProperties(type, result, createdObjectReferences);
SetPublicFields(type, result, createdObjectReferences);
return result;
}
private static void SetPublicProperties(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
{
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
ObjectGenerator objectGenerator = new ObjectGenerator();
foreach (PropertyInfo property in properties)
{
if (property.CanWrite)
{
object propertyValue = objectGenerator.GenerateObject(property.PropertyType, createdObjectReferences);
property.SetValue(obj, propertyValue, null);
}
}
}
private static void SetPublicFields(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
{
FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance);
ObjectGenerator objectGenerator = new ObjectGenerator();
foreach (FieldInfo field in fields)
{
object fieldValue = objectGenerator.GenerateObject(field.FieldType, createdObjectReferences);
field.SetValue(obj, fieldValue);
}
}
private class SimpleTypeObjectGenerator
{
private long _index = 0;
private static readonly Dictionary<Type, Func<long, object>> DefaultGenerators = InitializeGenerators();
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple type factories and cannot be split up.")]
private static Dictionary<Type, Func<long, object>> InitializeGenerators()
{
return new Dictionary<Type, Func<long, object>>
{
{ typeof(Boolean), index => true },
{ typeof(Byte), index => (Byte)64 },
{ typeof(Char), index => (Char)65 },
{ typeof(DateTime), index => DateTime.Now },
{ typeof(DateTimeOffset), index => new DateTimeOffset(DateTime.Now) },
{ typeof(DBNull), index => DBNull.Value },
{ typeof(Decimal), index => (Decimal)index },
{ typeof(Double), index => (Double)(index + 0.1) },
{ typeof(Guid), index => Guid.NewGuid() },
{ typeof(Int16), index => (Int16)(index % Int16.MaxValue) },
{ typeof(Int32), index => (Int32)(index % Int32.MaxValue) },
{ typeof(Int64), index => (Int64)index },
{ typeof(Object), index => new object() },
{ typeof(SByte), index => (SByte)64 },
{ typeof(Single), index => (Single)(index + 0.1) },
{
typeof(String), index =>
{
return String.Format(CultureInfo.CurrentCulture, "sample string {0}", index);
}
},
{
typeof(TimeSpan), index =>
{
return TimeSpan.FromTicks(1234567);
}
},
{ typeof(UInt16), index => (UInt16)(index % UInt16.MaxValue) },
{ typeof(UInt32), index => (UInt32)(index % UInt32.MaxValue) },
{ typeof(UInt64), index => (UInt64)index },
{
typeof(Uri), index =>
{
return new Uri(String.Format(CultureInfo.CurrentCulture, "http://webapihelppage{0}.com", index));
}
},
};
}
public static bool CanGenerateObject(Type type)
{
return DefaultGenerators.ContainsKey(type);
}
public object GenerateObject(Type type)
{
return DefaultGenerators[type](++_index);
}
}
}
} | 42.745614 | 261 | 0.55315 | [
"MIT"
] | HenkeHulk/WeatherApi | WeatherAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs | 19,492 | C# |
using System.Threading.Tasks;
using Twitch.Net.Models;
using Twitch.Net.Models.Responses;
namespace Twitch.Net.Interfaces
{
public interface IStreamActions
{
/// <summary>
/// Get streams
/// </summary>
/// <param name="first">Amount of streams. Limit: 100</param>
/// <param name="languages">Stream language. Limit: 100</param>
/// <param name="after">Cursor for pagination</param>
/// <param name="before">Cursor for pagination</param>
/// <returns><see cref="HelixPaginatedResponse{TResponseObject}"/> with streams</returns>
Task<HelixPaginatedResponse<HelixStream>> GetStreams(int first = 20, string[] languages = null, string after = null, string before = null);
/// <summary>
/// Get streams for specific games
/// </summary>
/// <param name="gameIds">Array of game ids. Limit: 10</param>
/// <param name="first">Amount of streams. Limit: 100</param>
/// <param name="languages">Stream language. Limit: 100</param>
/// <param name="after">Cursor for pagination</param>
/// <param name="before">Cursor for pagination</param>
/// <returns><see cref="HelixPaginatedResponse{HelixStream}"/> with streams</returns>
Task<HelixPaginatedResponse<HelixStream>> GetStreamsWithGameIds(string[] gameIds, int first = 20, string[] languages = null, string after = null, string before = null);
/// <summary>
/// Get streams for specific user ids
/// </summary>
/// <param name="userIds">Array of user ids. Limit: 100</param>
/// <param name="first">Amount of streams. Limit: 100</param>
/// <param name="languages">Stream language. Limit: 100</param>
/// <param name="after">Cursor for pagination</param>
/// <param name="before">Cursor for pagination</param>
/// <returns><see cref="HelixPaginatedResponse{HelixStream}"/> with streams</returns>
Task<HelixPaginatedResponse<HelixStream>> GetStreamsWithUserIds(string[] userIds, int first = 20, string[] languages = null, string after = null, string before = null);
/// <summary>
/// Get streams for specific user logins
/// </summary>
/// <param name="userLogins">Array of user logins. Limit: 100</param>
/// <param name="first">Amount of streams. Limit: 100</param>
/// <param name="languages">Stream language. Limit: 100</param>
/// <param name="after">Cursor for pagination</param>
/// <param name="before">Cursor for pagination</param>
/// <returns><see cref="HelixPaginatedResponse{HelixStream}"/> with streams</returns>
Task<HelixPaginatedResponse<HelixStream>> GetStreamsWithUserLogins(string[] userLogins, int first = 20, string[] languages = null, string after = null, string before = null);
}
}
| 52.309091 | 182 | 0.64025 | [
"MIT"
] | Cryma/Twitch.Net | Twitch.Net/Interfaces/IStreamActions.cs | 2,879 | C# |
using BusterWood.Testing;
using System.Threading.Tasks;
namespace BusterWood.Caching
{
public class AsyncReadThroughCacheTests
{
public static async Task can_read_item_from_underlying_cache(Test t)
{
foreach (var key in new[] { 1, 2 })
{
var cache = new ReadThroughCache<int, int>(new ValueIsKey<int, int>(), 3, null);
var actual = await cache.GetAsync(key);
if (actual != key)
t.Error($"Expected {key} but got {actual}");
}
}
public static async Task moves_items_to_gen1_when_gen0_is_full(Test t)
{
var cache = new ReadThroughCache<int, int>(new ValueIsKey<int, int>(), 3, null);
for (int i = 1; i <= 4; i++)
{
var actual = await cache.GetAsync(i);
if (actual != i)
t.Error($"Expected {i} but got {actual}");
}
t.Assert(3, cache._gen1.Count);
t.Assert(1, cache._gen0.Count);
}
public static async Task drops_items_in_gen1_when_gen0_is_full(Test t)
{
var cache = new ReadThroughCache<int, int>(new ValueIsKey<int, int>(), 3, null);
for (int i = 1; i <= 7; i++)
{
var actual = await cache.GetAsync(i);
if (actual != i)
t.Error($"Expected {i} but got {actual}");
}
t.Assert(3, cache._gen1.Count);
t.Assert(1, cache._gen0.Count);
}
}
}
| 32.8125 | 96 | 0.507937 | [
"Apache-2.0"
] | SammyEnigma/Goodies | TestingTests/Caching/AsyncReadThroughCacheTests.cs | 1,577 | C# |
/*****************************************************************************
*
* ReoGrid - .NET 表計算スプレッドシートコンポーネント
* https://reogrid.net/jp
*
* ReoGrid 日本語版デモプロジェクトは MIT ライセンスでリリースされています。
*
* このソフトウェアは無保証であり、このソフトウェアの使用により生じた直接・間接の損害に対し、
* 著作権者は補償を含むあらゆる責任を負いません。
*
* Copyright (c) 2012-2016 unvell.com, All Rights Reserved.
* https://www.unvell.com/jp
*
****************************************************************************/
namespace unvell.ReoGrid.Demo.WorksheetDemo
{
partial class ZoomDemo
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.trackBar1 = new System.Windows.Forms.TrackBar();
this.label1 = new System.Windows.Forms.Label();
this.grid = new unvell.ReoGrid.ReoGridControl();
this.label2 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// trackBar1
//
this.trackBar1.Location = new System.Drawing.Point(15, 40);
this.trackBar1.Maximum = 40;
this.trackBar1.Minimum = 1;
this.trackBar1.Name = "trackBar1";
this.trackBar1.Size = new System.Drawing.Size(160, 45);
this.trackBar1.TabIndex = 3;
this.trackBar1.Value = 10;
this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 14);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(61, 13);
this.label1.TabIndex = 4;
this.label1.Text = "拡大縮小:";
//
// grid
//
this.grid.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.grid.ColumnHeaderContextMenuStrip = null;
this.grid.Dock = System.Windows.Forms.DockStyle.Fill;
this.grid.LeadHeaderContextMenuStrip = null;
this.grid.Location = new System.Drawing.Point(0, 0);
this.grid.Name = "grid";
this.grid.RowHeaderContextMenuStrip = null;
this.grid.Script = null;
this.grid.SheetTabContextMenuStrip = null;
this.grid.SheetTabNewButtonVisible = true;
this.grid.SheetTabVisible = true;
this.grid.SheetTabWidth = 400;
this.grid.ShowScrollEndSpacing = true;
this.grid.Size = new System.Drawing.Size(630, 564);
this.grid.TabIndex = 2;
this.grid.TabStop = false;
this.grid.Text = "reoGridControl1";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(52, 101);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(66, 13);
this.label2.TabIndex = 5;
this.label2.Text = "比率: 100%";
//
// panel1
//
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.trackBar1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(630, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(192, 564);
this.panel1.TabIndex = 6;
//
// ZoomDemo
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.grid);
this.Controls.Add(this.panel1);
this.Name = "ZoomDemo";
this.Size = new System.Drawing.Size(822, 564);
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private ReoGridControl grid;
private System.Windows.Forms.TrackBar trackBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel panel1;
}
} | 32.557971 | 127 | 0.665257 | [
"MIT"
] | burstray/ReoGrid | !ReoGrid-3.0.0/DemoJP/Worksheet/ZoomDemo.Designer.cs | 4,743 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace InstantMessagingServerApp.Hubs
{
public class ConnectionMapping<T>
{
private readonly Dictionary<T, HashSet<string>> _connections =
new Dictionary<T, HashSet<string>>();
public int Count => _connections.Count;
public void Add(T key, string connectionId)
{
lock (_connections)
{
HashSet<string> connections;
if (!_connections.TryGetValue(key, out connections))
{
connections = new HashSet<string>();
_connections.Add(key, connections);
}
lock (connections)
{
connections.Add(connectionId);
}
}
}
public IEnumerable<T> GetUsersList()
{
return _connections.Keys.ToList();
}
public IEnumerable<string> GetConnections(T key)
{
HashSet<string> connections;
if (_connections.TryGetValue(key, out connections))
{
return connections;
}
return Enumerable.Empty<string>();
}
public void Remove(T key, string connectionId)
{
lock (_connections)
{
HashSet<string> connections;
if (!_connections.TryGetValue(key, out connections))
{
return;
}
lock (connections)
{
connections.Remove(connectionId);
if (connections.Count == 0)
{
_connections.Remove(key);
}
}
}
}
}
} | 26.211268 | 70 | 0.471789 | [
"MIT-0"
] | andrew-sakaylyuk/Messenger | Server/InstantMessagingServerApp/Hubs/ConnectionMapping.cs | 1,863 | C# |
using System;
using System.Runtime.InteropServices;
class MidiFighterTwister
{
#if (UNITY_STANDALONE_WIN && UNITY_64) || (UNITY_EDITOR_WIN && UNITY_64) || WIN64
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftStart")]
public static extern byte mftStart();
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftStop")]
public static extern void mftStop();
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftIsUpdatedKnobValue")]
public static extern byte mftIsUpdatedKnobValue(byte idx);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftGetKnobValue")]
public static extern byte mftGetKnobValue(byte idx);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftSetKnobValue")]
public static extern void mftSetKnobValue(byte idx, byte value);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftIsUpdatedButtonValue")]
public static extern byte mftIsUpdatedButtonValue(byte idx);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftGetButtonValue")]
public static extern byte mftGetButtonValue(byte idx);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftSetKnobColor")]
public static extern void mftSetKnobColor(byte idx, byte value);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftIsUpdatedBank")]
public static extern byte mftIsUpdatedBank();
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftGetBank")]
public static extern byte mftGetBank();
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftSetBank")]
public static extern void mftSetBank(byte bank_idx);
[DllImport("MidiFighterTwister64.dll", EntryPoint = "mftSendCCMessage")]
public static extern void mftSendCCMessage(byte channel, byte control_number, byte control_data);
#elif (UNITY_STANDALONE_WIN && UNITY_32) || (UNITY_EDITOR_WIN && UNITY_32) || !WIN64
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftStart")]
public static extern byte mftStart();
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftStop")]
public static extern void mftStop();
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftIsUpdatedKnobValue")]
public static extern byte mftIsUpdatedKnobValue(byte idx);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftGetKnobValue")]
public static extern byte mftGetKnobValue(byte idx);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftSetKnobValue")]
public static extern void mftSetKnobValue(byte idx, byte value);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftIsUpdatedButtonValue")]
public static extern byte mftIsUpdatedButtonValue(byte idx);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftGetButtonValue")]
public static extern byte mftGetButtonValue(byte idx);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftSetKnobColor")]
public static extern void mftSetKnobColor(byte idx, byte value);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftIsUpdatedBank")]
public static extern byte mftIsUpdatedBank();
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftGetBank")]
public static extern byte mftGetBank();
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftSetBank")]
public static extern void mftSetBank(byte bank_idx);
[DllImport("MidiFighterTwister32.dll", EntryPoint = "mftSendCCMessage")]
public static extern void mftSendCCMessage(byte channel, byte control_number, byte control_data);
#else
#endif
public static bool Start()
{
return mftStart() > 0 ? true : false;
}
public static void Stop()
{
mftStop();
}
public static bool IsUpdatedKnobValue(byte idx)
{
return mftIsUpdatedKnobValue(idx) > 0 ? true : false;
}
public static byte GetKnobValue(byte idx)
{
return mftGetKnobValue(idx);
}
public static void SetKnobValue(byte idx, byte value)
{
mftSetKnobValue(idx, value);
}
public static bool IsUpdatedButtonValue(byte idx)
{
return mftIsUpdatedButtonValue(idx) > 0 ? true : false;
}
public static byte GetButtonValue(byte idx)
{
return mftGetButtonValue(idx);
}
public static void SetKnobColor(byte idx, byte value)
{
mftSetKnobColor(idx, value);
}
public static bool IsUpdatedBank()
{
return mftIsUpdatedBank() > 0 ? true : false;
}
public static byte GetBank()
{
return mftGetBank();
}
public static void SetBank(byte bank_idx)
{
mftSetBank(bank_idx);
}
public static void SendCCMessage(byte channel, byte control_number, byte control_data)
{
mftSendCCMessage(channel, control_number, control_data);
}
}
| 33.531469 | 101 | 0.714911 | [
"MIT"
] | yoggy/MidiFighterTwister | VisualStudio/src/testMainCSharp/MidiFighterTwister/MidiFighterTwister.cs | 4,797 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DotVVM.Contrib.BootstrapColorpicker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DotVVM.Contrib")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0")]
| 37.5 | 84 | 0.747451 | [
"Apache-2.0"
] | AMBULATUR/dotvvm-contrib | Controls/BootstrapColorpicker/src/DotVVM.Contrib/Properties/AssemblyInfo.cs | 1,278 | C# |
using System;
using System.Collections.Generic;
using Eto.Drawing;
using Eto.Forms;
namespace XenForms.Toolbox.UI.Shell
{
public class ButtonMenuList : Panel
{
public Image Image { get; set; }
private readonly ContextMenu _menu = new ContextMenu();
protected override void OnPreLoad(EventArgs e)
{
base.OnPreLoad(e);
var button = new ImageButton
{
Width = Width,
Image = Image,
Height = Height
};
Content = button;
button.Click += (a,b) =>
{
_menu.Show(this);
};
}
public void AddCheckItem(string menuText, bool value, Action<bool> action)
{
var cmd = new CheckCommand(OnCheckCommand)
{
Checked = value,
MenuText = menuText,
Tag = action
};
var item = new CheckMenuItem(cmd);
_menu.Items.Add(item);
}
public void Add(Command command)
{
_menu.Items.Add(command);
}
public void Add(MenuItem menuItem)
{
_menu.Items.Add(menuItem);
}
public void AddRange(IEnumerable<MenuItem> menuItems)
{
_menu.Items.AddRange(menuItems);
}
private void OnCheckCommand(object sender, EventArgs e)
{
var cmd = sender as CheckCommand;
if (cmd == null) return;
var action = cmd.Tag as Action<bool>;
action?.Invoke(cmd.Checked);
}
}
}
| 21.597403 | 82 | 0.497294 | [
"MIT"
] | DevChive/XenForms | Source/Toolbox/UI/Shell/ButtonMenuList.cs | 1,665 | C# |
using System;
using System.Linq;
using System.Threading.Tasks;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.System;
using Windows.UI.Core;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Coding4Fun.Toolkit.Controls;
using Acr.UserDialogs.Infrastructure;
namespace Acr.UserDialogs
{
public class UserDialogsImpl : AbstractUserDialogs
{
readonly Func<Action, Task> dispatcher;
public UserDialogsImpl(Func<Action, Task> dispatcher = null)
{
this.dispatcher = dispatcher ?? new Func<Action, Task>(x => CoreApplication
.MainView
.CoreWindow
.Dispatcher
.RunAsync(CoreDispatcherPriority.Normal, () => x())
.AsTask()
);
}
public override IDisposable Alert(AlertConfig config)
{
var dialog = new MessageDialog(config.Message, config.Title ?? String.Empty);
dialog.Commands.Add(new UICommand(config.OkText, x => config.OnAction?.Invoke()));
IAsyncOperation<IUICommand> dialogTask = null;
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => dialogTask = dialog.ShowAsync(),
() => dialogTask?.Cancel()
);
}
public override IDisposable ActionSheet(ActionSheetConfig config)
{
var dlg = new ActionSheetContentDialog();
var vm = new ActionSheetViewModel
{
Title = config.Title,
Message = config.Message,
Cancel = new ActionSheetOptionViewModel(config.Cancel != null, config.Cancel?.Text, () =>
{
dlg.Hide();
config.Cancel?.Action?.Invoke();
}),
Destructive = new ActionSheetOptionViewModel(config.Destructive != null, config.Destructive?.Text, () =>
{
dlg.Hide();
config.Destructive?.Action?.Invoke();
}),
Options = config
.Options
.Select(x => new ActionSheetOptionViewModel(true, x.Text, () =>
{
dlg.Hide();
x.Action?.Invoke();
}, x.ItemIcon ?? config.ItemIcon))
.ToList()
};
dlg.DataContext = vm;
IAsyncOperation<ContentDialogResult> dialogTask = null;
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => dialogTask = dlg.ShowAsync(),
() => dialogTask?.Cancel()
);
}
public override IDisposable Confirm(ConfirmConfig config)
{
var dialog = new MessageDialog(config.Message, config.Title ?? String.Empty);
dialog.Commands.Add(new UICommand(config.OkText, x => config.OnAction?.Invoke(true)));
dialog.DefaultCommandIndex = 0;
dialog.Commands.Add(new UICommand(config.CancelText, x => config.OnAction?.Invoke(false)));
dialog.CancelCommandIndex = 1;
IAsyncOperation<IUICommand> dialogTask = null;
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => dialogTask = dialog.ShowAsync(),
() => dialogTask?.Cancel()
);
}
public override IDisposable DatePrompt(DatePromptConfig config)
{
var picker = new DatePickerControl();
if (config.MinimumDate != null)
picker.DatePicker.MinDate = config.MinimumDate.Value;
if (config.MaximumDate != null)
picker.DatePicker.MaxDate = config.MaximumDate.Value;
var popup = this.CreatePopup(picker);
if (!config.IsCancellable)
picker.CancelButton.Visibility = Visibility.Collapsed;
else
{
picker.CancelButton.Content = config.CancelText;
picker.CancelButton.Click += (sender, args) =>
{
var result = new DatePromptResult(false, this.GetDateForCalendar(picker.DatePicker));
config.OnAction?.Invoke(result);
popup.IsOpen = false;
};
}
picker.OkButton.Content = config.OkText;
picker.OkButton.Click += (sender, args) =>
{
var result = new DatePromptResult(true, this.GetDateForCalendar(picker.DatePicker));
config.OnAction?.Invoke(result);
popup.IsOpen = false;
};
if (config.SelectedDate != null)
{
picker.DatePicker.SelectedDates.Add(config.SelectedDate.Value);
picker.DatePicker.SetDisplayDate(config.SelectedDate.Value);
}
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => popup.IsOpen = true,
() => popup.IsOpen = false
);
}
public override IDisposable TimePrompt(TimePromptConfig config)
{
var picker = new TimePickerControl();
picker.TimePicker.MinuteIncrement = config.MinuteInterval;
var popup = this.CreatePopup(picker);
if (!config.IsCancellable)
picker.CancelButton.Visibility = Visibility.Collapsed;
else
{
picker.CancelButton.Content = config.CancelText;
picker.CancelButton.Click += (sender, args) =>
{
var result = new TimePromptResult(false, picker.TimePicker.Time);
config.OnAction?.Invoke(result);
popup.IsOpen = false;
};
}
picker.OkButton.Content = config.OkText;
picker.OkButton.Click += (sender, args) =>
{
var result = new TimePromptResult(true, picker.TimePicker.Time);
config.OnAction?.Invoke(result);
popup.IsOpen = false;
};
if (config.SelectedTime != null)
{
picker.TimePicker.Time = config.SelectedTime.Value;
}
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => popup.IsOpen = true,
() => popup.IsOpen = false
);
}
public override IDisposable Login(LoginConfig config)
{
var vm = new LoginViewModel
{
LoginText = config.OkText,
Title = config.Title ?? String.Empty,
Message = config.Message ?? String.Empty,
UserName = config.LoginValue,
UserNamePlaceholder = config.LoginPlaceholder,
PasswordPlaceholder = config.PasswordPlaceholder,
CancelText = config.CancelText
};
vm.Login = new Command(() =>
config.OnAction?.Invoke(new LoginResult(true, vm.UserName, vm.Password))
);
vm.Cancel = new Command(() =>
config.OnAction?.Invoke(new LoginResult(false, vm.UserName, vm.Password))
);
var dlg = new LoginContentDialog
{
DataContext = vm
};
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => dlg.ShowAsync(),
dlg.Hide
);
}
public override IDisposable Prompt(PromptConfig config)
{
var stack = new StackPanel();
if (!String.IsNullOrWhiteSpace(config.Message))
stack.Children.Add(new TextBlock { Text = config.Message, TextWrapping = TextWrapping.WrapWholeWords });
var dialog = new ContentDialog
{
Title = config.Title ?? String.Empty,
Content = stack,
PrimaryButtonText = config.OkText
};
if (config.InputType == InputType.Password)
this.SetPasswordPrompt(dialog, stack, config);
else
this.SetDefaultPrompt(dialog, stack, config);
if (config.IsCancellable)
{
dialog.SecondaryButtonText = config.CancelText;
dialog.SecondaryButtonCommand = new Command(() =>
{
config.OnAction?.Invoke(new PromptResult(false, String.Empty));
dialog.Hide();
});
}
return this.DispatchAndDispose(
config.UwpSubmitOnEnterKey,
config.UwpCancelOnEscKey,
() => dialog.ShowAsync(),
dialog.Hide
);
}
public override IDisposable Toast(ToastConfig config)
{
ToastPrompt toast = null;
return this.DispatchAndDispose(
false,
false,
() =>
{
toast = new ToastPrompt
{
Message = config.Message,
//Stretch = Stretch.Fill,
TextWrapping = TextWrapping.Wrap,
MillisecondsUntilHidden = Convert.ToInt32(config.Duration.TotalMilliseconds)
};
if (config.Icon != null)
toast.ImageSource = new BitmapImage(new Uri(config.Icon));
if (config.MessageTextColor != null)
toast.Foreground = new SolidColorBrush(config.MessageTextColor.ToNative());
if (config.BackgroundColor != null)
toast.Background = new SolidColorBrush(config.BackgroundColor.ToNative());
toast.Show();
},
() => toast.Hide()
);
}
#region Internals
protected virtual Popup CreatePopup(UIElement element)
{
var popup = new Popup
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center
};
if (element != null)
popup.Child = element;
return popup;
}
protected virtual DateTime GetDateForCalendar(CalendarView calendar)
{
return calendar.SelectedDates.Any()
? calendar.SelectedDates.First().Date
: DateTime.MinValue;
}
protected virtual void SetPasswordPrompt(ContentDialog dialog, StackPanel stack, PromptConfig config)
{
var txt = new PasswordBox
{
PlaceholderText = config.Placeholder ?? String.Empty,
Password = config.Text ?? String.Empty
};
if (config.MaxLength != null)
txt.MaxLength = config.MaxLength.Value;
stack.Children.Add(txt);
dialog.PrimaryButtonCommand = new Command(() =>
{
config.OnAction?.Invoke(new PromptResult(true, txt.Password));
dialog.Hide();
});
if (config.OnTextChanged == null)
return;
var args = new PromptTextChangedArgs { Value = txt.Password };
config.OnTextChanged(args);
dialog.IsPrimaryButtonEnabled = args.IsValid;
txt.PasswordChanged += (sender, e) =>
{
args.IsValid = true; // reset
args.Value = txt.Password;
config.OnTextChanged(args);
dialog.IsPrimaryButtonEnabled = args.IsValid;
if (!args.Value.Equals(txt.Password))
{
txt.Password = args.Value;
}
};
}
protected virtual void SetDefaultPrompt(ContentDialog dialog, StackPanel stack, PromptConfig config)
{
var txt = new TextBox
{
PlaceholderText = config.Placeholder ?? String.Empty,
Text = config.Text ?? String.Empty
};
if (config.MaxLength != null)
txt.MaxLength = config.MaxLength.Value;
stack.Children.Add(txt);
dialog.PrimaryButtonCommand = new Command(() =>
{
config.OnAction?.Invoke(new PromptResult(true, txt.Text.Trim()));
dialog.Hide();
});
if (config.OnTextChanged == null)
return;
var args = new PromptTextChangedArgs { Value = txt.Text };
config.OnTextChanged(args);
dialog.IsPrimaryButtonEnabled = args.IsValid;
txt.TextChanged += (sender, e) =>
{
args.IsValid = true; // reset
args.Value = txt.Text;
config.OnTextChanged(args);
dialog.IsPrimaryButtonEnabled = args.IsValid;
if (!args.Value.Equals(txt.Text))
{
txt.Text = args.Value;
txt.SelectionStart = Math.Max(0, txt.Text.Length);
txt.SelectionLength = 0;
}
};
}
protected override IProgressDialog CreateDialogInstance(ProgressDialogConfig config) => new ProgressDialog(config);
protected virtual IDisposable DispatchAndDispose(bool enterKey, bool escKey, Action dispatch, Action dispose)
{
TypedEventHandler<CoreWindow, KeyEventArgs> keyHandler = null;
var disposer = new DisposableAction(() =>
{
try
{
this.dispatcher.Invoke(dispose);
}
catch (Exception ex)
{
Log.Error("Dismiss", "Error dismissing dialog - " + ex);
}
finally
{
if (keyHandler != null)
Window.Current.CoreWindow.KeyDown -= keyHandler;
}
});
keyHandler = (sender, args) =>
{
switch (args.VirtualKey)
{
case VirtualKey.Escape:
//if (escKey && vm.Cancel.CanExecute(null))
//{
// dlg.Hide();
// vm.Cancel.Execute(null);
//}
break;
case VirtualKey.Enter:
//if (enterKey && vm.Login.CanExecute(null))
//{
// dlg.Hide();
// vm.Login.Execute(null);
//}
break;
}
};
if (enterKey || escKey)
Window.Current.CoreWindow.KeyDown += keyHandler;
this.dispatcher.Invoke(dispatch);
return disposer;
}
#endregion
}
} | 34.375 | 123 | 0.505072 | [
"MIT"
] | VladislavAntonyuk/userdialogs | src/Acr.UserDialogs/Platforms/Uwp/UserDialogsImpl.cs | 15,677 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using GalaSoft.MvvmLight;
namespace CoreDemoApp
{
/// <summary>
/// See <a href="https://www.codeproject.com/Tips/876349/WPF-Validation-using-INotifyDataErrorInfo">this link</a> for
/// more information.
/// </summary>
public class ModelBase : ViewModelBase, INotifyPropertyChanged, INotifyDataErrorInfo
{
#region Property changed
public new event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// See <a href="http://jesseliberty.com/2012/06/28/c-5making-inotifypropertychanged-easier/">this link</a> for more
/// information.
/// </summary>
/// <param name="caller"></param>
protected void NotifyPropertyChanged([CallerMemberName] string caller = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(caller));
}
/// <summary>
/// Updates all bindings within the program
/// </summary>
protected void UpdateAllBindings()
{
var eventHandler = PropertyChanged;
eventHandler?.Invoke(this, new PropertyChangedEventArgs(string.Empty));
}
#endregion
#region Notify data error
private Dictionary<string, List<string>> _errors = new Dictionary<string, List<string>>();
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;
// get errors by property
public IEnumerable GetErrors(string propertyName)
{
if (propertyName == null) return null;
return _errors.ContainsKey(propertyName) ? _errors[propertyName] : null;
}
// has errors
private bool _hasErrors;
public bool HasErrors
{
get
{
if (_errors == null) _errors = new Dictionary<string, List<string>>();
return _errors.Count > 0;
}
set => _hasErrors = value;
}
// object is valid
private bool _isValid;
public bool IsValid
{
get => !HasErrors;
set => _isValid = value;
}
public void AddError(string propertyName, string error)
{
// Add error to list
_errors[propertyName] = new List<string> {error};
NotifyErrorsChanged(propertyName);
}
public void RemoveError(string propertyName)
{
// remove error
if (_errors.ContainsKey(propertyName))
_errors.Remove(propertyName);
NotifyErrorsChanged(propertyName);
}
public void NotifyErrorsChanged(string propertyName)
{
// Notify
if (ErrorsChanged != null)
ErrorsChanged(this, new DataErrorsChangedEventArgs(propertyName));
}
#endregion
}
} | 26.969697 | 122 | 0.668914 | [
"MIT"
] | ariksman/CoreDemoApp | CoreDemoApp/ModelBase.cs | 2,672 | C# |
using System.Threading.Tasks;
using CreativeCoders.Git.Abstractions;
namespace CreativeCoders.GitTool.Base;
public interface IGitServiceProviderFactory
{
Task<IGitServiceProvider> CreateProviderAsync(IGitRepository gitRepository);
bool IsResponsibleFor(IGitRepository gitRepository);
string ProviderName { get; }
} | 25.461538 | 80 | 0.818731 | [
"Apache-2.0"
] | CreativeCodersTeam/GitTools | source/GitTool/CreativeCoders.GitTool.Base/IGitServiceProviderFactory.cs | 333 | C# |
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Linq;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Moq;
using Avalonia.Controls;
using Avalonia.Styling;
using Xunit;
using System.Collections.Generic;
namespace Avalonia.Styling.UnitTests
{
public class SelectorTests_Class
{
[Fact]
public void Class_Selector_Should_Have_Correct_String_Representation()
{
var target = default(Selector).Class("foo");
Assert.Equal(".foo", target.ToString());
}
[Fact]
public void PesudoClass_Selector_Should_Have_Correct_String_Representation()
{
var target = default(Selector).Class(":foo");
Assert.Equal(":foo", target.ToString());
}
[Fact]
public async Task Class_Matches_Control_With_Class()
{
var control = new Control1
{
Classes = new Classes { "foo" },
};
var target = default(Selector).Class("foo");
var match = target.Match(control);
Assert.Equal(SelectorMatchResult.Sometimes, match.Result);
Assert.True(await match.Activator.Take(1));
}
[Fact]
public async Task Class_Doesnt_Match_Control_Without_Class()
{
var control = new Control1
{
Classes = new Classes { "bar" },
};
var target = default(Selector).Class("foo");
var match = target.Match(control);
Assert.Equal(SelectorMatchResult.Sometimes, match.Result);
Assert.False(await match.Activator.Take(1));
}
[Fact]
public async Task Class_Matches_Control_With_TemplatedParent()
{
var control = new Control1
{
Classes = new Classes { "foo" },
TemplatedParent = new Mock<ITemplatedControl>().Object,
};
var target = default(Selector).Class("foo");
var match = target.Match(control);
Assert.Equal(SelectorMatchResult.Sometimes, match.Result);
Assert.True(await match.Activator.Take(1));
}
[Fact]
public async Task Class_Tracks_Additions()
{
var control = new Control1();
var target = default(Selector).Class("foo");
var activator = target.Match(control).Activator;
Assert.False(await activator.Take(1));
control.Classes.Add("foo");
Assert.True(await activator.Take(1));
}
[Fact]
public async Task Class_Tracks_Removals()
{
var control = new Control1
{
Classes = new Classes { "foo" },
};
var target = default(Selector).Class("foo");
var activator = target.Match(control).Activator;
Assert.True(await activator.Take(1));
control.Classes.Remove("foo");
Assert.False(await activator.Take(1));
}
[Fact]
public async Task Multiple_Classes()
{
var control = new Control1();
var target = default(Selector).Class("foo").Class("bar");
var activator = target.Match(control).Activator;
Assert.False(await activator.Take(1));
control.Classes.Add("foo");
Assert.False(await activator.Take(1));
control.Classes.Add("bar");
Assert.True(await activator.Take(1));
control.Classes.Remove("bar");
Assert.False(await activator.Take(1));
}
[Fact]
public void Only_Notifies_When_Result_Changes()
{
// Test for #1698
var control = new Control1
{
Classes = new Classes { "foo" },
};
var target = default(Selector).Class("foo");
var activator = target.Match(control).Activator;
var result = new List<bool>();
using (activator.Subscribe(x => result.Add(x)))
{
control.Classes.Add("bar");
control.Classes.Remove("foo");
}
Assert.Equal(new[] { true, false }, result);
}
public class Control1 : TestControlBase
{
}
}
}
| 29.546053 | 104 | 0.55177 | [
"MIT"
] | HendrikMennen/Avalonia | tests/Avalonia.Styling.UnitTests/SelectorTests_Class.cs | 4,491 | C# |
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Abp.Authorization;
using Abp.Authorization.Users;
using Abp.MultiTenancy;
using Abp.Runtime.Security;
using Abp.UI;
using SuperRocket.AspNetCoreVue.Authentication.External;
using SuperRocket.AspNetCoreVue.Authentication.JwtBearer;
using SuperRocket.AspNetCoreVue.Authorization;
using SuperRocket.AspNetCoreVue.Authorization.Users;
using SuperRocket.AspNetCoreVue.Models.TokenAuth;
using SuperRocket.AspNetCoreVue.MultiTenancy;
namespace SuperRocket.AspNetCoreVue.Controllers
{
[Route("api/[controller]/[action]")]
public class TokenAuthController : AspNetCoreVueControllerBase
{
private readonly LogInManager _logInManager;
private readonly ITenantCache _tenantCache;
private readonly AbpLoginResultTypeHelper _abpLoginResultTypeHelper;
private readonly TokenAuthConfiguration _configuration;
private readonly IExternalAuthConfiguration _externalAuthConfiguration;
private readonly IExternalAuthManager _externalAuthManager;
private readonly UserRegistrationManager _userRegistrationManager;
public TokenAuthController(
LogInManager logInManager,
ITenantCache tenantCache,
AbpLoginResultTypeHelper abpLoginResultTypeHelper,
TokenAuthConfiguration configuration,
IExternalAuthConfiguration externalAuthConfiguration,
IExternalAuthManager externalAuthManager,
UserRegistrationManager userRegistrationManager)
{
_logInManager = logInManager;
_tenantCache = tenantCache;
_abpLoginResultTypeHelper = abpLoginResultTypeHelper;
_configuration = configuration;
_externalAuthConfiguration = externalAuthConfiguration;
_externalAuthManager = externalAuthManager;
_userRegistrationManager = userRegistrationManager;
}
[HttpPost]
public async Task<AuthenticateResultModel> Authenticate([FromBody] AuthenticateModel model)
{
var loginResult = await GetLoginResultAsync(
model.UserNameOrEmailAddress,
model.Password,
GetTenancyNameOrNull()
);
var accessToken = CreateAccessToken(CreateJwtClaims(loginResult.Identity));
return new AuthenticateResultModel
{
AccessToken = accessToken,
EncryptedAccessToken = GetEncryptedAccessToken(accessToken),
ExpireInSeconds = (int)_configuration.Expiration.TotalSeconds,
UserId = loginResult.User.Id
};
}
[HttpGet]
public List<ExternalLoginProviderInfoModel> GetExternalAuthenticationProviders()
{
return ObjectMapper.Map<List<ExternalLoginProviderInfoModel>>(_externalAuthConfiguration.Providers);
}
[HttpPost]
public async Task<ExternalAuthenticateResultModel> ExternalAuthenticate([FromBody] ExternalAuthenticateModel model)
{
var externalUser = await GetExternalUserInfo(model);
var loginResult = await _logInManager.LoginAsync(new UserLoginInfo(model.AuthProvider, model.ProviderKey, model.AuthProvider), GetTenancyNameOrNull());
switch (loginResult.Result)
{
case AbpLoginResultType.Success:
{
var accessToken = CreateAccessToken(CreateJwtClaims(loginResult.Identity));
return new ExternalAuthenticateResultModel
{
AccessToken = accessToken,
EncryptedAccessToken = GetEncryptedAccessToken(accessToken),
ExpireInSeconds = (int)_configuration.Expiration.TotalSeconds
};
}
case AbpLoginResultType.UnknownExternalLogin:
{
var newUser = await RegisterExternalUserAsync(externalUser);
if (!newUser.IsActive)
{
return new ExternalAuthenticateResultModel
{
WaitingForActivation = true
};
}
// Try to login again with newly registered user!
loginResult = await _logInManager.LoginAsync(new UserLoginInfo(model.AuthProvider, model.ProviderKey, model.AuthProvider), GetTenancyNameOrNull());
if (loginResult.Result != AbpLoginResultType.Success)
{
throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(
loginResult.Result,
model.ProviderKey,
GetTenancyNameOrNull()
);
}
return new ExternalAuthenticateResultModel
{
AccessToken = CreateAccessToken(CreateJwtClaims(loginResult.Identity)),
ExpireInSeconds = (int)_configuration.Expiration.TotalSeconds
};
}
default:
{
throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(
loginResult.Result,
model.ProviderKey,
GetTenancyNameOrNull()
);
}
}
}
private async Task<User> RegisterExternalUserAsync(ExternalAuthUserInfo externalUser)
{
var user = await _userRegistrationManager.RegisterAsync(
externalUser.Name,
externalUser.Surname,
externalUser.EmailAddress,
externalUser.EmailAddress,
Authorization.Users.User.CreateRandomPassword(),
true
);
user.Logins = new List<UserLogin>
{
new UserLogin
{
LoginProvider = externalUser.Provider,
ProviderKey = externalUser.ProviderKey,
TenantId = user.TenantId
}
};
await CurrentUnitOfWork.SaveChangesAsync();
return user;
}
private async Task<ExternalAuthUserInfo> GetExternalUserInfo(ExternalAuthenticateModel model)
{
var userInfo = await _externalAuthManager.GetUserInfo(model.AuthProvider, model.ProviderAccessCode);
if (userInfo.ProviderKey != model.ProviderKey)
{
throw new UserFriendlyException(L("CouldNotValidateExternalUser"));
}
return userInfo;
}
private string GetTenancyNameOrNull()
{
if (!AbpSession.TenantId.HasValue)
{
return null;
}
return _tenantCache.GetOrNull(AbpSession.TenantId.Value)?.TenancyName;
}
private async Task<AbpLoginResult<Tenant, User>> GetLoginResultAsync(string usernameOrEmailAddress, string password, string tenancyName)
{
var loginResult = await _logInManager.LoginAsync(usernameOrEmailAddress, password, tenancyName);
switch (loginResult.Result)
{
case AbpLoginResultType.Success:
return loginResult;
default:
throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult.Result, usernameOrEmailAddress, tenancyName);
}
}
private string CreateAccessToken(IEnumerable<Claim> claims, TimeSpan? expiration = null)
{
var now = DateTime.UtcNow;
var jwtSecurityToken = new JwtSecurityToken(
issuer: _configuration.Issuer,
audience: _configuration.Audience,
claims: claims,
notBefore: now,
expires: now.Add(expiration ?? _configuration.Expiration),
signingCredentials: _configuration.SigningCredentials
);
return new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken);
}
private static List<Claim> CreateJwtClaims(ClaimsIdentity identity)
{
var claims = identity.Claims.ToList();
var nameIdClaim = claims.First(c => c.Type == ClaimTypes.NameIdentifier);
// Specifically add the jti (random nonce), iat (issued timestamp), and sub (subject/user) claims.
claims.AddRange(new[]
{
new Claim(JwtRegisteredClaimNames.Sub, nameIdClaim.Value),
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
new Claim(JwtRegisteredClaimNames.Iat, DateTimeOffset.Now.ToUnixTimeSeconds().ToString(), ClaimValueTypes.Integer64)
});
return claims;
}
private string GetEncryptedAccessToken(string accessToken)
{
return SimpleStringCipher.Instance.Encrypt(accessToken, AppConsts.DefaultPassPhrase);
}
}
}
| 40.871795 | 171 | 0.603095 | [
"MIT"
] | dystudio/SuperRocket.AspNetCoreVue | aspnet-core/src/SuperRocket.AspNetCoreVue.Web.Core/Controllers/TokenAuthController.cs | 9,566 | C# |
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
namespace DalSic
{
/// <summary>
/// Strongly-typed collection for the GuardiaPracticasEstado class.
/// </summary>
[Serializable]
public partial class GuardiaPracticasEstadoCollection : ActiveList<GuardiaPracticasEstado, GuardiaPracticasEstadoCollection>
{
public GuardiaPracticasEstadoCollection() {}
/// <summary>
/// Filters an existing collection based on the set criteria. This is an in-memory filter
/// Thanks to developingchris for this!
/// </summary>
/// <returns>GuardiaPracticasEstadoCollection</returns>
public GuardiaPracticasEstadoCollection Filter()
{
for (int i = this.Count - 1; i > -1; i--)
{
GuardiaPracticasEstado o = this[i];
foreach (SubSonic.Where w in this.wheres)
{
bool remove = false;
System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
if (pi.CanRead)
{
object val = pi.GetValue(o, null);
switch (w.Comparison)
{
case SubSonic.Comparison.Equals:
if (!val.Equals(w.ParameterValue))
{
remove = true;
}
break;
}
}
if (remove)
{
this.Remove(o);
break;
}
}
}
return this;
}
}
/// <summary>
/// This is an ActiveRecord class which wraps the Guardia_Practicas_Estados table.
/// </summary>
[Serializable]
public partial class GuardiaPracticasEstado : ActiveRecord<GuardiaPracticasEstado>, IActiveRecord
{
#region .ctors and Default Settings
public GuardiaPracticasEstado()
{
SetSQLProps();
InitSetDefaults();
MarkNew();
}
private void InitSetDefaults() { SetDefaults(); }
public GuardiaPracticasEstado(bool useDatabaseDefaults)
{
SetSQLProps();
if(useDatabaseDefaults)
ForceDefaults();
MarkNew();
}
public GuardiaPracticasEstado(object keyID)
{
SetSQLProps();
InitSetDefaults();
LoadByKey(keyID);
}
public GuardiaPracticasEstado(string columnName, object columnValue)
{
SetSQLProps();
InitSetDefaults();
LoadByParam(columnName,columnValue);
}
protected static void SetSQLProps() { GetTableSchema(); }
#endregion
#region Schema and Query Accessor
public static Query CreateQuery() { return new Query(Schema); }
public static TableSchema.Table Schema
{
get
{
if (BaseSchema == null)
SetSQLProps();
return BaseSchema;
}
}
private static void GetTableSchema()
{
if(!IsSchemaInitialized)
{
//Schema declaration
TableSchema.Table schema = new TableSchema.Table("Guardia_Practicas_Estados", TableType.Table, DataService.GetInstance("sicProvider"));
schema.Columns = new TableSchema.TableColumnCollection();
schema.SchemaName = @"dbo";
//columns
TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
colvarId.ColumnName = "id";
colvarId.DataType = DbType.Int32;
colvarId.MaxLength = 0;
colvarId.AutoIncrement = false;
colvarId.IsNullable = false;
colvarId.IsPrimaryKey = true;
colvarId.IsForeignKey = false;
colvarId.IsReadOnly = false;
colvarId.DefaultSetting = @"";
colvarId.ForeignKeyTableName = "";
schema.Columns.Add(colvarId);
TableSchema.TableColumn colvarDescripcion = new TableSchema.TableColumn(schema);
colvarDescripcion.ColumnName = "descripcion";
colvarDescripcion.DataType = DbType.AnsiString;
colvarDescripcion.MaxLength = 50;
colvarDescripcion.AutoIncrement = false;
colvarDescripcion.IsNullable = false;
colvarDescripcion.IsPrimaryKey = false;
colvarDescripcion.IsForeignKey = false;
colvarDescripcion.IsReadOnly = false;
colvarDescripcion.DefaultSetting = @"";
colvarDescripcion.ForeignKeyTableName = "";
schema.Columns.Add(colvarDescripcion);
BaseSchema = schema;
//add this schema to the provider
//so we can query it later
DataService.Providers["sicProvider"].AddSchema("Guardia_Practicas_Estados",schema);
}
}
#endregion
#region Props
[XmlAttribute("Id")]
[Bindable(true)]
public int Id
{
get { return GetColumnValue<int>(Columns.Id); }
set { SetColumnValue(Columns.Id, value); }
}
[XmlAttribute("Descripcion")]
[Bindable(true)]
public string Descripcion
{
get { return GetColumnValue<string>(Columns.Descripcion); }
set { SetColumnValue(Columns.Descripcion, value); }
}
#endregion
//no foreign key tables defined (0)
//no ManyToMany tables defined (0)
#region ObjectDataSource support
/// <summary>
/// Inserts a record, can be used with the Object Data Source
/// </summary>
public static void Insert(int varId,string varDescripcion)
{
GuardiaPracticasEstado item = new GuardiaPracticasEstado();
item.Id = varId;
item.Descripcion = varDescripcion;
if (System.Web.HttpContext.Current != null)
item.Save(System.Web.HttpContext.Current.User.Identity.Name);
else
item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
}
/// <summary>
/// Updates a record, can be used with the Object Data Source
/// </summary>
public static void Update(int varId,string varDescripcion)
{
GuardiaPracticasEstado item = new GuardiaPracticasEstado();
item.Id = varId;
item.Descripcion = varDescripcion;
item.IsNew = false;
if (System.Web.HttpContext.Current != null)
item.Save(System.Web.HttpContext.Current.User.Identity.Name);
else
item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
}
#endregion
#region Typed Columns
public static TableSchema.TableColumn IdColumn
{
get { return Schema.Columns[0]; }
}
public static TableSchema.TableColumn DescripcionColumn
{
get { return Schema.Columns[1]; }
}
#endregion
#region Columns Struct
public struct Columns
{
public static string Id = @"id";
public static string Descripcion = @"descripcion";
}
#endregion
#region Update PK Collections
#endregion
#region Deep Save
#endregion
}
}
| 26.202952 | 139 | 0.619772 | [
"MIT"
] | saludnqn/Empadronamiento | DalSic/generated/GuardiaPracticasEstado.cs | 7,101 | C# |
using GSU.Museum.CommonClassLibrary.Models;
using GSU.Museum.Web.Interfaces;
using GSU.Museum.Web.Models;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.GridFS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PhotoInfo = GSU.Museum.Web.Models.PhotoInfo;
namespace GSU.Museum.Web.Repositories
{
public class ExhibitsRepository : IExhibitsRepository
{
private readonly IMongoCollection<HallViewModel> _halls;
private readonly IGridFSBucket _gridFS;
public ExhibitsRepository(DatabaseSettings settings)
{
var client = new MongoClient(settings.ConnectionString);
var database = client.GetDatabase(settings.DatabaseName);
_halls = database.GetCollection<HallViewModel>(settings.CollectionName);
_gridFS = new GridFSBucket(database);
}
public async Task<string> CreateAsync(string hallId, string standId, ExhibitViewModel entity)
{
if (entity.Photos != null)
{
foreach (var photo in entity.Photos)
{
ObjectId id = await _gridFS.UploadFromBytesAsync(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff"), photo?.Photo);
photo.Id = id.ToString();
photo.Photo = null;
}
}
else
{
entity.Photos = new List<PhotoInfo>();
}
var filter = Builders<HallViewModel>.Filter.And(
Builders<HallViewModel>.Filter.Where(hall => hall.Id.Equals(hallId)),
Builders<HallViewModel>.Filter.Eq("Stands.Id", standId));
entity.Id = ObjectId.GenerateNewId().ToString();
var update = Builders<HallViewModel>.Update.Push("Stands.$.Exhibits", entity);
await _halls.FindOneAndUpdateAsync(filter, update);
return entity.Id;
}
public async Task<List<ExhibitViewModel>> GetAllAsync(string hallId, string standId)
{
var hall = await _halls.Find(h => h.Id.Equals(hallId)).FirstOrDefaultAsync();
var exhibits = hall.Stands.FirstOrDefault(s => s.Id.Equals(standId))?.Exhibits?.ToList();
if (exhibits != null)
{
foreach (var exhibit in exhibits)
{
if (exhibit?.Photos != null)
{
foreach (var photo in exhibit.Photos)
{
if (!string.IsNullOrEmpty(photo?.Id))
{
photo.Photo = await _gridFS.DownloadAsBytesAsync(ObjectId.Parse(photo.Id));
}
}
}
}
}
return exhibits;
}
public async Task<ExhibitViewModel> GetAsync(string hallId, string standId, string id)
{
var hall = await _halls.Find(h => h.Id.Equals(hallId)).FirstOrDefaultAsync();
var exhibit = hall?.Stands?.FirstOrDefault(s => s.Id.Equals(standId))?.Exhibits?.FirstOrDefault(e => e.Id.Equals(id));
if (exhibit?.Photos != null)
{
foreach (var photo in exhibit.Photos)
{
if (!string.IsNullOrEmpty(photo?.Id))
{
photo.Photo = await _gridFS.DownloadAsBytesAsync(ObjectId.Parse(photo.Id));
}
}
}
return exhibit;
}
public async Task RemoveAsync(string hallId, string standId, string id)
{
var exhibit = await GetAsync(hallId, standId, id);
if (exhibit?.Photos != null)
{
foreach (var photo in exhibit.Photos)
{
if (!string.IsNullOrEmpty(photo?.Id))
{
await _gridFS.DeleteAsync(ObjectId.Parse(photo.Id));
}
}
}
var filter = Builders<HallViewModel>.Filter.Eq(hall => hall.Id, hallId);
var update = Builders<HallViewModel>.Update.PullFilter("Stands.$[].Exhibits",
Builders<ExhibitViewModel>.Filter.Eq(x => x.Id, id));
var result = await _halls
.FindOneAndUpdateAsync(filter, update);
}
public async Task UpdateAsync(string hallId, string standId, string id, ExhibitViewModel entity)
{
for (int i = 0; i < entity.Photos?.Count; i++)
{
if (!string.IsNullOrEmpty(entity.Photos[i]?.Id))
{
await _gridFS.DeleteAsync(ObjectId.Parse(entity.Photos[i].Id));
}
if (entity.Photos[i]?.Photo != null)
{
ObjectId photoId = await _gridFS.UploadFromBytesAsync(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff"), entity.Photos[i].Photo);
entity.Photos[i].Id = photoId.ToString();
entity.Photos[i].Photo = null;
}
else
{
entity.Photos.RemoveAt(i--);
}
}
int index1 = 0, index2 = 0;
var hall = await _halls.Find(hall => hall.Id.Equals(hallId)).FirstOrDefaultAsync();
for (int i = 0; i < hall.Stands.Count; i++)
{
if (hall.Stands[i].Id == standId)
{
index1 = i;
break;
}
}
for (int i = 0; i < hall.Stands[index1].Exhibits.Count; i++)
{
if (hall.Stands[index1].Exhibits[i].Id == id)
{
index2 = i;
break;
}
}
var arrayFilter = Builders<HallViewModel>.Filter.Where(hall => hall.Id.Equals(hallId));
var update = Builders<HallViewModel>.Update.Set($"Stands.{index1}.Exhibits.{index2}", entity);
await _halls.FindOneAndUpdateAsync(arrayFilter, update);
}
}
}
| 38.355828 | 152 | 0.516155 | [
"MIT"
] | Neroz1x/GSU.Museum | GSU.Museum.Web/Repositories/ExhibitsRepository.cs | 6,254 | C# |
// Copyright (c) MOSA Project. Licensed under the New BSD License.
// This code was generated by an automated template.
using Mosa.Compiler.Framework;
namespace Mosa.Platform.ARMv8A32.Instructions
{
/// <summary>
/// Pop - Pop multiple registers off the stack
/// </summary>
/// <seealso cref="Mosa.Platform.ARMv8A32.ARMv8A32Instruction" />
public sealed class Pop : ARMv8A32Instruction
{
public override int ID { get { return 685; } }
internal Pop()
: base(1, 3)
{
}
public override void Emit(InstructionNode node, BaseCodeEmitter emitter)
{
System.Diagnostics.Debug.Assert(node.ResultCount == 1);
System.Diagnostics.Debug.Assert(node.OperandCount == 3);
emitter.OpcodeEncoder.Append32Bits(0x00000000);
}
}
}
| 24.16129 | 74 | 0.716956 | [
"BSD-3-Clause"
] | marcelocaetano/MOSA-Project | Source/Mosa.Platform.ARMv8A32/Instructions/Pop.cs | 749 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System.Collections.Generic;
using Newtonsoft.Json;
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Http;
using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.Core.Utils;
using Aliyun.Acs.dms_enterprise.Transform;
using Aliyun.Acs.dms_enterprise.Transform.V20181101;
namespace Aliyun.Acs.dms_enterprise.Model.V20181101
{
public class ListSensitiveColumnsDetailRequest : RpcAcsRequest<ListSensitiveColumnsDetailResponse>
{
public ListSensitiveColumnsDetailRequest()
: base("dms-enterprise", "2018-11-01", "ListSensitiveColumnsDetail", "dmsenterprise", "openAPI")
{
if (this.GetType().GetProperty("ProductEndpointMap") != null && this.GetType().GetProperty("ProductEndpointType") != null)
{
this.GetType().GetProperty("ProductEndpointMap").SetValue(this, Endpoint.endpointMap, null);
this.GetType().GetProperty("ProductEndpointType").SetValue(this, Endpoint.endpointRegionalType, null);
}
}
private string schemaName;
private string tableName;
private string columnName;
private long? tid;
public string SchemaName
{
get
{
return schemaName;
}
set
{
schemaName = value;
DictionaryUtil.Add(QueryParameters, "SchemaName", value);
}
}
public string TableName
{
get
{
return tableName;
}
set
{
tableName = value;
DictionaryUtil.Add(QueryParameters, "TableName", value);
}
}
public string ColumnName
{
get
{
return columnName;
}
set
{
columnName = value;
DictionaryUtil.Add(QueryParameters, "ColumnName", value);
}
}
public long? Tid
{
get
{
return tid;
}
set
{
tid = value;
DictionaryUtil.Add(QueryParameters, "Tid", value.ToString());
}
}
public override ListSensitiveColumnsDetailResponse GetResponse(UnmarshallerContext unmarshallerContext)
{
return ListSensitiveColumnsDetailResponseUnmarshaller.Unmarshall(unmarshallerContext);
}
}
}
| 26.798165 | 134 | 0.679219 | [
"Apache-2.0"
] | bbs168/aliyun-openapi-net-sdk | aliyun-net-sdk-dms-enterprise/Dms_enterprise/Model/V20181101/ListSensitiveColumnsDetailRequest.cs | 2,921 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace Gizmo.GraphicFramework.CanvasElements.CanvasUIElements
{
class ButtonElement
{
}
}
| 15.818182 | 64 | 0.764368 | [
"MIT"
] | ar-dev-1983/Gizmo.NodeDesigner | Gizmo.GraphicFramework/CanvasElements/CanvasUIElements/ButtonElement.cs | 176 | C# |
// Copyright (c) 2019 Alachisoft
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License
using Alachisoft.NCache.Common.DataSource;
using Alachisoft.NCache.Runtime;
using Alachisoft.NCache.Runtime.Caching;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using Alachisoft.NCache.Client.Services;
namespace Alachisoft.NCache.Client
{
/// <summary>
/// This interface contians the services and methods that are used to perform operations on the cache.
/// </summary>
public interface ICache :IDisposable, IEnumerable
{
#region Properties
/// <summary>
/// Gets the number of items stored in the cache.
/// </summary>
long Count { get; }
/// <summary>
/// Displays the information related to this client.
/// </summary>
ClientInfo ClientInfo { get; }
/// <summary>
/// Gets the information of all connected clients to the cache.
/// </summary>
IList<ClientInfo> ConnectedClientList { get; }
/// <summary>
/// Gets an instance of <see cref="IMessagingService"/>.
/// </summary>
IMessagingService MessagingService { get; }
/// <summary>
/// Gets an instance of <see cref="IExecutionService"/>.
/// </summary>
//IExecutionService ExecutionService { get; }
/// <summary>
/// Gets an instance of <see cref="IDataTypeManager"/>.
/// </summary>
//IDataTypeManager DataTypeManager { get; }
#endregion
#region Add Operations
/// <summary>
/// Adds an item into the Cache object with a cache key to reference its location.
/// </summary>
/// <param name="key">Unique key to identify the cache item.</param>
/// <param name="value">The item (object) to be stored in the cache.</param>
/// <example>Example demonstrates how to add a value to cache.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// string key = "Product0";
///
/// cache.Add(key, product);
/// </code>
/// </example>
void Add(string key, object value);
/// <summary>
/// Adds a <see cref="CacheItem"/> to the cache.
/// Using CacheItem, you can also specify properties for the cache items, for e.g., expiration and priority.
/// </summary>
/// <param name="key">Unique key to identify the cache item.</param>
/// <param name="item"><see cref="CacheItem"/> that is to be stored in the cache.</param>
/// <remarks>If CacheItem contains invalid values, the related exception is thrown.
/// See <see cref="CacheItem"/> for invalid property values and related exceptions.</remarks>
/// <example>Example demonstrates how to add an item to the cache with a sliding expiration of 5 minutes, a priority of
/// high.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// CacheItem item = new CacheItem(product);
/// item.Expiration = new Expiration(ExpirationType.Sliding,new TimeSpan(0, 5, 0));
/// item.Priority = CacheItemPriority.High;
///
/// string key = "Product0";
///
///
/// cache.Add(key, item);
/// </code>
/// </example>
void Add(string key, CacheItem item);
/// <summary>
/// Adds a dictionary of cache keys with <see cref="CacheItem"/> to the cache.
/// The CacheItem contains properties to associate with the item, like expiration, dependencies and eviction information.
/// </summary>
/// <param name="items">Dictionary of keys and <see cref="CacheItem"/>. Keys must be unique.</param>>
/// <returns>Dictionary of Keys along with Exception that were unable to store in cache.</returns>
/// <example>The following example demonstrates how to add items to the cache with an absolute
/// expiration 2 minutes from now, a priority of
/// high, and that notifies the application when the item is removed from the cache.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// CacheItem[] cacheItems = new CacheItem[2];
///
/// Product product_1 = new Product();
/// product_1.Id = 1;
/// product_1.Name = "Chai";
///
/// Product product_2 = new Product();
/// product_2.Id = 2;
/// product_2.Name = "Chang";
///
/// Product product_3 = new Product();
/// product_3.Id = 2;
/// product_3.Name = "Aniseed Syrup";
///
/// cacheItems[0] = new CacheItem(product_1);
/// cacheItems[0].Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 2, 0));
/// cacheItems[0].Priority = CacheItemPriority.High;
///
/// cacheItems[1] = new CacheItem(product_2);
/// cacheItems[1].Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 2, 0));
/// cacheItems[1].Priority = CacheItemPriority.Normal;
///
/// cacheItems[2] = new CacheItem(product_3);
/// cacheItems[2].Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 2, 0));
/// cacheItems[2].Priority = CacheItemPriority.Low;
///
/// IDictionary<string, CacheItem> items = new Dictionary<string, CacheItem>()
/// {
/// { "Product0",cacheItems[0]},
/// { "Product1",cacheItems[1]},
/// { "Product2",cacheItems[2]}
/// }
///
///
/// cache.AddBulk(items);
/// </code>
/// </example>
IDictionary<string, Exception> AddBulk(IDictionary<string, CacheItem> items);
#endregion
#region Insert Operations
/// <summary>
/// Inserts an item (object) into the cache.
/// </summary>
/// <param name="key">Unique key to identify the cache item.</param>
/// <param name="value">The item (object) that is to be inserted into the cache.</param>
/// <remarks>
/// If the key already exists, this overload overwrites the values of the existing <seealso cref="ICache"/> item. If the key does not exist, it adds the item to the cache.
/// If CacheItem contains invalid values, the related exception is thrown.
/// </remarks>
/// <example>The following example demonstrates how to insert an item (object) into the cache.
/// <code>
/// Cache cache = NCache.InitializeCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// string key = "Product0";
///
/// cache.Insert(key,product);
/// </code>
/// </example>
void Insert(string key, object value);
// functionality of lockhandle with readthru is not supported.
/// <summary>
/// Inserts a <see cref="CacheItem"/> into the cache, allowing to specify the Write-Through option.
/// </summary>
/// <param name="key">Unique key to identify the cache item.</param>
/// <param name="item">The CacheItem that is to be inserted into the cache.</param>
/// <param name="lockHandle">An instance of <seealso cref="LockHandle"/> that holds the lock information. If the item is locked, then it can only be updated if the correct lockHandle is specified.</param>
/// <param name="releaseLock">A flag to determine whether or not the lock should be released after operation is performed.</param>
/// <remarks> If the key already exists, this overload overwrites the values of the existing <seealso cref="ICache"/> item. If the key does not exist, it adds the item to the cache.
/// If CacheItem contains invalid values the related exception is thrown. Functionality of lockhandle with Readthru is not supported.
/// See <see cref="CacheItem"/> for invalid property values and related exceptions.</remarks>
/// <example>Example demonstrates how to insert an item to the cache with a sliding expiration of 5 minutes, a priority of
/// high, and that notifies the application when the item is removed from the cache.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// CacheItem item = new CacheItem(product);
/// item.Priority = CacheItemPriority.Low;
///
/// string key = "Product0";
///
/// cache.Add(key, item);
///
/// LockHandle lockHandle = new LockHandle();
///
/// CacheItem cachedItem = cache.Get<CacheItem>("cachedItemKey", true, new TimeSpan(0, 5, 0), ref lockHandle);
///
/// if (cachedItem != null)
/// {
/// try
/// {
/// cachedItem.Priority = CacheItemPriority.High;
/// cachedItem.Expiration = new Expiration(ExpirationType.Sliding, new TimeSpan(0, 2, 0));
///
///
/// cache.Insert(key, cachedItem, lockHandle, true);
/// }
/// catch (OperationFailedException ex)
/// {
/// ...
/// }
/// }
/// </code>
/// </example>
void Insert(string key, CacheItem item, LockHandle lockHandle = null, bool releaseLock = false);
/// <summary>
/// Inserts a dictionary of cache keys with <see cref="CacheItem"/> to the cache with the WriteThruOptions.
/// The CacheItem contains properties to associate with the item, like expiration, dependencies and eviction information.
/// </summary>
/// <param name="items">Dictionary of keys and <see cref="CacheItem"/>. Keys must be unique.</param>>
/// <returns>Dictionary of Keys along with Exception that were unable to store in cache.</returns>
/// <remarks> If the key or multilple keys already exist, this overload overwrites the values of the existing <seealso cref="ICache"/> items.
/// If the key does not exist, it adds the item to the cache.</remarks>
/// <example>The following example demonstrates how to insert items to the cache with an absolute
/// expiration 2 minutes from now, a priority of
/// high, and that notifies the application when the item is removed from the cache.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// CacheItem[] cacheItems = new CacheItem[2];
///
/// Product product_1 = new Product();
/// product_1.Id = 1;
/// product_1.Name = "Chai";
///
/// Product product_2 = new Product();
/// product_2.Id = 2;
/// product_2.Name = "Chang";
///
/// Product product_3 = new Product();
/// product_3.Id = 2;
/// product_3.Name = "Aniseed Syrup";
///
/// cacheItems[0] = new CacheItem(product_1);
/// cacheItems[0].Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 2, 0));
/// cacheItems[0].Priority = CacheItemPriority.High;
///
/// cacheItems[1] = new CacheItem(product_2);
/// cacheItems[1].Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 2, 0));
/// cacheItems[1].Priority = CacheItemPriority.Normal;
///
/// cacheItems[2] = new CacheItem(product_3);
/// cacheItems[2].Expiration = new Expiration(ExpirationType.Absolute, new TimeSpan(0, 2, 0));
/// cacheItems[2].Priority = CacheItemPriority.Low;
///
/// IDictionary<string, CacheItem> items = new Dictionary<string, CacheItem>()
/// {
/// { "Product0",cacheItems[0]},
/// { "Product1",cacheItems[1]},
/// { "Product2",cacheItems[2]}
/// }
///
///
/// cache.InsertBulk(items);
/// </code>
/// </example>
IDictionary<string , Exception> InsertBulk(IDictionary<string, CacheItem> items);
/// <summary>
/// Update <see cref="CacheItemAttributes"/> of an existing item in cache.
/// </summary>
/// <param name="key">Unique key to identify the cache item.</param>
/// <param name="attributes">An instance of<see cref="CacheItemAttributes"/> to update item in the cache.</param>
/// <returns>Flag that determines status of the Update operation. <b>True</b> if attributes of
/// the item in cache was updated successfully and <b>False</b> if operation failed.
/// </returns>
/// <example>Example demonstrates how to update Absolute Expiration of 5 minutes on an existing item in cache.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// string key = "Product0";
///
/// cache.Insert(key, product);
///
/// CacheItemAttributes attributes = new CacheItemAttributes();
///
/// if(cache.UpdateAttributes(key, attributes))
/// {
/// ...
/// }
/// </code>
/// </example>
//bool UpdateAttributes(string key, CacheItemAttributes attributes);
#endregion
#region Get Operations
/// <summary>
/// Retrieves the specified item from the Cache object, with read-through caching option available. If the option of read-through has been set, the object will be fetched from the data source if it does not exist in cache.
/// </summary>
/// <typeparam name="T">Specifies the type of value obtained from the cache.</typeparam>
/// <param name="key">The unique identifier for the cache item to be retrieved.</param>
/// <returns>The retrieved cache item, or a null reference if the key is not found.</returns>
/// <remarks>
/// If the key does not exists in the cache then null is returned.
/// </remarks>
/// <example>Example demonstrates how to retrieve the value from cached
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// string key = "Product0";
///
///
/// Product product = cache.Get<Product>(key,readThruOptions);
/// </code>
/// </example>
T Get<T>(string key);
// functionality of lockhandle with readthru is not supported.
/// <summary>
/// Retrieves the specified item from the Cache if it is not already locked. Otherwise it returns null.
/// This is different from the basic Get operation where an item is returned ignoring the lock
/// altogether.
/// </summary>
/// <typeparam name="T">Specifies the type of value obtained from the cache.</typeparam>
/// <param name="key">Unique identifier for the cache item to be retrieved.</param>
/// <param name="acquireLock">A flag to determine whether to acquire a lock or not.</param>
/// <param name="lockTimeout">The TimeSpan after which the lock is automatically released.</param>
/// <param name="lockHandle">An instance of <seealso cref="LockHandle"/> to hold the lock information.</param>
/// <returns>The retrieved cache item, or a null reference if the key is not found.</returns>
/// <exception cref="ArgumentNullException"><paramref name="key"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="key"/> is an empty string.</exception>
/// <example>Example demonstrates how to retrieve the cached value and acquire a lock at the same time for minutes.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// string key = "Product0";
///
/// cache.Add(key, product);
///
/// LockHandle lockHandle = new LockHandle();
///
/// object cachedItem = cache.Get<Product>(key, true, new TimeSpan(0, 2, 0), ref lockHandle);
/// </code>
/// </example>
T Get<T>(string key, bool acquireLock, TimeSpan lockTimeout, ref LockHandle lockHandle);
/// <summary>
/// Retrieves the objects from cache for the given keys as key-value pairs.
/// </summary>
/// <typeparam name="T">Specifies the type of value obtained from the cache.</typeparam>
/// <param name="keys">The keys against which items are to be fetched from cache.</param>
/// <returns>The retrieved cache items as key-value pairs.</returns>
/// <exception cref="ArgumentNullException"><paramref name="keys"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="keys"/> cannot be serialized.</exception>
/// <example>Example demonstrates how to retrieve the value cached against multiple keys with Read through Options.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// List<string> keys = new List<string>()
/// {
/// "Product0",
/// "Product1",
/// "Product2"
/// };
///
///
/// IDictionary<string, Product> items = cache.GetBulk<Product>(keys);
/// </code>
/// </example>
IDictionary<string, T> GetBulk<T>(IEnumerable<string> keys);
/// <summary>
/// Retrieves the specified CacheItem from the Cache object. This overload also allows specifying the read-through option. If read-through is set and the object does not exist in the cache,
/// the object will be fetched from the data source and added to the cache.
/// </summary>
/// <param name="key">Unique identifier for the cache item to be retrieved.</param>
/// <returns>The specified CacheItem. If the key does not exist, it returns a null reference.</returns>
/// <exception cref="ArgumentNullException"><paramref name="key"/> contains a null reference.</exception>
/// <example>Example demonstrates how to retrieve the cache item
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
/// string key = "Product0";
/// CacheItem cacheItem = cache.GetCacheItem(key);
/// </code>
/// </example>
CacheItem GetCacheItem(string key);
/// <summary>
/// Get the cache item stored in cache. Loack handle can be given with this and a flag can be set if you want to acquire lock.
/// </summary>
/// <param name="key">Key used to reference the desired object.</param>
/// <param name="acquireLock">A flag to determine whether to acquire a lock or not.</param>
/// <param name="lockTimeout">The TimeSpan after which the lock is automatically released.</param>
/// <param name="lockHandle">An instance of <see cref="LockHandle"/> to hold the lock information.</param>
/// <returns>The retrieved cache item. If key is not found, a null reference.</returns>
/// /// <example>Example demonstrates how to retrieve cache item with lock handle, timeout and flag
/// box server control.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
/// string key = "Product0";
/// LockHandle lockHandle = new LockHandle();
/// CacheItem item = cache.GetCacheItem(key, true, TimeSpan.FromSeconds(30), ref lockHandle);
/// </code>
/// </example>
CacheItem GetCacheItem(string key, bool acquireLock, TimeSpan lockTimeout, ref LockHandle lockHandle);
/// <summary>
/// Retrieves the specified CacheItems from the Cache object.
/// </summary>
/// <param name="keys">IEnumerable list of unique identifier for the cache items to be retrieved.</param>
/// <returns>The retrieved cache items as key-value pairs.</returns>
/// /// <example>Example demonstrates how to retrieve the cache items with read thru option.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// List<string> keys = new List<string>()
/// {
/// "Product0",
/// "Product1",
/// "Product2"
/// };
///
/// IDictionary<string, CacheItem> items = cache.GetCacheItemBulk(keys);
/// </code>
/// </example>
IDictionary<string, CacheItem> GetCacheItemBulk(IEnumerable<string> keys);
#endregion
#region Remove Operations
// add an out parameter for object be removed same for other overloads.
/// <summary>
/// Removes the specified item from the <see cref="ICache"/>.
/// </summary>
/// <param name="key">Unique key of the item to be removed.</param>
/// <param name="lockHandle">If the item is locked, it can be removed only if the correct lockHandle is specified. lockHandle should be the same which was used initially to lock the item, otherwise you will get the 'OperationFailedException'.</param>
/// <example>Example demonstrates how to remove a locked item in the cache with write through options.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// string key = "Product0";
///
///
/// LockHandle lockHandle = new LockHandle();
///
/// object item = cache.Get<Product>(key, true, TimeSpan.Zero, ref lockHandle);
///
/// if (item != null)
/// {
/// try
/// {
///
/// cache.Remove(key, lockHandle);
/// }
/// catch (OperationFailedException ex)
/// {
/// ...
/// }
/// }
/// </code>
/// </example>
void Remove(string key, LockHandle lockHandle = null);
/// <summary>
/// Removes the specified item from the <see cref="ICache"/> and returns it to the application as an out parameter. You can also specify the write option such that the item may be removed from both cache and data source.
/// </summary>
/// <typeparam name="T">Specifies the type of value obtained from the cache.</typeparam>
/// <param name="key">Unique key of the item to be removed.</param>
/// <param name="removedItem">out Parameter through which the removed item from cache is returned</param>
/// <param name="lockHandle">If the item is locked, it can be removed only if the correct lockHandle is specified. lockHandle should be the same which was used initially to lock the item, otherwise you will get the 'OperationFailedException'.</param>
/// <exception cref="ArgumentNullException"><paramref name="key"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="key"/> is not serializable.</exception>
/// <example>Example demonstrates how you can remove an item from cache
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// Product product = new Product();
/// product.Id = 1;
/// product.Name = "Chai";
///
/// string key = "Product0";
///
///
/// LockHandle lockHandle = new LockHandle();
/// object item = cache.Get<Product>(key, true, TimeSpan.Zero, ref lockHandle);
///
///
/// try
/// {
/// Product removedProduct = null;
/// if (cache.Remove<Product>(key, out removedProduct, lockHandle))
/// {
/// //Removed successfully
/// }
/// else
/// {
/// //Error Occured
/// }
/// }
/// catch(Exception ex)
/// {
/// ...
/// }
/// </code>
/// </example>
bool Remove<T>(string key, out T removedItem, LockHandle lockHandle = null);
/// <summary>
/// Removes the specified items from the <see cref="ICache"/>.
/// </summary>
/// <param name="keys">List of unique keys to reference the items.</param>
/// <exception cref="ArgumentNullException"><paramref name="keys"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="keys"/> is not serializable.</exception>
/// <example>The following example demonstrates how you can remove an item from your application's
/// <see cref="ICache"/> object.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// List<string> keys = new List<string>()
/// {
/// "Product0",
/// "Product1",
/// "Product2"
/// };
///
///
/// cache.RemoveBulk(keys);
/// </code>
/// </example>
void RemoveBulk(IEnumerable<string> keys );
/// <summary>
/// Removes the specified items from the <see cref="Cache"/> and returns them to the application in the form of a dictionary as an out Parameter.
/// </summary>
/// <typeparam name="T">Specifies the type of value obtained from the cache.</typeparam>
/// <param name="keys">List of unique keys to reference the items.</param>
/// <param name="removedItems">out Parameter through which the removed items from cache are returned</param>
/// <exception cref="ArgumentNullException"><paramref name="keys"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="keys"/> is not serializable.</exception>
/// <remarks>
/// <para>RemovedItems dictionary contains the key and value of the items that were successfully removed from the cache.</para>
/// </remarks>
/// <example>The following example demonstrates how you can remove multiple of items from your application's
/// <see cref="ICache"/> object.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// List<string> keys = new List<string>()
/// {
/// "Product0",
/// "Product1",
/// "Product2"
/// };
///
///
/// IDictionary<string, Product> products = null;
/// cache.RemoveBulk<Product>(keys,out products);
/// </code>
/// </example>
void RemoveBulk<T>(IEnumerable<string> keys, out IDictionary<string, T> removedItems);
#endregion
#region Conatins Operations
/// <summary>
/// Determines whether the cache contains a specific key.
/// </summary>
/// <param name="key">The key to locate in the <see cref="ICache"/>.</param>
/// <returns><b>true</b> if the <see cref="ICache"/> contains an element
/// with the specified key; otherwise, <b>false</b>.</returns>
/// <remarks>In most of the cases this method's implementation is close to O(1).
/// <para><b>Note:</b> In a partitioned cluster this operation is an expensive one as it might
/// result in network calls. It is therefore advised to use this property only when required.
/// </para>
/// </remarks>
/// <exception cref="ArgumentNullException"><paramref name="key"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="key"/> is not serializable.</exception>
/// <example>The following example demonstrates how to check for containment of an item in the <see cref="ICache"/>
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// if(cache.Contains("Product0"))
/// {
/// Response.Write("Item found!");
/// }
/// </code>
/// </example>
bool Contains(string key);
/// <summary>
/// Determines whether the cache contains specifiec keys.
/// </summary>
/// <param name="keys">IEnumerable collection of keys.</param>
/// <returns>
/// Dictionary of Keys with Flag to dertermine presence of each key in cache.
/// <b>true</b> if the <see cref="ICache"/> contains an element
/// with the specified key; otherwise, <b>false</b>.
/// </returns>
/// <remarks>
/// <para><b>Note:</b> In a partitioned cluster this operation is an expensive one as it might
/// result in network calls. It is therefore advised to use this property only when required.
/// </para>
/// </remarks>
/// <exception cref="ArgumentNullException"><paramref name="keys"/> contains a null reference.</exception>
/// <exception cref="ArgumentException"><paramref name="keys"/> is not serializable.</exception>
/// <example>The following example demonstrates how to check for containment of an item in the <see cref="ICache"/>.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// List<string> keys = new List<string>()
/// {
/// "Product0",
/// "Product1"
/// };
///
/// IDictionary<string, bool> result = cache.ContainsBulk(list);
/// </code>
/// </example>
IDictionary<string, bool> ContainsBulk(IEnumerable<string> keys);
#endregion
#region Clear Operations
/// <summary>
/// Removes all elements from the <see cref="ICache"/>.
/// </summary>
/// <remarks>In most of the cases this method's implementation is close to O(1).
/// </remarks>
/// <example>Example demonstrates how to check for containment of an item in the <see cref="ICache"/>.
/// <code>
/// ICache cache = CacheManager.GetCache("myCache");
///
/// cache.Clear();
/// </code>
/// </example>
void Clear();
#endregion
#region Lock Operations
/// <summary>
/// Unlocks a locked cached item if the correct LockHandle is specified.
/// If LockHandle is null Forcefully unlocks a locked cached item.
/// </summary>
/// <param name="key">Key of the cached item to be unlocked.</param>
/// <param name="lockHandle">An instance of <see cref="LockHandle"/> that is generated when the lock is acquired.</param>
/// <example>
/// Following example demonstrates how to unlock a cached item.
/// <code>
/// ...
/// string key = "Product0";
/// ...
/// theCache.Unlock(key, lockHandle);
/// ...
/// </code>
/// </example>
void Unlock(string key, LockHandle lockHandle = null);
/// <summary>
/// Acquires a lock on an item in the cache.
/// </summary>
/// <param name="key">key of cached item to be locked.</param>
/// <param name="lockTimeout">An instance of <see cref="TimeSpan"/> after which the lock is automatically released.</param>
/// <param name="lockHandle">An instance of <see cref="LockHandle"/> that will be filled in with the lock information if lock is acquired successfully.</param>
/// <returns>Whether or not lock was acquired successfully.</returns>
/// <example>
/// Example demonstrates how to lock a cached item.
/// <code>
/// ...
/// string key = "Product0";
/// LockHandle lockHandle = new LockHandle();
/// bool locked = theCache.lock(key, new TimeSpan(0,0,10), out lockHandle);
/// ...
/// </code>
/// </example>
bool Lock(string key, TimeSpan lockTimeout, out LockHandle lockHandle);
#endregion
#region Enumerators
/// <summary>
/// Retrieves a dictionary enumerator used to iterate
/// through the key settings and their values as JSON objects
/// contained in the cache.
/// </summary>
/// <remarks>
/// <para>
/// To use GetJsonEnumerator method, cache serilization must be set to JSON instead of Binary.
/// </para>
/// If items are added or removed from the cache while enumerating through the items
/// the behavior is not predictable. It is therefore advised not to update the cache keys
/// while enumerating.
/// <para><b>Note:</b> Just like <see cref="Cache.Count"/> in a cluster especially partitioned
/// this operation is an expensive one and may require network calls. It is therefore advised to use
/// this method only when required.
/// </para>
/// </remarks>
/// <returns>An enumerator to iterate through the <see cref="Cache"/> as JSON objects.</returns>
//IEnumerator GetJsonEnumerator();
#endregion
}
} | 45.21382 | 258 | 0.578592 | [
"Apache-2.0"
] | delsoft/NCache | Src/NCClient/Core/ICache.cs | 34,681 | C# |
namespace Sudoku.Bot.Communication.Triggering;
/// <summary>
/// Provides with the event data for <see cref="GuildRelatedEventHandler"/>.
/// </summary>
/// <seealso cref="GuildRelatedEventHandler"/>
public sealed class GuildRelatedEventArgs : EventArgs
{
/// <summary>
/// Initializes a <see cref="GuildRelatedEventArgs"/> instance via the specified GUILD value
/// and the event triggered.
/// </summary>
/// <param name="guild">The GUILD.</param>
/// <param name="eventType">The event type.</param>
public GuildRelatedEventArgs(Guild guild, string eventType) => (Guild, EventType) = (guild, eventType);
/// <summary>
/// Indicates a <see cref="string"/> value indicating which event is triggered.
/// The possible values are <see cref="RawMessageTypes.GuildCreated"/>,
/// <see cref="RawMessageTypes.GuildUpdated"/> and <see cref="RawMessageTypes.GuildDeleted"/>.
/// </summary>
public string EventType { get; }
/// <summary>
/// Indicates the GUILD.
/// </summary>
public Guild Guild { get; }
}
| 34.033333 | 104 | 0.701273 | [
"MIT"
] | Sunnie-Shine/Sudoku | src/Sudoku.Bot.Communication/Triggering/GuildRelatedEventArgs.cs | 1,023 | C# |
using k8s.Operators;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading;
using System;
namespace k8s.Operators.Tests
{
public class TestableController : Controller<TestableCustomResource>
{
public TestableController() : base(OperatorConfiguration.Default, null, null)
{
}
public TestableController(IKubernetes client, ILoggerFactory loggerFactory = null) : base(OperatorConfiguration.Default, client, loggerFactory)
{
}
public TestableController(OperatorConfiguration configuration, IKubernetes client, ILoggerFactory loggerFactory = null) : base(configuration, client, loggerFactory)
{
}
public List<TestableCustomResource> Invocations_AddOrModify = new List<TestableCustomResource>();
public List<TestableCustomResource> Invocations_Delete = new List<TestableCustomResource>();
public List<(TestableCustomResource resource, bool deleteEvent)> Invocations = new List<(TestableCustomResource resource, bool deleteEvent)>();
public List<(TestableCustomResource resource, bool deleteEvent)> CompletedEvents = new List<(TestableCustomResource resource, bool deleteEvent)>();
private Queue<TaskCompletionSource<object>> _signals = new Queue<TaskCompletionSource<object>>();
protected override async Task AddOrModifyAsync(TestableCustomResource resource, CancellationToken cancellationToken)
{
Invocations_AddOrModify.Add(resource);
Invocations.Add((resource, false));
if (_signals.TryDequeue(out var signal))
{
// Wait for UnblockEvent()
await signal?.Task;
}
if (_exceptionsToThrow > 0)
{
_exceptionsToThrow--;
throw new Exception();
}
CompletedEvents.Add((resource, deleteEvent: false));
}
protected override async Task DeleteAsync(TestableCustomResource resource, CancellationToken cancellationToken)
{
Invocations_Delete.Add(resource);
Invocations.Add((resource, true));
if (_signals.TryDequeue(out var signal))
{
// Wait for UnblockEvent()
await signal?.Task;
}
if (_exceptionsToThrow > 0)
{
_exceptionsToThrow--;
throw new Exception();
}
CompletedEvents.Add((resource, deleteEvent: true));
}
/// <summary>
/// Protected method exposed as Public
/// </summary>
public Task<TestableCustomResource> Exposed_UpdateResourceAsync(TestableCustomResource resource, CancellationToken cancellationToken) => UpdateResourceAsync(resource, cancellationToken);
/// <summary>
/// Protected method exposed as Public
/// </summary>
public Task<TestableCustomResource> Exposed_UpdateStatusAsync(TestableCustomResource resource, CancellationToken cancellationToken) => UpdateStatusAsync(resource, cancellationToken);
/// <summary>
/// Throws an exception in the next calls to AddOrModifyAsync or DeleteAsync
/// </summary>
/// <param name="count">The number of the events to make fail</param>
public void ThrowExceptionOnNextEvents(int count)
{
_exceptionsToThrow = count;
}
private int _exceptionsToThrow = 0;
/// <summary>
/// Block the next call to AddOrModifyAsync or DeleteAsync
/// </summary>
public TaskCompletionSource<object> BlockNextEvent()
{
var signal = new TaskCompletionSource<object>();
_signals.Enqueue(signal);
return signal;
}
/// <summary>
/// Unblock the next call to AddOrModifyAsync or DeleteAsync
/// </summary>
public void UnblockEvent(TaskCompletionSource<object> signal)
{
signal.SetResult(true);
}
}
}
| 37.045045 | 194 | 0.640807 | [
"Apache-2.0"
] | falox/csharp-operator-sdk | tests/k8s.Operators.Tests/TestableController.cs | 4,112 | C# |
using System;
class PointWithinCircle
{
static void Main()
{
double r = 2;
double x = 1;
double y = 2;
if (x * x + y * y <= r * r)
{
Console.WriteLine("Point ({0};{1}) is within the circle: {2}", x, y, true);
}
else
{
Console.WriteLine("Point ({0};{1}) is within the circle: {2}", x, y, false);
}
}
}
| 20.55 | 88 | 0.43309 | [
"MIT"
] | baretata/CSharpPartOne | 03.Operators and Expressions/Point within circle/Program.cs | 413 | C# |
namespace VerifyTests;
public static partial class VerifierSettings
{
internal static List<Action<StringBuilder>> GlobalScrubbers = new();
static VerifierSettings()
{
MemberConverter<Exception, string>(x => x.StackTrace, (_, value) => Scrubbers.ScrubStackTrace(value));
}
internal static Dictionary<string, List<Action<StringBuilder>>> ExtensionMappedGlobalScrubbers = new();
/// <summary>
/// Modify the resulting test content using custom code.
/// </summary>
public static void AddScrubber(Action<StringBuilder> scrubber)
{
GlobalScrubbers.Insert(0, scrubber);
}
/// <summary>
/// Modify the resulting test content using custom code.
/// </summary>
public static void AddScrubber(string extension, Action<StringBuilder> scrubber)
{
if (!ExtensionMappedGlobalScrubbers.TryGetValue(extension, out var values))
{
ExtensionMappedGlobalScrubbers[extension] = values = new();
}
values.Add(scrubber);
}
/// <summary>
/// Remove any lines containing any of <paramref name="stringToMatch" /> from the test results.
/// </summary>
public static void ScrubLinesContaining(StringComparison comparison, params string[] stringToMatch)
{
GlobalScrubbers.Insert(0, s => s.RemoveLinesContaining(comparison, stringToMatch));
}
/// <summary>
/// Remove any lines matching <paramref name="removeLine" /> from the test results.
/// </summary>
public static void ScrubLines(Func<string, bool> removeLine)
{
GlobalScrubbers.Insert(0, s => s.FilterLines(removeLine));
}
/// <summary>
/// Remove any lines containing only whitespace from the test results.
/// </summary>
public static void ScrubEmptyLines()
{
GlobalScrubbers.Insert(0, s => s.FilterLines(string.IsNullOrWhiteSpace));
}
/// <summary>
/// Replace inline <see cref="Guid" />s with a placeholder.
/// Uses a <see cref="Regex" /> to find <see cref="Guid" />s inside strings.
/// </summary>
public static void ScrubInlineGuids()
{
GlobalScrubbers.Insert(0, GuidScrubber.ReplaceGuids);
}
/// <summary>
/// Scrub lines with an optional replace.
/// <paramref name="replaceLine" /> can return the input to ignore the line, or return a a different string to replace it.
/// </summary>
public static void ScrubLinesWithReplace(Func<string, string?> replaceLine)
{
GlobalScrubbers.Insert(0, s => s.ReplaceLines(replaceLine));
}
/// <summary>
/// Remove any lines containing any of <paramref name="stringToMatch" /> from the test results.
/// </summary>
public static void ScrubLinesContaining(params string[] stringToMatch)
{
ScrubLinesContaining(StringComparison.OrdinalIgnoreCase, stringToMatch);
}
/// <summary>
/// Remove the <see cref="Environment.MachineName" /> from the test results.
/// </summary>
public static void ScrubMachineName()
{
AddScrubber(Scrubbers.ScrubMachineName);
}
} | 34.663043 | 127 | 0.642521 | [
"MIT"
] | tom-englert/Verify | src/Verify/Serialization/Scrubbers/VerifierSettings.cs | 3,100 | C# |
// <copyright file="ScriptFileGenerator.cs" company="Oleg Sych">
// Copyright © Oleg Sych. All Rights Reserved.
// </copyright>
namespace T4Toolbox.VisualStudio
{
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using EnvDTE;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Designer.Interfaces;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TextTemplating.VSHost;
/// <summary>
/// Two-stage template-based file generator.
/// </summary>
/// <remarks>
/// When associated with any file, this generator will produce an empty text template
/// with the same name as the file and .tt extension. This template will be then
/// transformed by the standard TextTemplatingFileGenerator. If the template already
/// exist, this generator will preserve its content and still trigger the second
/// code generation stage.
/// </remarks>
[Guid("8CAB1895-2287-463F-BE14-1ADB873B4741")]
public class ScriptFileGenerator : BaseCodeGeneratorWithSite
{
internal const string Name = "T4Toolbox.ScriptFileGenerator";
internal const string Description = "Generator that creates a new or transforms existing Text Template";
/// <summary>
/// Returns extension of the output file this generator produces.
/// </summary>
public override string GetDefaultExtension()
{
return ".tt";
}
/// <summary>
/// Generates new or transforms existing T4 script.
/// </summary>
protected override byte[] GenerateCode(string inputFileName, string inputFileContent)
{
return
this.GenerateFromAssociatedTemplateFile(inputFileName) ??
this.GenerateFromExistingScriptFile(inputFileName) ??
this.GenerateNewScriptFile(inputFileName);
}
private byte[] GenerateFromExistingScriptFile(string inputFileName)
{
string outputFileName = Path.ChangeExtension(inputFileName, this.GetDefaultExtension());
if (File.Exists(outputFileName))
{
// If the output file is opened in Visual Studio editor, save it to prevent the "Run Custom Tool" implementation from silently discarding changes.
Document outputDocument = this.Dte.Documents.Cast<Document>().SingleOrDefault(d => d.FullName == outputFileName);
if (outputDocument != null && !outputDocument.Saved)
{
// Save the script file if it was modified
outputDocument.Save(string.Empty);
}
// Read it from disk. The "Run Custom Tool" implementation always overwrites it.
return File.ReadAllBytes(outputFileName);
}
return null;
}
private byte[] GenerateFromAssociatedTemplateFile(string inputFileName)
{
var hierarchy = (IVsHierarchy)this.GetService(typeof(IVsHierarchy));
uint inputItemId;
ErrorHandler.ThrowOnFailure(hierarchy.ParseCanonicalName(inputFileName, out inputItemId));
string templatePath;
var propertyStorage = (IVsBuildPropertyStorage)hierarchy;
if (ErrorHandler.Failed(propertyStorage.GetItemAttribute(inputItemId, ItemMetadata.Template, out templatePath)))
{
return null;
}
// Remove <Template> metadata from the project item and refresh the properties window
ErrorHandler.ThrowOnFailure(propertyStorage.SetItemAttribute(inputItemId, ItemMetadata.Template, null));
var propertyBrowser = (IVSMDPropertyBrowser)this.GlobalServiceProvider.GetService(typeof(SVSMDPropertyBrowser));
propertyBrowser.Refresh();
var templateLocator = (TemplateLocator)this.GlobalServiceProvider.GetService(typeof(TemplateLocator));
if (!templateLocator.LocateTemplate(inputFileName, ref templatePath))
{
return null;
}
return File.ReadAllBytes(templatePath);
}
private byte[] GenerateNewScriptFile(string inputFileName)
{
string language;
string extension;
const string VisualBasicProject = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}";
Project currentProject = this.Dte.Solution.FindProjectItem(inputFileName).ContainingProject;
if (string.Equals(currentProject.Kind, VisualBasicProject, StringComparison.OrdinalIgnoreCase))
{
language = "VB";
extension = "vb";
}
else
{
language = "C#";
extension = "cs";
}
string outputFileContent =
"<#@ template language=\"" + language + "\" debug=\"True\" #>" + Environment.NewLine +
"<#@ output extension=\"" + extension + "\" #>" + Environment.NewLine +
"<#@ include file=\"T4Toolbox.tt\" #>" + Environment.NewLine;
return Encoding.UTF8.GetBytes(outputFileContent);
}
}
}
| 42.606299 | 163 | 0.613011 | [
"MIT"
] | AshleyHollis/T4Toolbox | src/T4Toolbox.VisualStudio/ScriptFileGenerator.cs | 5,414 | C# |
using System;
namespace UnityEngine.XR.ARSubsystems
{
/// <summary>
/// Encapsulates all information provided in an event callback for when the camera frame is received.
/// </summary>
public struct XRCameraFrameReceivedArgs : IEquatable<XRCameraFrameReceivedArgs>
{
/// <summary>
/// The camera subsystem that is raising the event.
/// </summary>
/// <value>
/// The camera subsystem that is raising the event.
/// </value>
public XRCameraSubsystem cameraSubsystem { get; private set; }
/// <summary>
/// The camera frame that raised this event.
/// </summary>
/// <value>
/// The camera frame that raised this event.
/// </value>
public XRCameraFrame cameraFrame { get; private set; }
/// <summary>
/// Constructs a <c>XRCameraFrameReceivedArgs</c>.
/// </summary>
/// <param name="cameraSubsystem">The camera subsystem that is raising the event.</param>
internal XRCameraFrameReceivedArgs(XRCameraSubsystem cameraSubsystem, XRCameraFrame cameraFrame)
{
this.cameraSubsystem = cameraSubsystem;
this.cameraFrame = cameraFrame;
}
public bool Equals(XRCameraFrameReceivedArgs other)
{
return cameraSubsystem.Equals(other.cameraSubsystem) && cameraFrame.Equals(other.cameraFrame);
}
public override bool Equals(System.Object obj)
{
return ((obj is XRCameraFrameReceivedArgs) && Equals((XRCameraFrameReceivedArgs)obj));
}
public static bool operator ==(XRCameraFrameReceivedArgs lhs, XRCameraFrameReceivedArgs rhs)
{
return lhs.Equals(rhs);
}
public static bool operator !=(XRCameraFrameReceivedArgs lhs, XRCameraFrameReceivedArgs rhs)
{
return !lhs.Equals(rhs);
}
public override int GetHashCode()
{
int hashCode = 486187739;
unchecked
{
hashCode = (hashCode * 486187739) + cameraSubsystem.GetHashCode();
hashCode = (hashCode * 486187739) + cameraFrame.GetHashCode();
}
return hashCode;
}
public override string ToString()
{
return string.Format("frame received {0}", cameraFrame.ToString());
}
}
}
| 33.123288 | 106 | 0.598428 | [
"Apache-2.0"
] | BCBlanka/BeatSaber | Library/PackageCache/com.unity.xr.arsubsystems@2.1.3/Runtime/CameraSubsystem/XRCameraFrameReceivedArgs.cs | 2,418 | C# |
namespace Authy.netcore.Results
{
/// <summary>
/// Result from starting a Phone call
/// </summary>
public class StartPhoneCallResult : AuthyResult
{
}
}
| 16.454545 | 51 | 0.618785 | [
"MIT"
] | hansimehdi/AuthyClient | Authy.NetCore/Results/StartPhoneCallResult.cs | 183 | C# |
// ConcurrentDictionary.cs
//
// Copyright (c) 2009 Jérémie "Garuma" Laval
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//
#if !NET40PLUS || (PORTABLE && !WINRT)
using System;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using System.Diagnostics;
// declare the namespace so Sharpen-generated using declarations will not produce errors
namespace System.Collections.Concurrent
{
}
namespace Antlr4.Runtime.Sharpen
{
#if !COMPACT
[DebuggerDisplay ("Count={Count}")]
[DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
#endif
public class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>,
ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>,
IDictionary, ICollection, IEnumerable
{
IEqualityComparer<TKey> comparer;
SplitOrderedList<TKey, KeyValuePair<TKey, TValue>> internalDictionary;
public ConcurrentDictionary () : this (EqualityComparer<TKey>.Default)
{
}
public ConcurrentDictionary (IEnumerable<KeyValuePair<TKey, TValue>> collection)
: this (collection, EqualityComparer<TKey>.Default)
{
}
public ConcurrentDictionary (IEqualityComparer<TKey> comparer)
{
this.comparer = comparer;
this.internalDictionary = new SplitOrderedList<TKey, KeyValuePair<TKey, TValue>> (comparer);
}
public ConcurrentDictionary (IEnumerable<KeyValuePair<TKey, TValue>> collection, IEqualityComparer<TKey> comparer)
: this (comparer)
{
foreach (KeyValuePair<TKey, TValue> pair in collection)
Add (pair.Key, pair.Value);
}
// Parameters unused
public ConcurrentDictionary (int concurrencyLevel, int capacity)
: this (EqualityComparer<TKey>.Default)
{
}
public ConcurrentDictionary (int concurrencyLevel,
IEnumerable<KeyValuePair<TKey, TValue>> collection,
IEqualityComparer<TKey> comparer)
: this (collection, comparer)
{
}
// Parameters unused
public ConcurrentDictionary (int concurrencyLevel, int capacity, IEqualityComparer<TKey> comparer)
: this (comparer)
{
}
void CheckKey (TKey key)
{
if (key == null)
throw new ArgumentNullException ("key");
}
void Add (TKey key, TValue value)
{
while (!TryAdd (key, value));
}
void IDictionary<TKey, TValue>.Add (TKey key, TValue value)
{
Add (key, value);
}
public bool TryAdd (TKey key, TValue value)
{
CheckKey (key);
return internalDictionary.Insert (Hash (key), key, Make (key, value));
}
void ICollection<KeyValuePair<TKey,TValue>>.Add (KeyValuePair<TKey, TValue> pair)
{
Add (pair.Key, pair.Value);
}
public TValue AddOrUpdate (TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
{
CheckKey (key);
if (addValueFactory == null)
throw new ArgumentNullException ("addValueFactory");
if (updateValueFactory == null)
throw new ArgumentNullException ("updateValueFactory");
return internalDictionary.InsertOrUpdate (Hash (key),
key,
() => Make (key, addValueFactory (key)),
(e) => Make (key, updateValueFactory (key, e.Value))).Value;
}
public TValue AddOrUpdate (TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
{
return AddOrUpdate (key, (_) => addValue, updateValueFactory);
}
TValue AddOrUpdate (TKey key, TValue addValue, TValue updateValue)
{
CheckKey (key);
return internalDictionary.InsertOrUpdate (Hash (key),
key,
Make (key, addValue),
Make (key, updateValue)).Value;
}
TValue GetValue (TKey key)
{
TValue temp;
if (!TryGetValue (key, out temp))
throw new KeyNotFoundException (key.ToString ());
return temp;
}
public bool TryGetValue (TKey key, out TValue value)
{
CheckKey (key);
KeyValuePair<TKey, TValue> pair;
bool result = internalDictionary.Find (Hash (key), key, out pair);
value = pair.Value;
return result;
}
public bool TryUpdate (TKey key, TValue newValue, TValue comparisonValue)
{
CheckKey (key);
return internalDictionary.CompareExchange (Hash (key), key, Make (key, newValue), (e) => e.Value.Equals (comparisonValue));
}
public TValue this[TKey key] {
get {
return GetValue (key);
}
set {
AddOrUpdate (key, value, value);
}
}
public TValue GetOrAdd (TKey key, Func<TKey, TValue> valueFactory)
{
CheckKey (key);
return internalDictionary.InsertOrGet (Hash (key), key, Make (key, default(TValue)), () => Make (key, valueFactory (key))).Value;
}
public TValue GetOrAdd (TKey key, TValue value)
{
CheckKey (key);
return internalDictionary.InsertOrGet (Hash (key), key, Make (key, value), null).Value;
}
public bool TryRemove (TKey key, out TValue value)
{
CheckKey (key);
KeyValuePair<TKey, TValue> data;
bool result = internalDictionary.Delete (Hash (key), key, out data);
value = data.Value;
return result;
}
bool Remove (TKey key)
{
TValue dummy;
return TryRemove (key, out dummy);
}
bool IDictionary<TKey, TValue>.Remove (TKey key)
{
return Remove (key);
}
bool ICollection<KeyValuePair<TKey,TValue>>.Remove (KeyValuePair<TKey,TValue> pair)
{
return Remove (pair.Key);
}
public bool ContainsKey (TKey key)
{
CheckKey (key);
KeyValuePair<TKey, TValue> dummy;
return internalDictionary.Find (Hash (key), key, out dummy);
}
bool IDictionary.Contains (object key)
{
if (!(key is TKey))
return false;
return ContainsKey ((TKey)key);
}
void IDictionary.Remove (object key)
{
if (!(key is TKey))
return;
Remove ((TKey)key);
}
object IDictionary.this [object key]
{
get {
if (!(key is TKey))
throw new ArgumentException ("key isn't of correct type", "key");
return this[(TKey)key];
}
set {
if (!(key is TKey) || !(value is TValue))
throw new ArgumentException ("key or value aren't of correct type");
this[(TKey)key] = (TValue)value;
}
}
void IDictionary.Add (object key, object value)
{
if (!(key is TKey) || !(value is TValue))
throw new ArgumentException ("key or value aren't of correct type");
Add ((TKey)key, (TValue)value);
}
bool ICollection<KeyValuePair<TKey,TValue>>.Contains (KeyValuePair<TKey, TValue> pair)
{
return ContainsKey (pair.Key);
}
public KeyValuePair<TKey,TValue>[] ToArray ()
{
// This is most certainly not optimum but there is
// not a lot of possibilities
return new List<KeyValuePair<TKey,TValue>> (this).ToArray ();
}
public void Clear()
{
// Pronk
internalDictionary = new SplitOrderedList<TKey, KeyValuePair<TKey, TValue>> (comparer);
}
public int Count {
get {
return internalDictionary.Count;
}
}
public bool IsEmpty {
get {
return Count == 0;
}
}
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly {
get {
return false;
}
}
bool IDictionary.IsReadOnly {
get {
return false;
}
}
public ICollection<TKey> Keys {
get {
return GetPart<TKey> ((kvp) => kvp.Key);
}
}
public ICollection<TValue> Values {
get {
return GetPart<TValue> ((kvp) => kvp.Value);
}
}
ICollection IDictionary.Keys {
get {
return (ICollection)Keys;
}
}
ICollection IDictionary.Values {
get {
return (ICollection)Values;
}
}
ICollection<T> GetPart<T> (Func<KeyValuePair<TKey, TValue>, T> extractor)
{
List<T> temp = new List<T> ();
foreach (KeyValuePair<TKey, TValue> kvp in this)
temp.Add (extractor (kvp));
return new ReadOnlyCollection<T>(temp);
}
void ICollection.CopyTo (Array array, int startIndex)
{
KeyValuePair<TKey, TValue>[] arr = array as KeyValuePair<TKey, TValue>[];
if (arr == null)
return;
CopyTo (arr, startIndex, Count);
}
void CopyTo (KeyValuePair<TKey, TValue>[] array, int startIndex)
{
CopyTo (array, startIndex, Count);
}
void ICollection<KeyValuePair<TKey, TValue>>.CopyTo (KeyValuePair<TKey, TValue>[] array, int startIndex)
{
CopyTo (array, startIndex);
}
void CopyTo (KeyValuePair<TKey, TValue>[] array, int startIndex, int num)
{
foreach (var kvp in this) {
array [startIndex++] = kvp;
if (--num <= 0)
return;
}
}
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator ()
{
return GetEnumeratorInternal ();
}
IEnumerator IEnumerable.GetEnumerator ()
{
return GetEnumeratorInternal ();
}
IEnumerator<KeyValuePair<TKey, TValue>> GetEnumeratorInternal ()
{
return internalDictionary.GetEnumerator ();
}
IDictionaryEnumerator IDictionary.GetEnumerator ()
{
return new ConcurrentDictionaryEnumerator (GetEnumeratorInternal ());
}
class ConcurrentDictionaryEnumerator : IDictionaryEnumerator
{
IEnumerator<KeyValuePair<TKey, TValue>> internalEnum;
public ConcurrentDictionaryEnumerator (IEnumerator<KeyValuePair<TKey, TValue>> internalEnum)
{
this.internalEnum = internalEnum;
}
public bool MoveNext ()
{
return internalEnum.MoveNext ();
}
public void Reset ()
{
internalEnum.Reset ();
}
public object Current {
get {
return Entry;
}
}
public DictionaryEntry Entry {
get {
KeyValuePair<TKey, TValue> current = internalEnum.Current;
return new DictionaryEntry (current.Key, current.Value);
}
}
public object Key {
get {
return internalEnum.Current.Key;
}
}
public object Value {
get {
return internalEnum.Current.Value;
}
}
}
object ICollection.SyncRoot {
get {
return this;
}
}
bool IDictionary.IsFixedSize {
get {
return false;
}
}
bool ICollection.IsSynchronized {
get { return true; }
}
static KeyValuePair<U, V> Make<U, V> (U key, V value)
{
return new KeyValuePair<U, V> (key, value);
}
uint Hash (TKey key)
{
return (uint)comparer.GetHashCode (key);
}
}
}
#endif
| 24.121535 | 132 | 0.663308 | [
"MIT"
] | GridProtectionAlliance/go2cs | src/Utilities/Antlr4.Runtime/Sharpen/Compat/ConcurrentDictionary.cs | 11,315 | C# |
using Core.Forms.NHibernate.Contracts;
using Core.Forms.NHibernate.Models;
using NUnit.Framework;
namespace Core.Forms.Tests.Services
{
[TestFixture]
public class FormServiceTest : AbstractServiceTest<Form, IFormService>
{
/// <summary>
/// Creates the form.
/// </summary>
/// <returns></returns>
public Form CreateForm()
{
var form = new Form();
((FormLocale)form.CurrentLocale).Title = "test form";
return form;
}
#region Test Methods
[Test]
public void GetForm()
{
var formService = Container.Resolve<IFormService>();
var form = CreateForm();
formService.Save(form);
var savedForm = formService.Find(form.Id);
Assert.NotNull(savedForm);
formService.Delete(form);
}
#endregion
}
}
| 22.878049 | 74 | 0.545842 | [
"BSD-2-Clause"
] | coreframework/Core-Framework | Source/Core.Forms.Tests/Services/FormServiceTest.cs | 940 | C# |
namespace ClearHl7.Codes.V280
{
/// <summary>
/// HL7 Version 2 Table 0422 - Triage Code.
/// </summary>
/// <remarks>https://www.hl7.org/fhir/v2/0422</remarks>
public enum CodeTriageCode
{
/// <summary>
/// 1 - Non-acute.
/// </summary>
NonAcute,
/// <summary>
/// 2 - Acute.
/// </summary>
Acute,
/// <summary>
/// 3 - Urgent.
/// </summary>
Urgent,
/// <summary>
/// 4 - Severe.
/// </summary>
Severe,
/// <summary>
/// 5 - Dead on Arrival (DOA).
/// </summary>
DeadOnArrivalDoa,
/// <summary>
/// 99 - Other.
/// </summary>
Other
}
} | 20.589744 | 59 | 0.392279 | [
"MIT"
] | davebronson/clear-hl7-net | src/ClearHl7.Codes/V280/CodeTriageCode.cs | 805 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace MetaDslx.CodeAnalysis.Symbols
{
/// <summary>
/// AssemblySymbol to represent missing, for whatever reason, CorLibrary.
/// The symbol is created by ReferenceManager on as needed basis and is shared by all compilations
/// with missing CorLibraries.
/// </summary>
internal sealed class MissingCorLibrarySymbol : MissingAssemblySymbol
{
internal static readonly MissingCorLibrarySymbol Instance = new MissingCorLibrarySymbol();
/// <summary>
/// A dictionary of cached Cor types defined in this assembly.
/// Lazily filled by GetSpecialSymbol method.
/// </summary>
/// <remarks></remarks>
private ConcurrentDictionary<object, Symbol> _lazySpecialSymbols;
private MissingCorLibrarySymbol()
: base(new AssemblyIdentity("<Missing Core Assembly>"))
{
this.SetCorLibrary(this);
}
/// <summary>
/// Lookup declaration for predefined CorLib type in this Assembly. Only should be
/// called if it is know that this is the Cor Library (mscorlib).
/// </summary>
/// <param name="type"></param>
public override Symbol GetDeclaredSpecialSymbol(object key)
{
#if DEBUG
foreach (var module in this.Modules)
{
Debug.Assert(module.ReferencedAssemblies.Length == 0);
}
#endif
Symbol result;
if (_lazySpecialSymbols == null || !_lazySpecialSymbols.ContainsKey(key))
{
ModuleSymbol module = this.Modules[0];
if (key is SpecialType type)
{
MetadataTypeName emittedName = MetadataTypeName.FromFullName(type.GetMetadataName(), useCLSCompliantNameArityEncoding: true);
result = module.LookupTopLevelMetadataType(ref emittedName);
if (result.Kind != LanguageSymbolKind.ErrorType && result.DeclaredAccessibility != Accessibility.Public)
{
result = new MissingMetadataTypeSymbol.TopLevel(module, ref emittedName, type);
}
}
else
{
result = this.Language.CompilationFactory.CreateSpecialSymbol(module, key);
if (result == null)
{
result = new MissingMetadataTypeSymbol.TopLevel(module, string.Empty, key.ToString(), 0, false);
}
}
RegisterDeclaredSpecialSymbol(key, ref result);
}
return _lazySpecialSymbols[key];
}
/// <summary>
/// Register declaration of predefined symbol in this Assembly.
/// </summary>
/// <param name="corType"></param>
private void RegisterDeclaredSpecialSymbol(object key, ref Symbol symbol)
{
Debug.Assert(key != null);
Debug.Assert(ReferenceEquals(symbol.ContainingAssembly, this));
Debug.Assert(symbol.ContainingModule.Ordinal == 0);
Debug.Assert(ReferenceEquals(this.CorLibrary, this));
if (_lazySpecialSymbols == null)
{
Interlocked.CompareExchange(ref _lazySpecialSymbols, new ConcurrentDictionary<object, Symbol>(), null);
}
_lazySpecialSymbols.TryAdd(key, symbol);
}
}
}
| 40.138298 | 161 | 0.605884 | [
"Apache-2.0"
] | balazssimon/meta-cs | src/Main/MetaDslx.CodeAnalysis.Meta/CodeAnalysis/Symbols/MissingCorLibrarySymbol.cs | 3,775 | C# |
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
namespace DalSic
{
/// <summary>
/// Strongly-typed collection for the RemAgente class.
/// </summary>
[Serializable]
public partial class RemAgenteCollection : ActiveList<RemAgente, RemAgenteCollection>
{
public RemAgenteCollection() {}
/// <summary>
/// Filters an existing collection based on the set criteria. This is an in-memory filter
/// Thanks to developingchris for this!
/// </summary>
/// <returns>RemAgenteCollection</returns>
public RemAgenteCollection Filter()
{
for (int i = this.Count - 1; i > -1; i--)
{
RemAgente o = this[i];
foreach (SubSonic.Where w in this.wheres)
{
bool remove = false;
System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
if (pi.CanRead)
{
object val = pi.GetValue(o, null);
switch (w.Comparison)
{
case SubSonic.Comparison.Equals:
if (!val.Equals(w.ParameterValue))
{
remove = true;
}
break;
}
}
if (remove)
{
this.Remove(o);
break;
}
}
}
return this;
}
}
/// <summary>
/// This is an ActiveRecord class which wraps the Rem_Agente table.
/// </summary>
[Serializable]
public partial class RemAgente : ActiveRecord<RemAgente>, IActiveRecord
{
#region .ctors and Default Settings
public RemAgente()
{
SetSQLProps();
InitSetDefaults();
MarkNew();
}
private void InitSetDefaults() { SetDefaults(); }
public RemAgente(bool useDatabaseDefaults)
{
SetSQLProps();
if(useDatabaseDefaults)
ForceDefaults();
MarkNew();
}
public RemAgente(object keyID)
{
SetSQLProps();
InitSetDefaults();
LoadByKey(keyID);
}
public RemAgente(string columnName, object columnValue)
{
SetSQLProps();
InitSetDefaults();
LoadByParam(columnName,columnValue);
}
protected static void SetSQLProps() { GetTableSchema(); }
#endregion
#region Schema and Query Accessor
public static Query CreateQuery() { return new Query(Schema); }
public static TableSchema.Table Schema
{
get
{
if (BaseSchema == null)
SetSQLProps();
return BaseSchema;
}
}
private static void GetTableSchema()
{
if(!IsSchemaInitialized)
{
//Schema declaration
TableSchema.Table schema = new TableSchema.Table("Rem_Agente", TableType.Table, DataService.GetInstance("sicProvider"));
schema.Columns = new TableSchema.TableColumnCollection();
schema.SchemaName = @"dbo";
//columns
TableSchema.TableColumn colvarIdAgente = new TableSchema.TableColumn(schema);
colvarIdAgente.ColumnName = "idAgente";
colvarIdAgente.DataType = DbType.Int32;
colvarIdAgente.MaxLength = 0;
colvarIdAgente.AutoIncrement = true;
colvarIdAgente.IsNullable = false;
colvarIdAgente.IsPrimaryKey = true;
colvarIdAgente.IsForeignKey = false;
colvarIdAgente.IsReadOnly = false;
colvarIdAgente.DefaultSetting = @"";
colvarIdAgente.ForeignKeyTableName = "";
schema.Columns.Add(colvarIdAgente);
TableSchema.TableColumn colvarApellido = new TableSchema.TableColumn(schema);
colvarApellido.ColumnName = "apellido";
colvarApellido.DataType = DbType.String;
colvarApellido.MaxLength = 50;
colvarApellido.AutoIncrement = false;
colvarApellido.IsNullable = false;
colvarApellido.IsPrimaryKey = false;
colvarApellido.IsForeignKey = false;
colvarApellido.IsReadOnly = false;
colvarApellido.DefaultSetting = @"('')";
colvarApellido.ForeignKeyTableName = "";
schema.Columns.Add(colvarApellido);
TableSchema.TableColumn colvarNombre = new TableSchema.TableColumn(schema);
colvarNombre.ColumnName = "nombre";
colvarNombre.DataType = DbType.String;
colvarNombre.MaxLength = 50;
colvarNombre.AutoIncrement = false;
colvarNombre.IsNullable = false;
colvarNombre.IsPrimaryKey = false;
colvarNombre.IsForeignKey = false;
colvarNombre.IsReadOnly = false;
colvarNombre.DefaultSetting = @"('')";
colvarNombre.ForeignKeyTableName = "";
schema.Columns.Add(colvarNombre);
TableSchema.TableColumn colvarCodigo = new TableSchema.TableColumn(schema);
colvarCodigo.ColumnName = "codigo";
colvarCodigo.DataType = DbType.Int32;
colvarCodigo.MaxLength = 0;
colvarCodigo.AutoIncrement = false;
colvarCodigo.IsNullable = false;
colvarCodigo.IsPrimaryKey = false;
colvarCodigo.IsForeignKey = false;
colvarCodigo.IsReadOnly = false;
colvarCodigo.DefaultSetting = @"((0))";
colvarCodigo.ForeignKeyTableName = "";
schema.Columns.Add(colvarCodigo);
TableSchema.TableColumn colvarActivo = new TableSchema.TableColumn(schema);
colvarActivo.ColumnName = "activo";
colvarActivo.DataType = DbType.Boolean;
colvarActivo.MaxLength = 0;
colvarActivo.AutoIncrement = false;
colvarActivo.IsNullable = false;
colvarActivo.IsPrimaryKey = false;
colvarActivo.IsForeignKey = false;
colvarActivo.IsReadOnly = false;
colvarActivo.DefaultSetting = @"((1))";
colvarActivo.ForeignKeyTableName = "";
schema.Columns.Add(colvarActivo);
TableSchema.TableColumn colvarNombreCompleto = new TableSchema.TableColumn(schema);
colvarNombreCompleto.ColumnName = "nombreCompleto";
colvarNombreCompleto.DataType = DbType.String;
colvarNombreCompleto.MaxLength = 102;
colvarNombreCompleto.AutoIncrement = false;
colvarNombreCompleto.IsNullable = false;
colvarNombreCompleto.IsPrimaryKey = false;
colvarNombreCompleto.IsForeignKey = false;
colvarNombreCompleto.IsReadOnly = true;
colvarNombreCompleto.DefaultSetting = @"";
colvarNombreCompleto.ForeignKeyTableName = "";
schema.Columns.Add(colvarNombreCompleto);
BaseSchema = schema;
//add this schema to the provider
//so we can query it later
DataService.Providers["sicProvider"].AddSchema("Rem_Agente",schema);
}
}
#endregion
#region Props
[XmlAttribute("IdAgente")]
[Bindable(true)]
public int IdAgente
{
get { return GetColumnValue<int>(Columns.IdAgente); }
set { SetColumnValue(Columns.IdAgente, value); }
}
[XmlAttribute("Apellido")]
[Bindable(true)]
public string Apellido
{
get { return GetColumnValue<string>(Columns.Apellido); }
set { SetColumnValue(Columns.Apellido, value); }
}
[XmlAttribute("Nombre")]
[Bindable(true)]
public string Nombre
{
get { return GetColumnValue<string>(Columns.Nombre); }
set { SetColumnValue(Columns.Nombre, value); }
}
[XmlAttribute("Codigo")]
[Bindable(true)]
public int Codigo
{
get { return GetColumnValue<int>(Columns.Codigo); }
set { SetColumnValue(Columns.Codigo, value); }
}
[XmlAttribute("Activo")]
[Bindable(true)]
public bool Activo
{
get { return GetColumnValue<bool>(Columns.Activo); }
set { SetColumnValue(Columns.Activo, value); }
}
[XmlAttribute("NombreCompleto")]
[Bindable(true)]
public string NombreCompleto
{
get { return GetColumnValue<string>(Columns.NombreCompleto); }
set { SetColumnValue(Columns.NombreCompleto, value); }
}
#endregion
#region PrimaryKey Methods
protected override void SetPrimaryKey(object oValue)
{
base.SetPrimaryKey(oValue);
SetPKValues();
}
private DalSic.RemFormularioCollection colRemFormularioRecords;
public DalSic.RemFormularioCollection RemFormularioRecords
{
get
{
if(colRemFormularioRecords == null)
{
colRemFormularioRecords = new DalSic.RemFormularioCollection().Where(RemFormulario.Columns.IdAgente, IdAgente).Load();
colRemFormularioRecords.ListChanged += new ListChangedEventHandler(colRemFormularioRecords_ListChanged);
}
return colRemFormularioRecords;
}
set
{
colRemFormularioRecords = value;
colRemFormularioRecords.ListChanged += new ListChangedEventHandler(colRemFormularioRecords_ListChanged);
}
}
void colRemFormularioRecords_ListChanged(object sender, ListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.ItemAdded)
{
// Set foreign key value
colRemFormularioRecords[e.NewIndex].IdAgente = IdAgente;
}
}
#endregion
//no foreign key tables defined (0)
//no ManyToMany tables defined (0)
#region ObjectDataSource support
/// <summary>
/// Inserts a record, can be used with the Object Data Source
/// </summary>
public static void Insert(string varApellido,string varNombre,int varCodigo,bool varActivo,string varNombreCompleto)
{
RemAgente item = new RemAgente();
item.Apellido = varApellido;
item.Nombre = varNombre;
item.Codigo = varCodigo;
item.Activo = varActivo;
item.NombreCompleto = varNombreCompleto;
if (System.Web.HttpContext.Current != null)
item.Save(System.Web.HttpContext.Current.User.Identity.Name);
else
item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
}
/// <summary>
/// Updates a record, can be used with the Object Data Source
/// </summary>
public static void Update(int varIdAgente,string varApellido,string varNombre,int varCodigo,bool varActivo,string varNombreCompleto)
{
RemAgente item = new RemAgente();
item.IdAgente = varIdAgente;
item.Apellido = varApellido;
item.Nombre = varNombre;
item.Codigo = varCodigo;
item.Activo = varActivo;
item.NombreCompleto = varNombreCompleto;
item.IsNew = false;
if (System.Web.HttpContext.Current != null)
item.Save(System.Web.HttpContext.Current.User.Identity.Name);
else
item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
}
#endregion
#region Typed Columns
public static TableSchema.TableColumn IdAgenteColumn
{
get { return Schema.Columns[0]; }
}
public static TableSchema.TableColumn ApellidoColumn
{
get { return Schema.Columns[1]; }
}
public static TableSchema.TableColumn NombreColumn
{
get { return Schema.Columns[2]; }
}
public static TableSchema.TableColumn CodigoColumn
{
get { return Schema.Columns[3]; }
}
public static TableSchema.TableColumn ActivoColumn
{
get { return Schema.Columns[4]; }
}
public static TableSchema.TableColumn NombreCompletoColumn
{
get { return Schema.Columns[5]; }
}
#endregion
#region Columns Struct
public struct Columns
{
public static string IdAgente = @"idAgente";
public static string Apellido = @"apellido";
public static string Nombre = @"nombre";
public static string Codigo = @"codigo";
public static string Activo = @"activo";
public static string NombreCompleto = @"nombreCompleto";
}
#endregion
#region Update PK Collections
public void SetPKValues()
{
if (colRemFormularioRecords != null)
{
foreach (DalSic.RemFormulario item in colRemFormularioRecords)
{
if (item.IdAgente != IdAgente)
{
item.IdAgente = IdAgente;
}
}
}
}
#endregion
#region Deep Save
public void DeepSave()
{
Save();
if (colRemFormularioRecords != null)
{
colRemFormularioRecords.SaveAll();
}
}
#endregion
}
}
| 27.541756 | 134 | 0.62432 | [
"MIT"
] | saludnqn/Empadronamiento | DalSic/generated/RemAgente.cs | 12,862 | C# |
using BaiduPanDownloadWpf.ViewModels;
using System.Windows.Controls;
namespace BaiduPanDownloadWpf.Views
{
/// <summary>
/// Interaction logic for DownloadedPage.xaml
/// </summary>
public partial class DownloadedPage : UserControl
{
public DownloadedPage()
{
InitializeComponent();
}
}
}
| 20.647059 | 53 | 0.643875 | [
"MIT"
] | GoingTime/Accelerider.Windows | BaiduPanDownloadWpf/Views/DownloadedPage.xaml.cs | 353 | C# |
/*
* Copyright 2018 JDCLOUD.COM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Distributed-Cloud-Physical-Server
* 分布式云物理服务器操作相关的接口
*
* OpenAPI spec version: v1
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
using System;
using System.Collections.Generic;
using System.Text;
using JDCloudSDK.Core.Service;
namespace JDCloudSDK.Edcps.Apis
{
/// <summary>
/// 查询分布式云物理服务器名称
/// </summary>
public class DescribeInstanceNameResult : JdcloudResult
{
///<summary>
/// 分布式云物理服务器名称
///</summary>
public string Name{ get; set; }
}
} | 25.711111 | 76 | 0.695765 | [
"Apache-2.0"
] | jdcloud-api/jdcloud-sdk-net | sdk/src/Service/Edcps/Apis/DescribeInstanceNameResult.cs | 1,237 | C# |
namespace DataFlow.EdFi.Models.Types
{
public class MediumOfInstructionType
{
/// <summary>
/// The unique identifier of the resource.
/// </summary>
public string id { get; set; }
/// <summary>
/// Key for MediumOfInstruction
/// </summary>
public int? mediumOfInstructionTypeId { get; set; }
/// <summary>
/// Code for MediumOfInstruction type.
/// </summary>
public string codeValue { get; set; }
/// <summary>
/// The description of the descriptor.
/// </summary>
public string description { get; set; }
/// <summary>
/// A shortened description for the medium of instruction type.
/// </summary>
public string shortDescription { get; set; }
/// <summary>
/// A unique system-generated value that identifies the version of the resource.
/// </summary>
public string _etag { get; set; }
}
}
| 26.605263 | 88 | 0.546983 | [
"Apache-2.0"
] | schoolstacks/dataflow | DataFlow.EdFi/Models/Types/MediumOfInstructionType.cs | 1,011 | C# |
using System;
using UnityEngine;
namespace AirFishLab.ScrollingList.MovementCtrl
{
/// <summary>
/// Control the movement for the unit movement
/// </summary>
/// It is evaluated by the distance movement which moves for the given distance.
/// If the list reaches the end in the linear mode, it will controlled by the
/// bouncing movement which performs a back and forth movement.
public class UnitMovementCtrl : IMovementCtrl
{
/// <summary>
/// The curve for evaluating the unit movement
/// </summary>
private readonly DistanceMovementCurve _unitMovementCurve;
/// <summary>
/// The curve for bouncing the movement when the list reaches the end
/// </summary>
private readonly DistanceMovementCurve _bouncingMovementCurve;
/// <summary>
/// The delta position for the bouncing effect
/// </summary>
private readonly float _bouncingDeltaPos;
/// <summary>
/// The function that returns the distance for aligning
/// </summary>
private readonly Func<float> _getAligningDistance;
/// <summary>
/// The function that returns the state of the list position
/// </summary>
private readonly Func<ListPositionCtrl.PositionState> _getPositionState;
/// <summary>
/// Create a movement control for the unit distance moving
/// </summary>
/// <param name="movementCurve">
/// The curve that defines the distance factor.
/// The x axis is the moving duration, and y axis is the factor value.
/// </param>
/// <param name="bouncingDeltaPos">
/// The delta position for bouncing effect
/// </param>
/// <param name="getAligningDistance">
/// The function that evaluates the distance for aligning
/// </param>
/// <param name="getPositionState">
/// The function that returns the state of the list position
/// </param>
public UnitMovementCtrl(
AnimationCurve movementCurve,
float bouncingDeltaPos,
Func<float> getAligningDistance,
Func<ListPositionCtrl.PositionState> getPositionState)
{
var bouncingCurve = new AnimationCurve(
new Keyframe(0.0f, 0.0f, 0.0f, 5.0f),
new Keyframe(0.125f, 1.0f, 0.0f, 0.0f),
new Keyframe(0.25f, 0.0f, -5.0f, 0.0f));
_unitMovementCurve = new DistanceMovementCurve(movementCurve);
_bouncingMovementCurve = new DistanceMovementCurve(bouncingCurve);
_bouncingDeltaPos = bouncingDeltaPos;
_getAligningDistance = getAligningDistance;
_getPositionState = getPositionState;
}
/// <summary>
/// Set the moving distance for this new movement
/// </summary>
/// If there has the distance left in the last movement,
/// the moving distance will be accumulated.<para/>
/// If the list reaches the end in the linear mode, the moving distance
/// will be ignored and use `_bouncingDeltaPos` for the bouncing movement.
/// <param name="distanceAdded">Set the additional moving distance</param>
/// <param name="flag">No usage</param>
public void SetMovement(float distanceAdded, bool flag)
{
// Ignore any movement when the list is aligning
if (!_bouncingMovementCurve.IsMovementEnded())
return;
var state = _getPositionState();
var movingDirection = Mathf.Sign(distanceAdded);
if ((state == ListPositionCtrl.PositionState.Top && movingDirection < 0) ||
(state == ListPositionCtrl.PositionState.Bottom && movingDirection > 0)) {
_bouncingMovementCurve.SetMovement(movingDirection * _bouncingDeltaPos);
} else {
distanceAdded += _unitMovementCurve.distanceRemaining;
_unitMovementCurve.SetMovement(distanceAdded);
}
}
/// <summary>
/// Set the movement for certain distance
/// for aligning the selected box to the center
/// </summary>
/// <param name="distance">The specified distance</param>
public void SetSelectionMovement(float distance)
{
_unitMovementCurve.SetMovement(distance);
}
/// <summary>
/// Is the movement ended?
/// </summary>
public bool IsMovementEnded()
{
return _bouncingMovementCurve.IsMovementEnded() &&
_unitMovementCurve.IsMovementEnded();
}
/// <summary>
/// Get the moving distance for the next delta time
/// </summary>
/// <param name="deltaTime">The next delta time</param>
/// <returns>The moving distance in this period</returns>
public float GetDistance(float deltaTime)
{
if (!_bouncingMovementCurve.IsMovementEnded()) {
return _bouncingMovementCurve.GetDistance(deltaTime);
}
var distance = _unitMovementCurve.GetDistance(deltaTime);
if (!NeedToAlign(distance))
return distance;
// Make the unit movement end
_unitMovementCurve.EndMovement();
_bouncingMovementCurve.SetMovement(-1 * _getAligningDistance());
// Start at the furthest point to move back
_bouncingMovementCurve.GetDistance(0.125f);
return _bouncingMovementCurve.GetDistance(deltaTime);
}
/// <summary>
/// Check whether it needs to switch to the aligning mode
/// </summary>
/// <param name="deltaDistance">The next delta distance</param>
/// <returns>
/// Return true if the list exceeds the end for a distance or
/// the unit movement is ended.
/// </returns>
private bool NeedToAlign(float deltaDistance)
{
if (_getPositionState() == ListPositionCtrl.PositionState.Middle)
return false;
return
Mathf.Abs(_getAligningDistance() * -1 + deltaDistance)
> _bouncingDeltaPos
|| _unitMovementCurve.IsMovementEnded();
}
}
}
| 39.76875 | 90 | 0.601132 | [
"Apache-2.0"
] | Mighstye/-Tragedies-in-Vacuous-Scroll | Assets/Plugins/CircularScrollingList/Scripts/MovementCtrl/UnitMovementCtrl.cs | 6,365 | C# |
// Licensed under the MIT License.
// Copyright (c) 2018 the AppCore .NET project.
using System;
using AppCore.Diagnostics;
namespace AppCore.EventModel
{
/// <summary>
/// Provides extension methods for the <see cref="IEventContext"/>.
/// </summary>
public static class EventContextExtensions
{
/// <summary>
/// Adds a feature to the <see cref="IEventContext"/>.
/// </summary>
/// <typeparam name="T">The type of the feature.</typeparam>
/// <param name="context">The <see cref="IEventContext"/>.</param>
/// <param name="feature">The feature that should be added.</param>
/// <exception cref="InvalidOperationException">The event context feature is already registered.</exception>
public static void AddFeature<T>(this IEventContext context, T feature)
{
Ensure.Arg.NotNull(context, nameof(context));
Ensure.Arg.NotNull(feature, nameof(feature));
try
{
context.Features.Add(typeof(T), feature);
}
catch (ArgumentException)
{
throw new InvalidOperationException($"Event context feature {typeof(T).GetDisplayName()} already registered.");
}
}
/// <summary>
/// Gets the feature with the specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of the feature.</typeparam>
/// <param name="context">The <see cref="IEventContext"/>.</param>
/// <param name="feature">The feature.</param>
/// <returns><c>true</c> if the feature was found; <c>false</c> otherwise.</returns>
public static bool TryGetFeature<T>(this IEventContext context, out T feature)
{
Ensure.Arg.NotNull(context, nameof(context));
if (context.Features.TryGetValue(typeof(T), out object tmp))
{
feature = (T) tmp;
return true;
}
feature = default;
return false;
}
/// <summary>
/// Gets the feature with the specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of the feature.</typeparam>
/// <param name="context">The <see cref="IEventContext"/>.</param>
/// <returns>The feature.</returns>
/// <exception cref="InvalidOperationException">The event context feature is not available.</exception>
public static T GetFeature<T>(this IEventContext context)
{
if (!TryGetFeature(context, out T feature))
throw new InvalidOperationException($"Event context feature {typeof(T).GetDisplayName()} is not available.");
return feature;
}
/// <summary>
/// Gets a value indicating whether a feature is available.
/// </summary>
/// <typeparam name="T">The type of the feature.</typeparam>
/// <param name="context">The <see cref="IEventContext"/>.</param>
/// <returns><c>true</c> if the feature is available; <c>false</c> otherwise.</returns>
public static bool HasFeature<T>(this IEventContext context)
{
Ensure.Arg.NotNull(context, nameof(context));
return context.Features.ContainsKey(typeof(T));
}
}
}
| 39.705882 | 127 | 0.585481 | [
"MIT"
] | AppCoreNet/Events | src/AppCore.EventModel.Abstractions/EventContextExtensions.cs | 3,377 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DynamicsOdata
{
public static class UriExtensions
{
public static Uri Combine(this Uri uriCurrent, params string[] uriParts)
{
string uri = uriCurrent.ToString();
if (uriParts != null && uriParts.Count() > 0)
{
char[] trims = new char[] { '\\', '/' };
uri = (uri ?? string.Empty).TrimEnd(trims);
for (int i = 0; i < uriParts.Count(); i++)
{
uri = string.Format("{0}/{1}", uri.TrimEnd(trims), (uriParts[i] ?? string.Empty).TrimStart(trims));
}
}
return new Uri( uri);
}
}
}
| 28.535714 | 119 | 0.513141 | [
"MIT"
] | ShadowPic/PublicTestProjects | DynamicsFinOps/FinOpsConfigurationValidation/DynamicsOdata/UriExtensions.cs | 801 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.IO;
using GenArt.AST;
using System.Runtime.Serialization.Formatters.Binary;
namespace GenArt.Classes
{
public static class Serializer
{
//public static void Serialize(Settings settings)
//{
// if (string.IsNullOrEmpty(Application.LocalUserAppDataPath))
// return;
// string fileName = Application.LocalUserAppDataPath + "\\Settings.xml";
// Serialize(settings, fileName);
//}
//public static void Serialize(Settings settings, string fileName)
//{
// if (fileName == null)
// return;
// try
// {
// XmlSerializer serializer = new XmlSerializer(settings.GetType());
// using (FileStream writer = new FileStream(fileName, FileMode.Create))
// {
// serializer.Serialize(writer, settings);
// }
// }
// catch (Exception ex) { ; }
//}
//public static void Serialize(DnaDrawing drawing, string fileName)
//{
// if (fileName == null)
// return;
// if (fileName.EndsWith("xml"))
// {
// try
// {
// XmlSerializer serializer = new XmlSerializer(drawing.GetType());
// using (FileStream writer = new FileStream(fileName, FileMode.Create))
// {
// serializer.Serialize(writer, drawing);
// }
// }
// catch (Exception ex) { ; }
// }
// else
// {
// SerializeBinary(drawing, fileName);
// }
//}
//public static void SerializeBinary(DnaDrawing drawing, string fileName)
//{
// if (fileName == null)
// return;
// try
// {
// BinaryFormatter formatter = new BinaryFormatter();
// using (FileStream writer = new FileStream(fileName, FileMode.Create))
// {
// formatter.Serialize(writer, drawing);
// }
// }
// catch (Exception ex) { ; }
//}
//public static Settings DeserializeSettings()
//{
// if (string.IsNullOrEmpty(Application.LocalUserAppDataPath))
// return null;
// string fileName = Application.LocalUserAppDataPath + "\\Settings.xml";
// return DeserializeSettings(fileName);
//}
//public static Settings DeserializeSettings(string fileName)
//{
// if (!File.Exists(fileName))
// return null;
// try
// {
// XmlSerializer serializer = new XmlSerializer(typeof(Settings));
// using (FileStream reader = new FileStream(fileName, FileMode.Open))
// {
// return (Settings)serializer.Deserialize(reader);
// }
// }
// catch (Exception ex) { ; }
// return null;
//}
//public static DnaDrawing DeserializeDnaDrawing(string fileName)
//{
// if (!File.Exists(fileName))
// return null;
// if (fileName.EndsWith("xml"))
// {
// try
// {
// XmlSerializer serializer = new XmlSerializer(typeof(DnaDrawing));
// using (FileStream reader = new FileStream(fileName, FileMode.Open))
// {
// return (DnaDrawing)serializer.Deserialize(reader);
// }
// }
// catch (Exception ex) { ; }
// return null;
// }
// else
// {
// return DeserializeDnaDrawingBinary(fileName);
// }
//}
//public static DnaDrawing DeserializeDnaDrawingBinary(string fileName)
//{
// if (!File.Exists(fileName))
// return null;
// try
// {
// BinaryFormatter formatter = new BinaryFormatter();
// using (FileStream reader = new FileStream(fileName, FileMode.Open))
// {
// return (DnaDrawing)formatter.Deserialize(reader);
// }
// }
// catch (Exception ex) { ; }
// return null;
//}
}
}
| 31.910345 | 91 | 0.47266 | [
"MIT"
] | matthew-lake/EvoImageCompression | CompressionWPF/CompressionWPF/Serializer.cs | 4,629 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace FlightManager.Services.ServiceModels
{
public class ReservationServiceModel
{
public string Id { get; set; }
public string FirstName { get; set; }
public string SecondName { get; set; }
public string LastName { get; set; }
public string EGN { get; set; }
public string PhoneNumber { get; set; }
public string Nationality { get; set; }
public string TicketType { get; set; }
public string Email { get; set; }
public int TicketsCount { get; set; }
public bool IsConfirmed { get; set; }
public string FlightId { get; set; }
}
}
| 29.708333 | 47 | 0.621318 | [
"MIT"
] | viksuper555/FlightManager | FlightManager.Services/Models/ReservationServiceModel.cs | 715 | C# |
using DFC.App.FindACourse.Data.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace DFC.App.FindACourse.Services
{
public interface ILocationService
{
Task<IEnumerable<SearchLocationIndex>> GetSuggestedLocationsAsync(string term);
}
}
| 23.833333 | 87 | 0.772727 | [
"MIT"
] | SkillsFundingAgency/dfc-app-findacourse | DFC.App.FindACourse.Services/ILocationService.cs | 288 | C# |
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
// can syncronize with others
/// <summary>
/// Fires rockets :)
///
/// By behaviour, it fires all shots at biggest (aproximated) groups of enemies, and then either reloads one or all shots
/// </summary>
public class RocketLauncher : AimingGunBase {
public SpawnerBase rocketTubes;
//CentralizedTargetingWithAproximation
//public ScanRangeTracking tracking; // tracks all targets in scan
//public MaxGroupsFilter targetChoice; // selects targets that are grouped
public bool ready = true;
public float mininumDelayBetweenShots;
public int maxReloadNumber = 1;// how many shots will it reload before shooting again, IF its attacking something
public bool paralelLoading = false; // true: tubes can be all loaded at same time -> instant reload. false: tubes load 1 by 1, allowing starting burst then balanced over time damage of 1 rocket by 1
bool fullClipReload = false;
protected override void OnStart() {
base.OnStart();
}
protected override IEnumerator Fire() {
/*float[] timers = new float[rocketTubes.spawnPoints.Length];
foreach (var timer in timers) {
timer = Time.time;
}*/
Reaim();
rocketTubes.fired = new bool[rocketTubes.spawnPoints.Length];
while (true) {
if (Reaim()){
fire = true;
}else fire = false;
if (fire) {
yield return FireAllShots();
// dont put reloading here, since fire variable can change while shooting
}
int reloadsLeft = 0;
if (fire) {
// partial reload
reloadsLeft = Mathf.Clamp(maxReloadNumber, 0, rocketTubes.clipSize.Length);
for (int i = 0; i < rocketTubes.clipSize.Length; i++) {
if (!rocketTubes.fired[i]) {
reloadsLeft--;
}
}
yield return Reload(reloadsLeft);
} else {
// full reload
reloadsLeft = rocketTubes.clipSize.Length;
for (int i = 0; i < rocketTubes.clipSize.Length; i++) {
if (!rocketTubes.fired[i]) {
reloadsLeft--;
}
}
fullClipReload = true;
}
yield return Reload(reloadsLeft);
if (fullClipReload) {
fullClipReload = false;
}
yield return null;
}
}
private bool Reaim() {
//if (lastUnitCount != allUnits.allShips.Count) {
float explosionRadius = projectile.GetComponent<Rocket>().radius;
Transform targetChosen = UnitsInScene.GetApproximationOfGroupCount(this,explosionRadius * 2f);
if (targetChosen) {
AimAtTarget(targetChosen);// *2 to get less calculations
activeTarget = targetChosen;
}
return activeTarget != null;
//}
}
/// <summary>
/// Reloads up to maximum amount of clips.
///
/// Assumes every tube has only one shot.
/// Tubes are chosen randomly from empty ones
/// </summary>
/// <param name="reloadsLeft"></param>
/// <returns></returns>
private IEnumerator Reload(int reloadsLeft) {
fire = false;
List<int> emptyTubes = new List<int>();
for (int i = 0; i < rocketTubes.clipSize.Length; i++)
{
if (!rocketTubes.fired[i]) {
emptyTubes.Add(i);
}
}
while (reloadsLeft > 0) {
yield return new WaitForSeconds(rocketTubes.clipReloadTime);
int reloadtube = Random.Range(0, rocketTubes.clipSize.Length);
rocketTubes.fired[reloadtube] = false;
emptyTubes.Remove(reloadtube);
reloadsLeft -= 1;
// starting fire in middle of reloading will immediatly begin firing(useful to stop full clip reload if new enemy enters)
// comment these 2 lines so full clip reload cant be stopped
if (fire && fullClipReload) {
break;
}
}
fire = true;
}
private IEnumerator FireAllShots() {
for (int i = 0; i < rocketTubes.clipSize.Length; i++) {
if (!fire) {
break;
}
int clipsLeft = rocketTubes.clipSize[i];
if (clipsLeft > 0) {
FireBullet(rocketTubes.spawnPoints[i]);
rocketTubes.fired[i] = true;
yield return ResumeFire(mininumDelayBetweenShots);
Reaim();
}
}
}
}
| 31.919463 | 203 | 0.558452 | [
"MIT"
] | Laharnar/MothershipBulletHell | Assets/Motherships/Scripts/Turrets/RocketLauncher.cs | 4,758 | C# |
using AoC2020.Days;
using Moq;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Utilities;
namespace AoC2020.UnitTests.DayTests;
internal class Day6Tests
{
[Test]
public async Task TestDay6Part1()
{
var inputMock = PrepareInput();
var objUnderTest = new Day6(inputMock.Object);
Assert.That(await objUnderTest.Part1(), Is.EqualTo(11));
}
[Test]
public async Task TestDay6Part2()
{
var inputMock = PrepareInput();
var objUnderTest = new Day6(inputMock.Object);
Assert.That(await objUnderTest.Part2(), Is.EqualTo(6));
}
private static Mock<InputFetcher> PrepareInput()
{
var inputMock = new Mock<InputFetcher> { CallBase = true };
inputMock.Setup(m => m.FetchInputAsString(It.IsAny<int>())).Returns(Task.FromResult(@"abc
a
b
c
ab
ac
a
a
a
a
b"));
return inputMock;
}
}
| 18.98 | 97 | 0.660695 | [
"MIT"
] | CeesKaas/AdventofCode | 2020/AoC2020.UnitTests/DayTests/Day6Tests.cs | 951 | C# |
using System;
using Xilium.CefGlue.Helpers.Log;
namespace Xilium.CefGlue.WPF
{
internal sealed class WpfCefClient : CefClient
{
private WpfCefBrowser _owner;
private WpfCefLifeSpanHandler _lifeSpanHandler;
private WpfCefDisplayHandler _displayHandler;
private WpfCefRenderHandler _renderHandler;
private WpfCefLoadHandler _loadHandler;
private WpfCefJSDialogHandler _jsDialogHandler;
public WpfCefClient(WpfCefBrowser owner)
{
if (owner == null) throw new ArgumentNullException("owner");
_owner = owner;
_lifeSpanHandler = new WpfCefLifeSpanHandler(owner);
_displayHandler = new WpfCefDisplayHandler(owner);
_renderHandler = new WpfCefRenderHandler(owner, new ILogger(), new UiHelper(new ILogger()));
_loadHandler = new WpfCefLoadHandler(owner);
_jsDialogHandler = new WpfCefJSDialogHandler();
}
protected override CefLifeSpanHandler GetLifeSpanHandler()
{
return _lifeSpanHandler;
}
protected override CefDisplayHandler GetDisplayHandler()
{
return _displayHandler;
}
protected override CefRenderHandler GetRenderHandler()
{
return _renderHandler;
}
protected override CefLoadHandler GetLoadHandler()
{
return _loadHandler;
}
protected override CefJSDialogHandler GetJSDialogHandler()
{
return _jsDialogHandler;
}
}
}
| 28.690909 | 104 | 0.645754 | [
"BSD-3-Clause"
] | RoddoWasHere/Chrome.Net | CefGlue.WPF/WpfCefClient.cs | 1,580 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Gmod_Dupe_Downloader.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| 39.814815 | 151 | 0.585116 | [
"MIT"
] | Radfordhound/GMod-Dupe-Downloader | Gmod Dupe Downloader/Properties/Settings.Designer.cs | 1,077 | C# |
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Horizon.Payment.Alipay.Domain;
namespace Horizon.Payment.Alipay.Response
{
/// <summary>
/// AlipayInsMarketingCampaignDecisionResponse.
/// </summary>
public class AlipayInsMarketingCampaignDecisionResponse : AlipayResponse
{
/// <summary>
/// 保险营销标的关联的活动列表
/// </summary>
[JsonPropertyName("mkt_campaigns")]
public List<InsMktCampaignDTO> MktCampaigns { get; set; }
}
}
| 27.157895 | 76 | 0.684109 | [
"Apache-2.0"
] | bluexray/Horizon.Sample | Horizon.Payment.Alipay/Response/AlipayInsMarketingCampaignDecisionResponse.cs | 544 | C# |
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Reflection;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
/// <summary>
/// Basic scene object tests (create, read and delete but not update).
/// </summary>
[TestFixture]
public class SceneObjectBasicTests
{
/// <summary>
/// Test adding an object to a scene.
/// </summary>
[Test]
public void TestAddSceneObject()
{
TestHelper.InMethod();
Scene scene = SceneSetupHelpers.SetupScene();
string objName = "obj1";
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
SceneObjectPart part
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = objName, UUID = objUuid };
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part), false), Is.True);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
//m_log.Debug("retrievedPart : {0}", retrievedPart);
// If the parts have the same UUID then we will consider them as one and the same
Assert.That(retrievedPart.Name, Is.EqualTo(objName));
Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid));
}
[Test]
/// <summary>
/// It shouldn't be possible to add a scene object if one with that uuid already exists in the scene.
/// </summary>
public void TestAddExistingSceneObjectUuid()
{
TestHelper.InMethod();
Scene scene = SceneSetupHelpers.SetupScene();
string obj1Name = "Alfred";
string obj2Name = "Betty";
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
SceneObjectPart part1
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = obj1Name, UUID = objUuid };
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
SceneObjectPart part2
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = obj2Name, UUID = objUuid };
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
//m_log.Debug("retrievedPart : {0}", retrievedPart);
// If the parts have the same UUID then we will consider them as one and the same
Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name));
Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid));
}
/// <summary>
/// Test deleting an object from a scene.
/// </summary>
[Test]
public void TestDeleteSceneObject()
{
TestHelper.InMethod();
TestScene scene = SceneSetupHelpers.SetupScene();
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
scene.DeleteSceneObject(part.ParentGroup, false);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Null);
}
/// <summary>
/// Test deleting an object asynchronously
/// </summary>
[Test]
public void TestDeleteSceneObjectAsync()
{
TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
TestScene scene = SceneSetupHelpers.SetupScene();
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
sogd.Enabled = false;
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Not.Null);
sogd.InventoryDeQueueAndDelete();
SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart2, Is.Null);
}
/// <summary>
/// Test deleting an object asynchronously to user inventory.
/// </summary>
//[Test]
//public void TestDeleteSceneObjectAsyncToUserInventory()
//{
// TestHelper.InMethod();
// //log4net.Config.XmlConfigurator.Configure();
// UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
// string myObjectName = "Fred";
// TestScene scene = SceneSetupHelpers.SetupScene();
// SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName);
// Assert.That(
// scene.CommsManager.UserAdminService.AddUser(
// "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId),
// Is.EqualTo(agentId));
// IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
// CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId);
// Assert.That(userInfo, Is.Not.Null);
// Assert.That(userInfo.RootFolder, Is.Not.Null);
// SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client);
// // Check that we now have the taken part in our inventory
// Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name));
// // Check that the taken part has actually disappeared
// SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
// Assert.That(retrievedPart, Is.Null);
//}
/// <summary>
/// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not
/// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by
/// OpenSim.
/// </summary>
[Test]
public void TestChangeSceneObjectUuid()
{
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
string childPartName = "childPart";
UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000");
SceneObjectPart rootPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = rootPartName, UUID = rootPartUuid };
SceneObjectPart linkPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = childPartName, UUID = childPartUuid };
SceneObjectGroup sog = new SceneObjectGroup(rootPart);
sog.AddPart(linkPart);
Assert.That(sog.UUID, Is.EqualTo(rootPartUuid));
Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid));
Assert.That(sog.Parts.Length, Is.EqualTo(2));
UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002");
sog.UUID = newRootPartUuid;
Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid));
Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid));
Assert.That(sog.Parts.Length, Is.EqualTo(2));
}
}
}
| 44.401747 | 143 | 0.630803 | [
"BSD-3-Clause"
] | N3X15/VoxelSim | OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 10,168 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.