本文整理汇总了C#中GroupType类的典型用法代码示例。如果您正苦于以下问题:C# GroupType类的具体用法?C# GroupType怎么用?C# GroupType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GroupType类属于命名空间,在下文中一共展示了GroupType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Group
public Group(Group parent)
{
Parent = parent;
Members = new ArrayList();
this.GroupType = GroupType.None;
Occurrence = Occurrence.Required;
}
示例2: AddConnector
public void AddConnector(char c)
{
if (!Mixed && Members.Count == 0)
{
throw new Exception(
String.Format("Missing token before connector '{0}'.", c)
);
}
GroupType gt = GroupType.None;
switch (c)
{
case ',':
gt = GroupType.Sequence;
break;
case '|':
gt = GroupType.Or;
break;
case '&':
gt = GroupType.And;
break;
}
if (GroupType != GroupType.None && GroupType != gt)
{
throw new Exception(
String.Format("Connector '{0}' is inconsistent with {1} group.", c, GroupType.ToString())
);
}
GroupType = gt;
}
示例3: Group
/// <summary>
/// Initializes a new Content Model Group.
/// </summary>
/// <param name="parent">The parent model group.</param>
public Group(Group parent)
{
_parent = parent;
_members = new ArrayList();
_type = GroupType.None;
_occurrence = Occurrence.Required;
}
示例4: Group
/// <summary>
/// Initialises a new Content Model Group.
/// </summary>
/// <param name = "parent">The parent model group.</param>
public Group(Group parent)
{
m_parent = parent;
Members = new ArrayList();
m_groupType = GroupType.None;
m_occurrence = Occurrence.Required;
}
示例5: Group
public Group(GroupType grpType,string grpName)
{
id = 0;
type = grpType;
name = grpName;
rights = "";
}
示例6: Group
public Group(int Id, string Name, string Description, string Badge, int RoomId, int Owner, int Time, int Type, int Colour1, int Colour2, int AdminOnlyDeco)
{
this.Id = Id;
this.Name = Name;
this.Description = Description;
this.RoomId = RoomId;
this.Badge = Badge;
this.CreateTime = Time;
this.CreatorId = Owner;
this.Colour1 = (Colour1 == 0) ? 1 : Colour1;
this.Colour2 = (Colour2 == 0) ? 1 : Colour2;
switch (Type)
{
case 0:
this.GroupType = GroupType.OPEN;
break;
case 1:
this.GroupType = GroupType.LOCKED;
break;
case 2:
this.GroupType = GroupType.PRIVATE;
break;
}
this.AdminOnlyDeco = AdminOnlyDeco;
this.ForumEnabled = ForumEnabled;
this._members = new List<int>();
this._requests = new List<int>();
this._administrators = new List<int>();
InitMembers();
}
示例7: ShowDetail
/// <summary>
/// Shows the detail.
/// </summary>
/// <param name="groupTypeId">The groupType identifier.</param>
public void ShowDetail( int groupTypeId )
{
pnlDetails.Visible = false;
bool editAllowed = true;
GroupType groupType = null;
if ( !groupTypeId.Equals( 0 ) )
{
groupType = new GroupTypeService( new RockContext() ).Get( groupTypeId );
pdAuditDetails.SetEntity( groupType, ResolveRockUrl( "~" ) );
}
if ( groupType == null )
{
groupType = new GroupType { Id = 0 };
// hide the panel drawer that show created and last modified dates
pdAuditDetails.Visible = false;
}
if ( groupType != null )
{
editAllowed = groupType.IsAuthorized( Authorization.EDIT, CurrentPerson );
pnlDetails.Visible = true;
hfGroupTypeId.Value = groupType.Id.ToString();
// render UI based on Authorized and IsSystem
bool readOnly = false;
nbEditModeMessage.Text = string.Empty;
if ( !editAllowed || !IsUserAuthorized( Authorization.EDIT ) )
{
readOnly = true;
nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed( GroupType.FriendlyTypeName );
}
if ( readOnly )
{
btnEdit.Visible = false;
btnDelete.Visible = false;
ShowReadonlyDetails( groupType );
}
else
{
btnEdit.Visible = true;
btnDelete.Visible = true;
if ( groupType.Id > 0 )
{
ShowReadonlyDetails( groupType );
}
else
{
ShowEditDetails( groupType );
}
}
}
}
示例8: GetGroup
// -------------------------------------------------------------------- Get
public GroupEntity GetGroup(string userName, string groupSlug, GroupType groupType)
{
using (var db = new CollectionDbContext())
{
// return all contacts across all groups since groupSlug is empty
if (groupSlug.IsNullOrEmpty())
{
// TODO paging
// get all items across all groups
var itemEnts = (from g in db.GroupEntities
from i in g.ItemEntities
where g.UserName.Equals(userName, StringComparison.InvariantCultureIgnoreCase) &&
g.Id == i.GroupId &&
g.GroupType == groupType
select i ).ToList();
if (itemEnts == null) return null;
var groupEnt = new GroupEntity();
foreach (var item in itemEnts)
{
if (!groupEnt.ItemEntities.Any(i=>i.ItemId == item.ItemId)) // filter out existing for "all" group
groupEnt.ItemEntities.Add(item);
}
groupEnt.UserName = userName;
return groupEnt;
}
// return contacts for a specific group
return db.GroupEntities.Include(g => g.ItemEntities)
.FirstOrDefault(g => g.UserName.Equals(userName, StringComparison.InvariantCultureIgnoreCase)
&& g.Slug.Equals(groupSlug, StringComparison.InvariantCultureIgnoreCase)
&& g.GroupType == groupType);
}
}
示例9: GroupMatcher
public GroupMatcher(Person pers, GroupType gt, List<DayOfWeek> days)
{
person = pers;
personLocation = pers.GetHomeLocation();
daysOfWeek = days;
groupType = gt;
}
示例10: DeleteGroupType
public void DeleteGroupType(GroupType groupType)
{
using (SPKTDataContext dc = conn.GetContext())
{
dc.GroupTypes.DeleteOnSubmit(groupType);
dc.SubmitChanges();
}
}
示例11: GroupTypeToIconTag
internal static string GroupTypeToIconTag(GroupType type)
{
return type == GroupType.Equal ? ".#picture"
: type == GroupType.Offsetted ? ".#pictures"
: type == GroupType.Different ? ".#images"
: type == GroupType.Unverified ? ".#images_question"
: ".#puzzle";
}
示例12: Group
/// <summary>
/// Constructs a Group.
/// <param name="type">The group construction.</param>
/// <param name="q">The value q.</param>
/// <param name="groupName">The group name.</param>
/// </summary>
protected Group(GroupType type, byte[] q, string groupName)
{
if (q== null) throw new ArgumentNullException("q");
Type = type;
Q = q;
GroupName = groupName;
}
示例13: GroupTypeToDescription
internal static string GroupTypeToDescription(GroupType type)
{
return type == GroupType.Equal ? "Identical clones"
: type == GroupType.Offsetted ? "Offsetted clones"
: type == GroupType.Different ? "Mismatching clones"
: type == GroupType.Unverified ? "Not yet verified clones"
: "Unique";
}
示例14: GetGroupList
public List<GroupEntity> GetGroupList(string userName, GroupType groupType)
{
using (var db = new CollectionDbContext())
{
var groupEnts = db.GroupEntities.Include(g => g.ItemEntities)
.Where(g => g.UserName.Equals(userName, StringComparison.InvariantCultureIgnoreCase)
&& g.GroupType == groupType);
return (groupEnts == null) ? null : groupEnts.ToList();
}
}
示例15: GroupTypeToString
public static string GroupTypeToString(GroupType type)
{
string result;
if (type == GroupType.Private)
{
result = "Частна";
}
else
{
result = "Публична";
}
return result;
}