Remove() public method

public Remove ( InputFragment fragment ) : void
fragment InputFragment
return void
        public virtual void Wrap(Scope scope)
        {
            IsWrapped = true;

            if (scope == null) return;
            if (Left != null)
                scope.Remove(Left);
            if (Right != null)
                scope.Remove(Right);
        }
        public virtual void Wrap(Scope scope)
        {
            IsWrapped = true;

            if (scope == null)
            {
                return;
            }
            if (Left != null)
            {
                scope.Remove(Left);
            }
            if (Right != null)
            {
                scope.Remove(Right);
            }
        }
Example #3
0
        public override void Wrap(Scope scope)
        {
            base.Wrap(scope);

            // now we need to add default columns if necessary
            if (Columns.Count == 0)
            {
                AddDefaultColumns(scope);
            }

            // next we need to remove child extents of the select from scope
            if (Name != null)
            {
                scope.Remove(this);
                scope.Add(Name, this);
            }
        }
Example #4
0
        void AddDefaultColumns(Scope scope)
        {
            if (columnHash == null)
            {
                columnHash = new Dictionary <string, ColumnFragment>();
            }

            List <ColumnFragment> columns = GetDefaultColumnsForFragment(From);
            bool Exists = false;

            if (From is TableFragment && scope.GetFragment((From as TableFragment).Table) == null)
            {
                scope.Add((From as TableFragment).Table, From);
                Exists = true;
            }

            foreach (ColumnFragment column in columns)
            {
                // first we need to set the input for this column
                InputFragment input = scope.FindInputFromProperties(column.PropertyFragment);
                column.TableName = input.Name;

                // then we rename the column if necessary
                if (columnHash.ContainsKey(column.ColumnName.ToUpper()))
                {
                    column.ColumnAlias = MakeColumnNameUnique(column.ColumnName);
                    columnHash.Add(column.ColumnAlias, column);
                }
                else
                {
                    columnHash.Add(column.ColumnName.ToUpper(), column);
                }
                Columns.Add(column);
            }
            if (From is TableFragment && Exists)
            {
                scope.Remove((From as TableFragment).Table, From);
            }
        }
    void AddDefaultColumns(Scope scope)
    {
      if (columnHash == null)
        columnHash = new Dictionary<string, ColumnFragment>();

      List<ColumnFragment> columns = GetDefaultColumnsForFragment(From);
      bool Exists = false;
      if (From is TableFragment && scope.GetFragment((From as TableFragment).Table) == null)
      {
        scope.Add((From as TableFragment).Table, From);
        Exists = true;
      }

      foreach (ColumnFragment column in columns)
      {
        // first we need to set the input for this column
        InputFragment input = scope.FindInputFromProperties(column.PropertyFragment);
        column.TableName = input.Name;

        // then we rename the column if necessary
        if (columnHash.ContainsKey(column.ColumnName.ToUpper()))
        {
          column.ColumnAlias = MakeColumnNameUnique(column.ColumnName);
          columnHash.Add(column.ColumnAlias, column);
        }
        else
          columnHash.Add(column.ColumnName.ToUpper(), column);
        Columns.Add(column);
      }
      if (From is TableFragment && Exists)
      {
        scope.Remove(From);
      }
    }
    public override void Wrap(Scope scope)
    {
      base.Wrap(scope);

      // now we need to add default columns if necessary
      if (Columns.Count == 0)
        AddDefaultColumns(scope);

      // next we need to remove child extents of the select from scope
      if (Name != null)
      {
        scope.Remove(this);
        scope.Add(Name, this);
      }
    }