public ProfileAndMachineParser(IGraphBuilder graphBuilder, XmlNode structureMapNode, XmlMementoCreator creator)
 {
     _profileBuilder = graphBuilder.GetProfileBuilder();
     _graphBuilder = graphBuilder;
     _structureMapNode = structureMapNode;
     _creator = creator;
 }
        public XmlMementoSource(string NodeName, string TypeAttribute, string KeyAttribute, XmlMementoStyle style)
        {
            _nodeName = NodeName;
            _typeAttribute = TypeAttribute;
            _keyAttribute = KeyAttribute;

            _mementoCreator = new XmlMementoCreator(style, TypeAttribute, KeyAttribute);
        }
示例#3
0
        public XmlMementoSource(string NodeName, string TypeAttribute, string KeyAttribute, XmlMementoStyle style)
        {
            _nodeName      = NodeName;
            _typeAttribute = TypeAttribute;
            _keyAttribute  = KeyAttribute;

            _mementoCreator = new XmlMementoCreator(style, TypeAttribute, KeyAttribute);
        }
示例#4
0
        public EmbeddedFolderXmlMementoSource(XmlMementoStyle style, string assemblyName, string folderPath,
                                              string extension)
        {
            _assemblyName = assemblyName;
            _folderPath   = folderPath;
            _extension    = extension;

            findEmbeddedFiles();

            _creator = new XmlMementoCreator(style, "Type", "Key");
        }
        public EmbeddedFolderXmlMementoSource(XmlMementoStyle style, string assemblyName, string folderPath,
            string extension)
        {
            _assemblyName = assemblyName;
            _folderPath = folderPath;
            _extension = extension;

            findEmbeddedFiles();

            _creator = new XmlMementoCreator(style, "Type", "Key");
        }
        public ConfigurationParser(XmlNode structureMapNode)
        {
            _structureMapNode = structureMapNode;

            XmlMementoStyle mementoStyle = XmlMementoStyle.NodeNormalized;
            _structureMapNode.ForAttributeValue(MEMENTO_STYLE,
                                                style =>
                                                {
                                                    if (style == ATTRIBUTE_STYLE)
                                                        mementoStyle = XmlMementoStyle.AttributeNormalized;
                                                });

            _mementoCreator = new XmlMementoCreator(
                mementoStyle,
                TYPE_ATTRIBUTE,
                KEY_ATTRIBUTE);
        }
        /// <summary>
        /// Stores an Xml InstanceMemento per file in a directory
        /// </summary>
        /// <param name="directory">A ";" delimited list of directories to look for mementos.  DirectoryXmlMementoSource 
        /// will use the FIRST directory it finds</param>
        /// <param name="extension">The file extension of the InstanceMemento files without a dot.  Typically "xml"</param>
        /// <param name="mementoStyle">NodeNormalized or AttributeNormalized</param>
        public DirectoryXmlMementoSource(string directory, string extension, XmlMementoStyle mementoStyle)
        {
            _extension = extension;
            _mementoCreator =
                new XmlMementoCreator(mementoStyle, XmlConstants.TYPE_ATTRIBUTE, XmlConstants.KEY_ATTRIBUTE);

            string[] searchPaths = directory.Split(';');
            foreach (string searchPath in searchPaths)
            {
                string resolvedPath = resolvePath(searchPath);
                if (Directory.Exists(resolvedPath))
                {
                    _directory = resolvedPath;
                    break;
                }
            }

            if (_directory == null)
            {
                throw new ApplicationException("Could not find any of the SearchPaths in the directory path");
            }
        }
        /// <summary>
        /// Stores an Xml InstanceMemento per file in a directory
        /// </summary>
        /// <param name="directory">A ";" delimited list of directories to look for mementos.  DirectoryXmlMementoSource
        /// will use the FIRST directory it finds</param>
        /// <param name="extension">The file extension of the InstanceMemento files without a dot.  Typically "xml"</param>
        /// <param name="mementoStyle">NodeNormalized or AttributeNormalized</param>
        public DirectoryXmlMementoSource(string directory, string extension, XmlMementoStyle mementoStyle)
        {
            _extension      = extension;
            _mementoCreator =
                new XmlMementoCreator(mementoStyle, XmlConstants.TYPE_ATTRIBUTE, XmlConstants.KEY_ATTRIBUTE);

            string[] searchPaths = directory.Split(';');
            foreach (string searchPath in searchPaths)
            {
                string resolvedPath = resolvePath(searchPath);
                if (Directory.Exists(resolvedPath))
                {
                    _directory = resolvedPath;
                    break;
                }
            }


            if (_directory == null)
            {
                throw new ApplicationException("Could not find any of the SearchPaths in the directory path");
            }
        }
示例#9
0
 public FamilyParser(IGraphBuilder builder, XmlMementoCreator mementoCreator)
 {
     _builder = builder;
     _mementoCreator = mementoCreator;
 }