protected override void OnEdit(Column column)
 {
     if (column == _.Column || column == _.SortDirection)
     {
         CurrentRow.EndEdit();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a debug string for spamming the display with too much information
 /// </summary>
 /// <returns>A formatted debug string</returns>
 public override string ToString()
 {
     return
         ("CurrentColumn: " + CurrentColumn.ToString() + "\n" +
          "CurrentRow:" + CurrentRow.ToString() + "\n" +
          "ApplicationCursorKeysMode:" + ApplicationCursorKeysMode.ToString() + "\n" +
          "Attribute:\n" + Attributes.ToString() + "\n" +
          "TabStops:" + string.Join(",", TabStops.Select(x => x.ToString()).ToList()) + "\n" +
          "WordWrap:" + WordWrap.ToString() + "\n" +
          "ReverseVideoMode:" + ReverseVideoMode.ToString() + "\n" +
          "OriginMode:" + OriginMode.ToString() + "\n" +
          "InsertMode:" + InsertMode.ToString() + "\n" +
          "ShowCursor:" + ShowCursor.ToString() + "\n" +
          "BlinkingCursor:" + BlinkingCursor.ToString() + "\n" +
          "CursorShape:" + CursorShape.ToString() + "\n" +
          "Utf8:" + Utf8.ToString() + "\n" +
          "CharacterSetMode:" + CharacterSetMode.ToString() + "\n" +
          "G0:" + G0.ToString() + "\n" +
          "G1:" + G1.ToString() + "\n" +
          "G2:" + G2.ToString() + "\n" +
          "G3:" + G3.ToString() + "\n" +
          "Vt300G1:" + Vt300G1.ToString() + "\n" +
          "Vt300G2:" + Vt300G2.ToString() + "\n" +
          "Vt300G3:" + Vt300G3.ToString() + "\n" +
          "Vt52AlternateKeypad: " + Vt52AlternateKeypad.ToString() + "\n" +
          "Vt52GraphicsMode: " + Vt52GraphicsMode.ToString() + "\n" +
          "AutomaticNewLine:" + AutomaticNewLine.ToString() + "\n" +
          "ConfiguredColumns:" + ConfiguredColumns.ToString() + "\n" +
          "National Character Replacement Mode:" + NationalCharacterReplacementMode.ToString() + "\n" +
          "Single shift character mode:" + SingleShiftSelectCharacterMode.ToString() + "\n"
         );
 }
Exemplo n.º 3
0
        /// <inheritdoc/>
        public override bool SubmitInput(bool focusToErrorInput = true)
        {
            RequireLayoutManager();

            if (IsEditing)
            {
                CurrentRow.EndEdit();
            }

            if (IsEditing)
            {
                return(false);
            }

            RowValidation.Validate();
            ScalarValidation.Validate();
            if (!CanSubmitInput)
            {
                if (focusToErrorInput)
                {
                    LayoutManager.FocusToInputError();
                }
                return(false);
            }

            return(true);
        }
        public virtual bool Remove(XLinkItemRemoveMode mode)
        {
            if (mode == XLinkItemRemoveMode.LinkAndTargetRecord)
            {
                // We first need to check if the current table x-linked to this entity can actually be deleted.
                // It may not be possible to do so, if other items are x-linked to it.
                if (!CanRemoveTargetRecord())
                {
                    return(false);
                }

                // Apparently it is OK to delete the linked record, so we remove it.
                CurrentTargetRow.Delete();
            }

            // Now we remove the assignment record, which removes the x-link
            CurrentRow.Delete();

            // We raise an update event
            if (ParentEntity is BusinessEntity entity)
            {
                entity.DataUpdated(string.Empty, CurrentRow.Table.TableName);
            }
            if (ParentCollection is EntitySubItemCollection collection)
            {
                collection.DataUpdated(string.Empty, CurrentRow);
            }

            return(true);
        }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Bitmap"></param>
 /// <param name="Color"></param>
 /// <param name="Action"></param>
 /// <param name="Reverse"></param>
 public override void UpdateSlider(WriteableBitmap Bitmap, Color Color, Func <Color, double, Rgba> Action = null, bool Reverse = false)
 {
     base.UpdateSlider(Bitmap, Color, new Func <Color, double, Rgba>((c, CurrentRow) =>
     {
         return(new Xyz(Color, Observer, Illuminant).New(Xyz.Component.Z, CurrentRow.Shift(-2)).ToRgba());
     }));
 }
Exemplo n.º 6
0
 protected internal override void OnEdit(Column column)
 {
     if (CurrentRow.GetValue(_.Column) != null && CurrentRow.GetValue(_.Direction) != SortDirection.Unspecified)
     {
         CurrentRow.EndEdit();   // Auto EndEdit when both columns has value entered
     }
 }
 /// <summary>
 /// Gets a value that indicates whether the named column contains a null value.
 /// </summary>
 /// <param name="columnName">The name of the column.</param>
 /// <returns>true if the column contains a null value; otherwise, false.</returns>
 public bool IsNull(string columnName)
 {
     if (CurrentRow == null)
     {
         throw new InvalidOperationException("No current row selected.");
     }
     return(CurrentRow.IsNull(columnName));
 }
Exemplo n.º 8
0
        private void SerializeEquations()
        {
            //XDocument document = new XDocument("d:\\rowDocument.xml");
            var rowElement = CurrentRow.Serialize();

            rowElement.Save("d:\\rowDocument.xml");
            var rowstring = rowElement.ToString();
        }
Exemplo n.º 9
0
 protected override void OnEdit(Column column)
 {
     CurrentRow.EndEdit();
     if (column == _.Column && !CurrentRow.IsEditing)
     {
         RefreshName();
     }
 }
Exemplo n.º 10
0
 private void SelectCurrent(object sender, ExecutedRoutedEventArgs e)
 {
     if (_presenter.CurrentProductID != CurrentRow.GetValue(_.ProductID))
     {
         _foreignKeyBox.EndLookup(CurrentRow.MakeValueBag(PK, Lookup));
     }
     Close();
 }
        void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            CurrentRow cr = e.UserState as CurrentRow;

            if (cr != null)
            {
                lblUpdate.Text = "Updating (" + cr.UpdateValue + ") " + (cr.index) + " out of " + cr.Total + "";
            }
        }
Exemplo n.º 12
0
 private void SelectCurrent(object sender, ExecutedRoutedEventArgs e)
 {
     if (_presenter.CurrentCustomerID != CurrentRow.GetValue(_.CustomerID))
     {
         _foreignKeyBox.EndLookup(CurrentRow.MakeValueBag(FK, Lookup));
         _shipToAddressBox.ClearValue();
         _billToAddressBox.ClearValue();
     }
     Close();
 }
Exemplo n.º 13
0
        public override int GetValues(object[] values)
        {
            if (CurrentRow == null)
            {
                throw new InvalidOperationException();
            }

            CurrentRow.CopyTo(values, 0);
            return(CurrentRow.Length);
        }
        /// <summary>
        /// Returns a deep copy of the <see cref="FormObject"/>.
        /// </summary>
        /// <returns></returns>
        public new FormObject Clone()
        {
            var formObject = (FormObject)MemberwiseClone();

            formObject.CurrentRow = CurrentRow?.Clone();
            formObject.OtherRows  = new List <RowObject>();
            foreach (var row in OtherRows)
            {
                formObject.OtherRows.Add(row.Clone());
            }
            return(formObject);
        }
Exemplo n.º 15
0
        }//fillTableWithArbitraryData()

        public void deleteArbitraryTableData(string TableName)
        {
            CswTableUpdate CswTableUpdate = _CswNbtSchemaModTrnsctn.makeCswTableUpdate("fillTableWtithArbitraryData_update", TableName);
            DataTable      DataTable      = CswTableUpdate.getTable();

            foreach (DataRow CurrentRow in DataTable.Rows)
            {
                CurrentRow.Delete();
            }

            CswTableUpdate.update(DataTable);
        }//deleteArbitraryTableData()
