예제 #1
0
        public ProjectionDispatcher(DataflowOptions options, ProjectionBase <TState> projection)
            : base(s => s.Value.Key, options, projection.CancellationToken, projection.GetType())
        {
            _projection = projection;
            Log         = projection.Log;

            CompletionTask.ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    Log.Errors.Add(t.Exception);
                }
            });
        }
예제 #2
0
        /// <summary>
        /// Creates the args.
        /// </summary>
        /// <returns></returns>
        private string CreateArgs( )
        {
            if (Mode == BartMode.List)
            {
                this.LogInfo("Bart Arguments: -l");
                return("-l");
            }
            else
            {
                StringBuilder args = new StringBuilder( );
                args.Append("--noninteractive ");
                if (Mode == BartMode.Delete)
                {
                    if (BackupMode == BackupMode.ExtOnly)
                    {
                        args.Append("-e ");
                    }
                    else if (BackupMode == BackupMode.NandroidOnly)
                    {
                        args.Append("-n ");
                    }

                    args.Append("-d ");
                    this.LogInfo("Bart Arguments: {0}", args.ToString( ));
                    return(args.ToString( ));
                }
                else
                {
                    switch (BackupMode)
                    {
                    case BackupMode.Apps:
                        args.Append("-a ");
                        break;

                    case BackupMode.Base:
                        args.Append("-b ");
                        break;

                    case BackupMode.ExtOnly:
                        args.Append("-e ");
                        break;

                    case BackupMode.NandroidOnly:
                        args.Append("-n ");
                        break;
                    }
                    if (Verbose)
                    {
                        args.Append("--verbose ");
                    }

                    if (!IncludeSystem)
                    {
                        args.Append("--nosystem ");
                    }

                    if (!IncludeBoot)
                    {
                        args.Append("--noboot ");
                    }

                    if (!IncludeRecovery)
                    {
                        args.Append("--norecovery ");
                    }

                    if (!IncludeData)
                    {
                        args.Append("--nodata ");
                    }

                    if (CompletionTask != CompleteTask.None)
                    {
                        args.AppendFormat("--{0} ", CompletionTask.ToString( ).ToLower( ));
                    }

                    switch (Mode)
                    {
                    case BartMode.Backup:
                        if (Compress)
                        {
                            args.Append("-c ");
                        }
                        args.Append("-s ");
                        break;

                    case BartMode.Restore:
                        args.Append("-r ");
                        break;
                    }
                }

                this.LogInfo("Bart Arguments: {0}", args.ToString( ));
                return(args.ToString( ));
            }
        }