示例#1
0
        private ISsrsObjectSource GetObjectSource()
        {
            if (!SourcePaths.Any())
            {
                throw new InvalidArgumentsException("No source paths specified.");
            }

            var sourceFactory = new ObjectSourceFactory()
            {
                ReportingServiceClientFactory = ReportingServiceClientFactory, BasePath = BasePath
            };
            var aggregateSource = new AggregatedObjectSource();

            try
            {
                foreach (var path in SourcePaths)
                {
                    aggregateSource.Add(sourceFactory.Create(path));
                }
                return(aggregateSource);
            }
            catch
            {
                aggregateSource.Dispose();
                throw;
            }
        }
示例#2
0
        public override string ToString()
        {
            return($@"Index Options:
source(s): {((SourcePaths.Any()) ? SourcePaths.Aggregate((a, b) => a + " | " + b) : "")}
onebyone: {Sequential}
disable-archive-traversal: {DisableArchiveTraversal}");
        }
示例#3
0
        private void addFilesToSourcePaths(ObservableCollection <string> items, int count)
        {
            int index = 0;

            while (index < count)
            {
                if (items.ElementAtOrDefault(index) != null)
                {
                    SourcePaths.Add(new FileSystemElement()
                    {
                        Path   = items.ElementAt(index),
                        IsFile = true
                    });
                }
                else
                {
                    break;
                }

                index++;
            }
        }
示例#4
0
 public JoinPaths(IEnumerable <IVertexSource> paths)
 {
     SourcePaths.AddRange(paths);
 }
示例#5
0
 void IReceiveArgumentList.ReceiveFrom(ArgumentList argumentList)
 {
     argumentList.Add("ssrs-uri", o => SsrsUriString = o);
     argumentList.AddRemainder("files|directories...", o => SourcePaths.Add(o));
 }
示例#6
0
        public ArithmeticBox(DcColumn column, bool whereExpression)
        {
            this.okCommand = new DelegateCommand(this.OkCommand_Executed, this.OkCommand_CanExecute);

            IsWhere = whereExpression;

            if (column.Input.Columns.Contains(column))
            {
                IsNew = false;
            }
            else
            {
                IsNew = true;
            }

            Column = column;
            DcTable  sourceTable = column.Input;
            DcSchema schema      = sourceTable.Schema;

            SourceTable = sourceTable;

            ExpressionModel = new ObservableCollection <ExprNode>(); // This contains what we will create/edit
            if (IsWhere)
            {
                if (SourceTable.Definition.WhereExpr != null)
                {
                    ExpressionModel.Add(SourceTable.Definition.WhereExpr);
                }
            }
            else
            {
                if (Column.Definition.FormulaExpr != null)
                {
                    ExpressionModel.Add(Column.Definition.FormulaExpr);
                }
            }

            InitializeComponent();

            newColumnName.Text = Column.Name;

            // Initialize a list of possible operations
            ActionType[] ops;
            if (whereExpression)
            {
                // Other ways: to collapse a grid row: http://stackoverflow.com/questions/2502178/wpf-hide-grid-row
                Controls.RowDefinitions[0].Height = new GridLength(0);
                sourceTableName.IsReadOnly        = false;

                ops = new ActionType[]
                {
                    ActionType.MUL, ActionType.DIV, ActionType.ADD, ActionType.SUB,
                    ActionType.LEQ, ActionType.GEQ, ActionType.GRE, ActionType.LES,
                    ActionType.EQ, ActionType.NEQ,
                    ActionType.AND, ActionType.OR,
                };
            }
            else
            {
                Controls.RowDefinitions[0].Height = new GridLength(1, GridUnitType.Auto);
                sourceTableName.IsReadOnly        = true;

                ops = new ActionType[] { ActionType.MUL, ActionType.DIV, ActionType.ADD, ActionType.SUB };
            }
            operations.ItemsSource = ops;

            // Initialize a list of possible column accesses
            var paths = new PathEnumerator(
                new List <DcTable>(new DcTable[] { SourceTable }),
                new List <DcTable>(new DcTable[] { schema.GetPrimitive("Integer"), schema.GetPrimitive("Double") }),
                false,
                DimensionType.IDENTITY_ENTITY
                );

            SourcePaths = paths.ToList();

            // If we edit an existing column then we do not want to use it in the definition as an operand
            DimPath columnPath = SourcePaths.FirstOrDefault(p => p.FirstSegment == column);

            if (columnPath != null)
            {
                SourcePaths.Remove(columnPath);
            }

            RefreshAll();
        }
示例#7
0
 public void Sanitize()
 {
     SourcePaths    = SourcePaths.Where(sourcePath => !string.IsNullOrWhiteSpace(sourcePath)).ToArray();
     FileExtensions = FileExtensions.Where(fileExtension => !string.IsNullOrWhiteSpace(fileExtension)).ToArray();
     ExcludeFolders = ExcludeFolders.Where(excludeFolder => !string.IsNullOrWhiteSpace(excludeFolder)).ToArray();
 }
示例#8
0
 internal sealed record OptionArgs(
     SourcePaths SourcePaths);