Esempio n. 1
0
        /// <summary>
        /// Helper method for raising the <see cref="MergeRequested">Merge Requested</see> event and returning whether any of the Event Handlers cancelled the operation
        /// </summary>
        /// <returns>True if the operation can continue, false if it should be aborted</returns>
        protected void RaiseMergeRequested(CancellableGraphEventArgs args)
        {
            CancellableGraphEventHandler d = this.MergeRequested;

            if (d != null)
            {
                d(this, args);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a wrapper around the default Graph implementation, primarily required only for deserialization and requires that the caller call <see cref="WrapperGraph.AttachEventHandlers"/> to properly wire up event handling
        /// </summary>
        protected WrapperGraph()
        {
            this._g = new Graph();

            // Create Event Handlers and attach to relevant events so the wrapper propogates events upwards
            this.TripleAssertedHandler      = new TripleEventHandler(this.OnTripleAsserted);
            this.TripleRetractedHandler     = new TripleEventHandler(this.OnTripleRetracted);
            this.GraphChangedHandler        = new GraphEventHandler(this.OnChanged);
            this.GraphClearedHandler        = new GraphEventHandler(this.OnCleared);
            this.GraphMergedHandler         = new GraphEventHandler(this.OnMerged);
            this.GraphClearRequestedHandler = new CancellableGraphEventHandler(this.OnClearRequested);
            this.GraphMergeRequestedHandler = new CancellableGraphEventHandler(this.OnMergeRequested);
        }
Esempio n. 3
0
        /// <summary>
        /// Helper method for raising the <see cref="MergeRequested">Merge Requested</see> event and returning whether any of the Event Handlers cancelled the operation.
        /// </summary>
        /// <returns>True if the operation can continue, false if it should be aborted.</returns>
        protected bool RaiseMergeRequested()
        {
            CancellableGraphEventHandler d = MergeRequested;

            if (d != null)
            {
                CancellableGraphEventArgs args = new CancellableGraphEventArgs(this);
                d(this, args);
                return(!args.Cancel);
            }
            else
            {
                return(true);
            }
        }