Example #1
0
		private void DeleteFromRule( NoBoldNode childNode )
		{
			Policy parentNode = (Policy)mainTree.SelectedNode.Parent;
			if( childNode is Rule )
			{
				parentNode.PolicyDefinition.Rules.RemoveAt( childNode.Index - 1 );
			}
			else if( childNode is Obligations )
			{
				parentNode.PolicyDefinition.Obligations = null;
			}
			else if( childNode is Target )
			{
				parentNode.PolicyDefinition.Target = null;
			}
		}
Example #2
0
		private void DeleteFromPolicy( NoBoldNode childNode )
		{
			Policy parentNode = (Policy)mainTree.SelectedNode.Parent;
			if( childNode is Rule )
			{
				pol.RuleElementReadWrite rule = ((Rule)childNode).RuleDefinition;
				int index = parentNode.PolicyDefinition.Rules.GetIndex( rule );
				parentNode.PolicyDefinition.Rules.RemoveAt( index );
			}
			else if( childNode is Obligations )
			{
				parentNode.PolicyDefinition.Obligations = null;
			}
			else if( childNode is Target )
			{
				parentNode.PolicyDefinition.Target = null;
			}
		}
Example #3
0
		private void DeleteContextAttribute( NoBoldNode parentNode )
		{
			Attribute attributeNode = (Attribute)mainTree.SelectedNode;
			con.AttributeElementReadWrite attribute = attributeNode.AttributeDefinition;

			if( parentNode is ContextTreeNodes.Action )
			{
				con.ActionElementReadWrite action = ((ContextTreeNodes.Action)parentNode).ActionDefinition;

				int index = action.Attributes.GetIndex( attribute );
				action.Attributes.RemoveAt( index );
			}
			else if( parentNode is Resource )
			{
				con.ResourceElementReadWrite resource = ((Resource)parentNode).ResourceDefinition;

				int index = resource.Attributes.GetIndex( attribute );
				resource.Attributes.RemoveAt( index );
			}
			else if( parentNode is Subject )
			{
				con.SubjectElementReadWrite subject = ((Subject)parentNode).SubjectDefinition;

				int index = subject.Attributes.GetIndex( attribute );
				subject.Attributes.RemoveAt( index );
			}
		}
Example #4
0
		private void DeleteFromPolicySet( NoBoldNode childNode )
		{
			PolicySet parentNode = (PolicySet)mainTree.SelectedNode.Parent;
			if( childNode is Policy )
			{
				Policy policyNode = (Policy)childNode;
				parentNode.PolicySetDefinition.Policies.Remove( policyNode.PolicyDefinition );
			}
			else if( childNode is PolicySet )
			{
				PolicySet policySetNode = (PolicySet)childNode;
				parentNode.PolicySetDefinition.Policies.Remove( policySetNode.PolicySetDefinition );
			}
			else if( childNode is Obligations )
			{
				parentNode.PolicySetDefinition.Obligations = null;
			}
			else if( childNode is Target )
			{
				parentNode.PolicySetDefinition.Target = null;
			}
		}
Example #5
0
		private void DeleteFromRequest( NoBoldNode childNode )
		{
			Request parentNode = (Request)mainTree.SelectedNode.Parent;
			if( childNode is ContextTreeNodes.Action )
			{
				parentNode.RequestDefinition.Action = null;
			}
			else if( childNode is Resource )
			{
				con.ResourceElementReadWrite resource = ((Resource)childNode).ResourceDefinition;
                				
				int index = parentNode.RequestDefinition.Resources.GetIndex( resource );
				parentNode.RequestDefinition.Resources.RemoveAt( index );
			}
			else if( childNode is Subject )
			{
				con.SubjectElementReadWrite subject = ((Subject)childNode).SubjectDefinition;
                				
				int index = parentNode.RequestDefinition.Subjects.GetIndex( subject );
				parentNode.RequestDefinition.Subjects.RemoveAt( index );
			}
		}