本文整理汇总了C#中AccessType类的典型用法代码示例。如果您正苦于以下问题:C# AccessType类的具体用法?C# AccessType怎么用?C# AccessType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccessType类属于命名空间,在下文中一共展示了AccessType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: User
public User(string name, string password, AccessType accessType, List<Directory> directories)
{
Name = name;
Password = password;
AccessType = accessType;
Directories = directories;
}
示例2: ProductDefectionsVM
public ProductDefectionsVM(ProductVM product, AccessType access):base(access)
{
UnitOfWork = new SoheilEdmContext();
CurrentProduct = product;
ProductDataService = new ProductDataService(UnitOfWork);
ProductDataService.DefectionAdded += OnDefectionAdded;
ProductDataService.DefectionRemoved += OnDefectionRemoved;
DefectionDataService = new DefectionDataService(UnitOfWork);
ProductDefectionDataService = new ProductDefectionDataService(UnitOfWork);
var selectedVms = new ObservableCollection<ProductDefectionVM>();
foreach (var productDefection in ProductDataService.GetDefections(product.Id))
{
selectedVms.Add(new ProductDefectionVM(productDefection, Access, ProductDefectionDataService, RelationDirection.Straight));
}
SelectedItems = new ListCollectionView(selectedVms);
var allVms = new ObservableCollection<DefectionVM>();
foreach (var defection in DefectionDataService.GetActives(SoheilEntityType.Products, CurrentProduct.Id))
{
allVms.Add(new DefectionVM(defection, Access, DefectionDataService));
}
AllItems = new ListCollectionView(allVms);
IncludeCommand = new Command(Include, CanInclude);
ExcludeCommand = new Command(Exclude, CanExclude);
IncludeRangeCommand = new Command(IncludeRange, CanIncludeRange);
ExcludeRangeCommand = new Command(ExcludeRange, CanExcludeRange);
}
示例3: LockEvent
internal LockEvent(LockEventType eventType, IEnumerable<ObjectName> references, LockingMode mode, AccessType accessType)
{
EventType = eventType;
References = references;
Mode = mode;
AccessType = accessType;
}
示例4: AccessRulePositionsVM
public AccessRulePositionsVM(AccessRuleVM accessRule, AccessType access)
: base(access)
{
UnitOfWork = new SoheilEdmContext();
CurrentAccessRule = accessRule;
AccessRuleDataService = new AccessRuleDataService(UnitOfWork);
AccessRuleDataService.PositionAdded += OnPositionAdded;
AccessRuleDataService.PositionRemoved += OnPositionRemoved;
PositionDataService = new PositionDataService(UnitOfWork);
var selectedVms = new ObservableCollection<PositionAccessRuleVM>();
foreach (var accessRulePosition in AccessRuleDataService.GetPositions(accessRule.Id))
{
selectedVms.Add(new PositionAccessRuleVM(accessRulePosition, Access, RelationDirection.Reverse));
}
SelectedItems = new ListCollectionView(selectedVms);
var allVms = new ObservableCollection<PositionVM>();
foreach (var position in PositionDataService.GetActives())
{
allVms.Add(new PositionVM(position, Access,PositionDataService));
}
AllItems = new ListCollectionView(allVms);
IncludeCommand = new Command(Include,CanInclude);
ExcludeCommand = new Command(Exclude,CanExclude);
}
示例5: ActivityOperatorsVM
public ActivityOperatorsVM(ActivityVM activity, AccessType access)
: base(access)
{
UnitOfWork = new SoheilEdmContext();
CurrentActivity = activity;
ActivityDataService = new ActivityDataService(UnitOfWork);
ActivityDataService.OperatorAdded += OnOperatorAdded;
ActivityDataService.OperatorRemoved += OnOperatorRemoved;
OperatorDataService = new OperatorDataService(UnitOfWork);
ActivityOperatorDataService = new ActivitySkillDataService(UnitOfWork);
var selectedVms = new ObservableCollection<ActivityOperatorVM>();
foreach (var activityOperator in ActivityDataService.GetOperators(activity.Id))
{
selectedVms.Add(new ActivityOperatorVM(activityOperator, Access, ActivityOperatorDataService, RelationDirection.Straight));
}
SelectedItems = new ListCollectionView(selectedVms);
var allVms = new ObservableCollection<OperatorVM>();
foreach (var opr in OperatorDataService.GetActives(SoheilEntityType.Activities, CurrentActivity.Id))
{
allVms.Add(new OperatorVM(opr, Access, OperatorDataService));
}
AllItems = new ListCollectionView(allVms);
IncludeCommand = new Command(Include, CanInclude);
ExcludeCommand = new Command(Exclude, CanExclude);
}
示例6: Token
private Token(string username, string profileImg, AccessType accessType, DateTimeOffset expiration)
{
UserName = username;
ProfilePath = profileImg;
AccessLevel = accessType;
ExpireTime = expiration;
}
示例7: GetAccessCost
public float GetAccessCost(AccessType accessMethod)
{
AccessCost ac = AccessCosts.Find(p => FlagsHelper.IsSet(p.Type,accessMethod));
if (ac != null)
return ac.Cost;
else return Mathf.Infinity;
}
示例8: Access
public Access(Organization organization, Geography geography, AccessAspect aspect, AccessType type)
{
this.Organization = organization;
this.Geography = geography;
this.Aspect = aspect;
this.Type = type;
}
示例9: PositionOrganizationChartsVM
public PositionOrganizationChartsVM(PositionVM position, AccessType access)
: base(access)
{
UnitOfWork = new SoheilEdmContext();
CurrentPosition = position;
PositionDataService = new PositionDataService(UnitOfWork);
PositionDataService.OrganizationChartAdded += OnOrganizationChartAdded;
PositionDataService.OrganizationChartRemoved += OnOrganizationChartRemoved;
OrganizationChartDataService = new OrganizationChartDataService(UnitOfWork);
OrganizationChartPositionDataService = new OrganizationChartPositionDataService(UnitOfWork);
var selectedVms = new ObservableCollection<OrganizationChartPositionVM>();
foreach (var positionOrganizationChart in PositionDataService.GetOrganizationCharts(position.Id))
{
selectedVms.Add(new OrganizationChartPositionVM(positionOrganizationChart, Access, OrganizationChartPositionDataService));
}
SelectedItems = new ListCollectionView(selectedVms);
var allVms = new ObservableCollection<OrganizationChartVM>();
foreach (var organizationChart in OrganizationChartDataService.GetActives())
{
allVms.Add(new OrganizationChartVM(organizationChart, Access, OrganizationChartDataService));
}
AllItems = new ListCollectionView(allVms);
IncludeCommand = new Command(Include, CanInclude);
ExcludeCommand = new Command(Exclude, CanExclude);
}
示例10: AuthorizationException
public AuthorizationException(string message, Type entityType, AccessType accessType, bool isRecordLevel,
UserRecordPermission grantedPermissions, SecureSession session = null)
: base(message)
{
EntityType = entityType;
AccessType = accessType;
IsRecordLevel = isRecordLevel;
GrantedPermissions = grantedPermissions;
if (session != null) {
RequireReadMode = session.DemandReadAccessLevel;
CurrentDenyReadMode = session.DenyReadAction;
var ctx = session.Context;
UserName = ctx.User.UserName;
UserContextValues = string.Join(string.Empty, ctx.Values.Select(kv => StringHelper.SafeFormat(" [{0}]={1}\r\n", kv.Key, kv.Value)));
var user = ctx.User;
if (user.Authority == null) {
UserRoles = "(UserContext.Authority is not set)";
} else {
UserRoles = user.Authority.GetRoleNames();
PermissionSummary = user.Authority.GetPermissionsSummary(EntityType);
var enDynGrants = user.Authority.DynamicGrants.Where(g => g.IsEnabled(session.Context));
EnabledDynamicGrants = string.Join(",", enDynGrants.Select(g => g.Activity.Name));
}
}
}
示例11: DefectionProductsVM
public DefectionProductsVM(DefectionVM defection, AccessType access)
: base(access)
{
UnitOfWork = new SoheilEdmContext();
CurrentDefection = defection;
DefectionDataService = new DefectionDataService(UnitOfWork);
DefectionDataService.ProductAdded += OnProductAdded;
DefectionDataService.ProductRemoved += OnProductRemoved;
ProductDataService = new ProductDataService(UnitOfWork);
ProductGroupDataService = new ProductGroupDataService(UnitOfWork);
ProductDefectionDataService = new ProductDefectionDataService(UnitOfWork);
var selectedVms = new ObservableCollection<ProductDefectionVM>();
foreach (var productDefection in DefectionDataService.GetProducts(defection.Id))
{
selectedVms.Add(new ProductDefectionVM(productDefection, Access, ProductDefectionDataService, RelationDirection.Reverse));
}
SelectedItems = new ListCollectionView(selectedVms);
var allVms = new ObservableCollection<ProductVM>();
foreach (var product in ProductDataService.GetActives(SoheilEntityType.Defections, CurrentDefection.Id))
{
allVms.Add(new ProductVM(product, Access, ProductDataService, ProductGroupDataService));
}
AllItems = new ListCollectionView(allVms);
IncludeCommand = new Command(Include, CanInclude);
ExcludeCommand = new Command(Exclude, CanExclude);
}
示例12: WorkProfileVm
/// <summary>
/// Initializes a new instance of the <see cref="WorkProfileVm"/> class from the model.
/// </summary>
/// <param name="entity">The model.</param>
/// <param name="access"></param>
/// <param name="dataService"></param>
public WorkProfileVm(WorkProfile entity, AccessType access)
: base(access)
{
IsReadonly = (access < AccessType.Update);
_model = entity;
InitializeData();
}
示例13: AccessRuleUsersVM
public AccessRuleUsersVM(AccessRuleVM accessRule, AccessType access)
: base(access)
{
UnitOfWork = new SoheilEdmContext();
CurrentAccessRule = accessRule;
AccessRuleDataService = new AccessRuleDataService(UnitOfWork);
AccessRuleDataService.UserAdded += OnUserAdded;
AccessRuleDataService.UserRemoved += OnUserRemoved;
UserDataService = new UserDataService(UnitOfWork);
var selectedVms = new ObservableCollection<UserAccessRuleVM>();
foreach (var accessRuleUser in AccessRuleDataService.GetUsers(accessRule.Id))
{
selectedVms.Add(new UserAccessRuleVM(accessRuleUser, Access, RelationDirection.Reverse));
}
SelectedItems = new ListCollectionView(selectedVms);
var allVms = new ObservableCollection<UserVM>();
foreach (var user in UserDataService.GetActives())
{
allVms.Add(new UserVM(user, Access, UserDataService));
}
AllItems = new ListCollectionView(allVms);
IncludeCommand = new Command(Include,CanInclude);
ExcludeCommand = new Command(Exclude, CanExclude);
}
示例14: LockTimeoutException
internal LockTimeoutException(ObjectName tableName, AccessType accessType, int timeout)
: base(SystemErrorCodes.LockTimeout, FormatMessage(tableName, accessType, timeout))
{
TableName = tableName;
AccessType = accessType;
Timeout = timeout;
}
示例15: EntityGroupPermission
bool _initialized; //to avoid multiple initializations
#endregion Fields
#region Constructors
public EntityGroupPermission(string name, AccessType accessType, params EntityGroupResource[] groupResources)
: base(name)
{
AccessType = accessType;
if (groupResources != null)
Add(groupResources);
}