Exemplo n.º 1
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.º 2
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);
        }
Exemplo n.º 3
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.º 4
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);
        }
 /// <summary>
 /// Gets the typed value with the specified key.
 /// </summary>
 /// <typeparam name="TValue">The type of value.</typeparam>
 /// <param name="key">The key to find.</param>
 /// <param name="defaultValue">The default value of the variable.</param>
 /// <param name="provider">An <see cref="IFormatProvider" /> interface implementation that
 /// supplies culture-specific formatting information.</param>
 public TValue GetValue <TValue>(string key, TValue defaultValue,
                                 IFormatProvider provider)
 {
     return(CurrentRow.GetValue <TValue>(key, defaultValue, provider));
 }
 /// <summary>
 /// Return the boxed value of the specified field.
 /// </summary>
 /// <param name="name">The name of the column.</param>
 public override object GetValue(string name)
 {
     return(CurrentRow.GetValue(name));
 }
 /// <summary>
 /// Return the boxed value of the specified field.
 /// </summary>
 /// <param name="ordinal">The zero-based column ordinal.</param>
 public override object GetValue(int ordinal)
 {
     return(CurrentRow.GetValue(ordinal));
 }