Exemplo n.º 16
0
 void ForeignKeyBox.ILookupService.BeginLookup(ForeignKeyBox foreignKeyBox)
 {
     if (foreignKeyBox.ForeignKey == _.FK_Product)
     {
         var dialogWindow = new ProductLookupWindow();
         dialogWindow.Show(_ownerWindow, foreignKeyBox, CurrentRow.GetValue(_.ProductID));
     }
     else
     {
         throw new NotSupportedException();
     }
 }
Exemplo n.º 17
0
        private void ExecNewFolder(object sender, ExecutedRoutedEventArgs e)
        {
            var fullPath = GetNewFolder();

            Directory.CreateDirectory(fullPath);
            var dataRow      = DataSet.AddRow((_, x) => _.Initialize(x, new DirectoryInfo(fullPath)));
            var rowPresenter = this[dataRow];

            CurrentRow = rowPresenter;
            CurrentRow.View.Focus();
            CurrentRow.BeginEdit();
            e.Handled = true;
        }
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + FormId.GetHashCode();
            hash = hash * 23 + MultipleIteration.GetHashCode();
            hash = hash * 23 + CurrentRow.GetHashCode();
            foreach (var otherRow in this.OtherRows)
            {
                hash = hash * 23 + otherRow.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 19
0
        protected override bool ConfirmEndEdit()
        {
            var type            = CurrentRow.GetValue(_.Type);
            var caption         = type == DirectoryItemType.Directory ? "Rename Directory" : "Rename File";
            var directoryOrFile = type == DirectoryItemType.Directory ? "directory" : "file";
            var message         = string.Format("Are you sure you want to rename the {0}?\nWARNING: This will ACTUALLY rename the {0}!!!", directoryOrFile);

            if (MessageBox.Show(message, caption, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                return(RenameCurrent());
            }
            return(false);
        }
        /// <summary>
        /// Removes the current item from the collection
        /// </summary>
        public virtual void Remove()
        {
            CurrentRow.Delete();

            // We raise an update event
            if (ParentEntity is BusinessEntity entity)
            {
                entity.DataUpdated(string.Empty, CurrentRow.Table.TableName);
            }
            if (ParentCollection is EntitySubItemCollection collection)
            {
                collection.DataUpdated(string.Empty, CurrentRow);
            }
        }
Exemplo n.º 21
0
        private void StartCurrent()
        {
            var type = CurrentRow.GetValue(_.Type);
            var path = CurrentRow.GetValue(_.Path);

            if (type == DirectoryItemType.Directory)
            {
                DirectoryTreePresenter.SelectSubDirectory(path);
            }
            else
            {
                ProcessStart(path);
            }
        }
Exemplo n.º 22
0
        public void SetHeaderAndSelectRow(int rowNo)
        {
            _headers.Clear();
            var row = SelectRow(rowNo);

            foreach (var s in row)
            {
                _headers.Add(s.StringValue);
            }
            while (MoveNext())
            {
                CurrentRow.SetHeader(_headers);
            }
            this.SelectRow(rowNo);
        }
Exemplo n.º 23
0
 /// <summary>
 /// Moves the caret to the first non whitespace column at the active row
 /// </summary>
 /// <param name="Select">True if a selection should be created from the current caret pos to the new pos</param>
 public void MoveHome(bool Select)
 {
     CropPosition();
     if (CurrentRow.IsCollapsedEndPart)
     {
         Position.Y = CurrentRow.Expansion_StartRow.Index;
         MoveHome(Select);
     }
     else
     {
         int i = CurrentRow.GetLeadingWhitespace().Length;
         Position.X = Position.X == i ? 0 : i;
         RememberXPos();
         CaretMoved(Select);
     }
 }
 void ForeignKeyBox.ILookupService.BeginLookup(ForeignKeyBox foreignKeyBox)
 {
     if (foreignKeyBox.ForeignKey == _.FK_Customer)
     {
         var dialogWindow = new CustomerLookupWindow();
         dialogWindow.Show(_ownerWindow, foreignKeyBox, CurrentRow.GetValue(_.CustomerID), _shipToAddressBinding[CurrentRow], _billToAddressBinding[CurrentRow]);
     }
     else if (foreignKeyBox.ForeignKey == _.FK_ShipToAddress || foreignKeyBox.ForeignKey == _.FK_BillToAddress)
     {
         BeginLookupAddress(foreignKeyBox);
     }
     else
     {
         throw new NotSupportedException();
     }
 }
Exemplo n.º 25
0
        public void AddItemToCurrentRow(LayoutNode itemToAdd)
        {
            if (StopAddingNewItems)
            {
                return;
            }

            CurrentRow.AddItem(itemToAdd);

            var overflowedAlong         = CurrentRow.UsedAlongSize > AvailableAlongSize;
            var overflowedPerpendicular = UsedSize.OppositeAxisValue(Orientation.ToAxis()) > AvailablePerpendicularSize;
            var failed = overflowedPerpendicular || overflowedAlong;

            if (failed)
            {
            }
        }
Exemplo n.º 26
0
        public void SelectSubDirectory(string path)
        {
            EnsureSubDirectoriesLoaded(CurrentRow);
            if (!CurrentRow.IsExpanded)
            {
                CurrentRow.ToggleExpandState();
            }
            var children = CurrentRow.Children;

            foreach (var child in children)
            {
                if (child.GetValue(_.Path) == path)
                {
                    Select(child, SelectionMode.Single);
                    return;
                }
            }
        }
            private void BeginLookupAddress(ForeignKeyBox foreignKeyBox)
            {
                var foreignKey = (Address.PK)foreignKeyBox.ForeignKey;

                if (_addressLookupPopup.FK == foreignKey)
                {
                    _addressLookupPopup.IsOpen = false;
                }
                else
                {
                    var customerID = CurrentRow.GetValue(_.CustomerID);
                    if (customerID.HasValue)
                    {
                        var addressID = foreignKeyBox.ForeignKey == _.FK_ShipToAddress ? _.ShipToAddressID : _.BillToAddressID;
                        _addressLookupPopup.Show(foreignKeyBox, CurrentRow.GetValue(addressID), customerID.Value);
                    }
                }
            }
Exemplo n.º 28
0
        private bool TryFocus(RowBinding rowBinding, RowPresenter row)
        {
            if (rowBinding[row] == null)
            {
                if (IsEditing)
                {
                    CurrentRow.EndEdit();
                }
                CurrentRow = row;
            }

            var element = rowBinding[row];

            Debug.Assert(element != null);
            if (element.IsKeyboardFocusWithin)
            {
                return(true);
            }
            return(element.Focus());
        }
Exemplo n.º 29
0
        private bool RenameCurrent()
        {
            var type        = CurrentRow.GetValue(_.Type);
            var path        = CurrentRow.GetValue(_.Path);
            var displayName = CurrentRow.GetValue(_.DisplayName);

            var newPath = Path.Combine(Path.GetDirectoryName(path), displayName);

            if (!PerformRename(type, path, newPath))
            {
                return(false);
            }

            CurrentRow.EditValue(_.Path, newPath);
            if (type == DirectoryItemType.Directory)
            {
                DirectoryTreePresenter.OnSubDirectoryRenamed(path, newPath);
            }
            return(true);
        }
Exemplo n.º 30
0
 /// <summary>
 /// Moves the caret to the first non whitespace column at the active row
 /// </summary>
 /// <param name="Select">True if a selection should be created from the current caret pos to the new pos</param>
 public void MoveHome(bool Select)
 {
     this.CropPosition();
     if (this.CurrentRow.IsCollapsedEndPart)
     {
         this.Position.Y = this.CurrentRow.Expansion_StartRow.Index;
         this.MoveHome(Select);
     }
     else
     {
         int i = CurrentRow.GetLeadingWhitespace().Length;
         if (this.Position.X == i)
         {
             this.Position.X = 0;
         }
         else
         {
             this.Position.X = i;
         }
         RememberXPos();
         CaretMoved(Select);
     }
 }