/// <summary> /// Creates hyperlink representation of the editable parameters within the condition /// </summary> /// <returns>An array of RuleObject objects representing the editable parameters</returns> protected override RuleObject[] GetHyperlinks() { try { IDataElement hiddenDataDataElement = null; if (m_condition != null) { IDataSource dataSource = m_condition.DataLeft.Data as IDataSource; hiddenDataDataElement = dataSource.Method.Parameters[3].Value; } List<ConditionUnitFactory.FileHiddenDataType> enumHiddenTypes = null; List<Policy.FileType> types = GetFileTypes(); if (null != types) enumHiddenTypes = FileTypeToHiddenDataMapper.GetHiddenDataForFileType(types); m_hiddenDataTypeData = new ConditionDisplayParameterHiddenData(hiddenDataDataElement, this.EditHiddenDataParameter, enumHiddenTypes, m_type); RuleObject[] hyperlinks = { m_hiddenDataTypeData }; return hyperlinks; } catch (Exception ex) { Utilities.ErrorMessage errorMessage = new Utilities.ErrorMessage( "CONDITION_HIDDENDATA_INVALID", "Workshare.PolicyDesigner.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly(), ex.Message); Logger.LogError(errorMessage.LogString); throw new ArgumentException(errorMessage.DisplayString, ex); } }
/// <summary> /// Creates hyperlink representation of the editable parameters within the condition /// </summary> /// <returns>An array of RuleObject objects representing the editable parameters</returns> protected virtual RuleObject[] GetHyperlinks() { try { IDataElement fileTypeDataElement = null; IDataElement hiddenDataDataElement = null; if (m_condition != null) { IDataSource dataSource = m_condition.DataLeft.Data as IDataSource; fileTypeDataElement = dataSource.Method.Parameters[1].Value; hiddenDataDataElement = dataSource.Method.Parameters[3].Value; //ignore file parameter (dataSource.Method.Parameters[0].Value) as not editable //ignore content parameter (dataSource.Method.Parameters[2].Value) as not editable } //work out what file types have hidden data Array enumTypes = Enum.GetValues(typeof(Policy.FileType)); List<Policy.FileType> availableFileTypes = new List<Policy.FileType>(); foreach (Policy.FileType type in enumTypes) { if (type != Policy.FileType.PDFDocument) // We have a PDF Hidden Data condition { if (FileTypeToHiddenDataMapper.FileTypeHasHiddenData(type)) { availableFileTypes.Add(type); } } } m_fileTypeData = new ConditionDisplayParameterFileType(fileTypeDataElement, this.EditFileTypeParameter, availableFileTypes, m_type); List<ConditionUnitFactory.FileHiddenDataType> enumHiddenTypes = null; List<Policy.FileType> types = GetFileTypes(); if (null != types) enumHiddenTypes = FileTypeToHiddenDataMapper.GetHiddenDataForFileType(types); m_hiddenDataTypeData = new ConditionDisplayParameterHiddenData(hiddenDataDataElement, this.EditHiddenDataParameter, enumHiddenTypes, m_type); RuleObject[] hyperlinks = { m_fileTypeData, m_hiddenDataTypeData }; return hyperlinks; } catch (Exception ex) { Utilities.ErrorMessage errorMessage = new Utilities.ErrorMessage( "CONDITION_HIDDENDATA_INVALID", "Workshare.PolicyDesigner.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly(), ex.Message); Logger.LogError(errorMessage.LogString); throw new ArgumentException(errorMessage.DisplayString, ex); } }