protected Resource(Resource original, Cloner cloner) : base(original, cloner) { this.Name = original.Name; this.Description = original.Description; }
private bool IsAuthorized(Resource resource) { return resource != null && resource.Name != UngroupedGroupName && resource.Id != Guid.Empty && UserInformation.Instance.UserExists && (resource.OwnerUserId == UserInformation.Instance.User.Id || HiveRoles.CheckAdminUserPermissions()); }
private void UpdateChildHbIntervall(Resource resource) { foreach (Resource r in Content.Where(x => x.ParentResourceId == resource.Id)) { r.HbInterval = resource.HbInterval; if (r is SlaveGroup) { UpdateChildHbIntervall(r); } } }
private void BuildSlaveGroupTree(Resource g, TreeNode tn) { foreach (Resource r in Content.Where(s => s.ParentResourceId != null && s.ParentResourceId == g.Id)) { TreeNode stn = new TreeNode(r.Name); if (r is Slave) { stn.ImageIndex = slaveImageIndex; } else if (r is SlaveGroup) { stn.ImageIndex = slaveGroupImageIndex; } stn.SelectedImageIndex = stn.ImageIndex; stn.Tag = r; if (r.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor; tn.Nodes.Add(stn); BuildSlaveGroupTree(r, stn); } }