Example #1
0
        /// <summary>
        /// Retrieves an instance from script data.
        /// </summary>
        /// <param name="scriptObject">The script object.</param>
        /// <returns></returns>
        public static MarkerEventArgs FromScriptData(object scriptObject)
        {
            var data = scriptObject as IDictionary <string, object>;

            if (data != null)
            {
                var    args = new MarkerEventArgs();
                object value;
                if (data.TryGetValue("index", out value))
                {
                    args.Index = (int)value;
                }
                if (data.TryGetValue("position", out value))
                {
                    args.Position = LatLng.FromScriptData(value);
                }
                return(args);
            }
            return(null);
        }
Example #2
0
 /// <summary>
 /// Raises the <see cref="E:MouseDown"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
 protected virtual void OnMouseDown(MarkerEventArgs e)
 {
     MouseDown?.Invoke(this, e);
 }
Example #3
0
 /// <summary>
 /// Raises the <see cref="E:IconChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnIconChanged(MarkerEventArgs e)
 {
     IconChanged?.Invoke(this, e);
 }
Example #4
0
 /// <summary>
 /// Raises the <see cref="E:FlatChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnFlatChanged(MarkerEventArgs e)
 {
     FlatChanged?.Invoke(this, e);
 }
Example #5
0
 /// <summary>
 /// Raises the <see cref="E:DragStart"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDragStart(MarkerEventArgs e)
 {
     DragStart?.Invoke(this, e);
 }
Example #6
0
 /// <summary>
 /// Raises the <see cref="E:DragEnd"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDragEnd(MarkerEventArgs e)
 {
     DragEnd?.Invoke(this, e);
 }
Example #7
0
 /// <summary>
 /// Raises the <see cref="E:DraggableChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDraggableChanged(MarkerEventArgs e)
 {
     DraggableChanged?.Invoke(this, e);
 }
Example #8
0
 /// <summary>
 /// Raises the <see cref="E:ShapeChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnShapeChanged(MarkerEventArgs e)
 {
     ShapeChanged?.Invoke(this, e);
 }
Example #9
0
 /// <summary>
 /// Raises the <see cref="E:CursorChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnCursorChanged(MarkerEventArgs e)
 {
     CursorChanged?.Invoke(this, e);
 }
Example #10
0
 /// <summary>
 /// Raises the <see cref="E:ClickableChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnClickableChanged(MarkerEventArgs e)
 {
     ClickableChanged?.Invoke(this, e);
 }
Example #11
0
 /// <summary>
 /// Raises the <see cref="E:AnimationChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected virtual void OnAnimationChanged(MarkerEventArgs e)
 {
     AnimationChanged?.Invoke(this, e);
 }
Example #12
0
        /// <summary>
        /// When implemented by a class, enables a server control to process an event raised when a form is posted to the server.
        /// </summary>
        /// <param name="eventArgument">A <see cref="T:System.String"/> that represents an optional event argument to be passed to the event handler.</param>
        void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
        {
            var     ser  = new JavaScriptSerializer();
            dynamic args = ser.DeserializeObject(eventArgument);

            if (args != null)
            {
                string name = args["name"];
                var    e    = MarkerEventArgs.FromScriptData(args);
                switch (name)
                {
                case "animationChanged":
                    this.OnAnimationChanged(e);
                    break;

                case "click":
                    this.OnClick(e);
                    break;

                case "clickableChanged":
                    this.OnClickableChanged(e);
                    break;

                case "cursorChanged":
                    this.OnCursorChanged(e);
                    break;

                case "doubleClick":
                    this.OnDoubleClick(e);
                    break;

                case "drag":
                    this.OnDrag(e);
                    break;

                case "draggableChanged":
                    this.OnDraggableChanged(e);
                    break;

                case "dragEnd":
                    this.OnDragEnd(e);
                    break;

                case "dragStart":
                    this.OnDragStart(e);
                    break;

                case "flatChanged":
                    this.OnFlatChanged(e);
                    break;

                case "iconChanged":
                    this.OnIconChanged(e);
                    break;

                case "mouseDown":
                    this.OnMouseDown(e);
                    break;

                case "mouseOut":
                    this.OnMouseOut(e);
                    break;

                case "mouseOver":
                    this.OnMouseOver(e);
                    break;

                case "mouseUp":
                    this.OnMouseUp(e);
                    break;

                case "positionChanged":
                    this.OnPositionChanged(e);
                    break;

                case "rightClick":
                    this.OnRightClick(e);
                    break;

                case "shadowChanged":
                    this.OnShadowChanged(e);
                    break;

                case "shapeChanged":
                    this.OnShapeChanged(e);
                    break;

                case "titleChanged":
                    this.OnTitleChanged(e);
                    break;

                case "visibleChanged":
                    this.OnVisibleChanged(e);
                    break;

                case "zindexChanged":
                    this.OnZIndexChanged(e);
                    break;
                }
            }
        }
Example #13
0
 /// <summary>
 /// Raises the <see cref="E:ZIndexChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnZIndexChanged(MarkerEventArgs e)
 {
     ZIndexChanged?.Invoke(this, e);
 }
Example #14
0
 /// <summary>
 /// Raises the <see cref="E:VisibleChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param>
 protected virtual void OnVisibleChanged(MarkerEventArgs e)
 {
     VisibleChanged?.Invoke(this, e);
 }
Example #15
0
 /// <summary>
 /// Raises the <see cref="E:MouseOver"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
 protected virtual void OnMouseOver(MarkerEventArgs e)
 {
     MouseOver?.Invoke(this, e);
 }
Example #16
0
 /// <summary>
 /// Raises the <see cref="E:DoubleClick"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDoubleClick(MarkerEventArgs e)
 {
     DoubleClick?.Invoke(this, e);
 }
Example #17
0
 /// <summary>
 /// Raises the <see cref="E:RightClick"/> event.
 /// </summary>
 /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRightClick(MarkerEventArgs e)
 {
     RightClick?.Invoke(this, e);
 }