示例#1
0
        public static void AddSupportedFileCollection(XmlNode actionClassNode, string capabilitiesOrSettings, ISupportedFilesSet supportedFileCollection)
        {
            XmlDocument xmlDocument = actionClassNode.OwnerDocument;
            XmlNode supportedFileTypesNode = xmlDocument.CreateElement(capabilitiesOrSettings);

            XmlNode includedFiles = xmlDocument.CreateElement("Included");
            XmlNode excludedFiles = xmlDocument.CreateElement("Excluded");

            foreach (string supportedFileType in supportedFileCollection.SupportedFiles())
            {
                XmlNode fileTypeNode = xmlDocument.CreateElement("FileType");
                fileTypeNode.InnerText = supportedFileType;
                includedFiles.AppendChild(fileTypeNode);
            }

            foreach (string unsupportedFileType in supportedFileCollection.UnsupportedFiles())
            {
                XmlNode fileTypeNode = xmlDocument.CreateElement("FileType");
                fileTypeNode.InnerText = unsupportedFileType;
                excludedFiles.AppendChild(fileTypeNode);
            }

            supportedFileTypesNode.AppendChild(excludedFiles);
            supportedFileTypesNode.AppendChild(includedFiles);
            actionClassNode.AppendChild(supportedFileTypesNode);
        }
示例#2
0
        /// <summary>
        /// Creates a copy of the supported file list
        /// </summary>
        /// <param name="source">ISupportedFileCollection to be copied from</param>
        /// <returns>ISupportedFileCollection of the new copy</returns>
        public static ISupportedFilesSet CopyFileCollection(ISupportedFilesSet source)
        {
            if (source == null)
                return null;

            return CreateFileCollection(source.SupportedFiles(), source.UnsupportedFiles());
        }
 public QuarantineUserAction()
 {
     m_SupportedFileCollection = Workshare.Policy.Action.SupportedFileSet.CreateFileCollection(".*");
 }
示例#4
0
        private static bool CompareFileList(ISupportedFilesSet left, ISupportedFilesSet right)
        {
            if (left.SupportedFiles().Length != right.SupportedFiles().Length)
                return false;

            if (left.UnsupportedFiles().Length != right.UnsupportedFiles().Length)
                return false;

            List<string> leftSupported = new List<string>(left.SupportedFiles());
            List<string> rightSupported = new List<string>(right.SupportedFiles());

            foreach (string leftItem in leftSupported)
            {
                if (!rightSupported.Contains(leftItem))
                    return false;
            }

            List<string> leftUnsupported = new List<string>(left.UnsupportedFiles());
            List<string> rightUnsupported = new List<string>(right.UnsupportedFiles());

            foreach (string leftItem in leftUnsupported)
            {
                if (!rightUnsupported.Contains(leftItem))
                    return false;
            }

            return true;
        }
		public SkyDoxSendLinkAction()
		{
			_supportedFileCollection = SupportedFileSet.CreateFileCollection(".*");
			_properties = new ActionPropertySet();
			InitializePropertySet();
		}