Пример #1
0
        public BaseFileContext(IInternalPluginManager pluginManager, ContextNode parentContextNode, IProgressContext progressContext) :
            base(progressContext)
        {
            PluginManager = pluginManager;

            ContextNode = parentContextNode;
        }
Пример #2
0
        public ContextNode Add(IContext parentContext, IStateInfo stateInfo)
        {
            var newNode = new ContextNode(parentContext, this, stateInfo);

            Children.Add(newNode);

            return(newNode);
        }
Пример #3
0
        protected BaseFileContext(IInternalFileManager pluginManager, IProgressContext progressContext) :
            base(progressContext)
        {
            ContractAssertions.IsNotNull(progressContext, nameof(progressContext));

            PluginManager = pluginManager;

            ContextNode = new ContextNode();
        }
Пример #4
0
        public ArchiveContext(ContextNode contextNode, IContext parentContext, IInternalPluginManager pluginManager) : base(pluginManager, contextNode)
        {
            ContractAssertions.IsNotNull(contextNode, nameof(contextNode));
            ContractAssertions.IsNotNull(parentContext, nameof(parentContext));

            _stateInfo         = contextNode.StateInfo;
            _archiveState      = _stateInfo.PluginState as IArchiveState;
            _archiveFileSystem = FileSystemFactory.CreateAfiFileSystem(_stateInfo);
            _parentContext     = parentContext;
        }
Пример #5
0
        private ContextNode(IContext parentContext, ContextNode parentNode, IStateInfo parentState) : this()
        {
            ContractAssertions.IsNotNull(parentContext, nameof(parentContext));
            ContractAssertions.IsNotNull(parentNode, nameof(parentNode));
            ContractAssertions.IsNotNull(parentState, nameof(parentState));

            _parentNode    = parentNode;
            _parentContext = parentContext;
            StateInfo      = parentState;
        }
Пример #6
0
        private IContext CreateFileContext(ContextNode childNode)
        {
            switch (childNode.StateInfo.PluginState)
            {
            case ITextState _:
                return(new TextContext(childNode.StateInfo, this));

            case IImageState _:
                return(new ImageContext(childNode.StateInfo, this));

            case IArchiveState _:
                return(new ArchiveContext(childNode, this, PluginManager));

            default:
                Console.WriteLine($"State '{childNode.StateInfo.PluginState.GetType()}' is not supported.");
                return(this);
            }
        }
Пример #7
0
 public void Remove()
 {
     _parentNode?.Children.Remove(this);
     _parentNode = null;
 }
Пример #8
0
        public BaseFileContext(IInternalPluginManager pluginManager, ContextNode parentContextNode)
        {
            PluginManager = pluginManager;

            ContextNode = parentContextNode;
        }
Пример #9
0
        public BaseFileContext(IInternalPluginManager pluginManager)
        {
            PluginManager = pluginManager;

            ContextNode = new ContextNode();
        }