Exemple #1
0
        // =================================================================================== Events

        /// <summary>
        /// Checks whether the Move operation is acceptable for the current <see cref="DirectoryProvider"/>.
        /// The operation will be cancelled if it is prohibited.
        /// Do not use this method directly from your code.
        /// </summary>
        protected override void OnMoving(object sender, CancellableNodeOperationEventArgs e)
        {
            // AD Sync check
            var ADProvider = DirectoryProvider.Current;

            if (ADProvider != null)
            {
                var targetNodePath = RepositoryPath.Combine(e.TargetNode.Path, this.Name);
                var allowMove      = ADProvider.AllowMoveADObject(this, targetNodePath);
                if (!allowMove)
                {
                    e.CancelMessage = "Moving of synced nodes is only allowed within AD server bounds!";
                    e.Cancel        = true;
                }
            }

            base.OnMoving(sender, e);
        }
Exemple #2
0
 protected override void OnNodeMoving(object sender, CancellableNodeOperationEventArgs e)
 {
     RouteCancelEvent(RepositoryEvent.Moving, sender, e.SourceNode, e);
 }