/// <summary> /// Initializes a new instance of the <see cref="EditGrhForm"/> class. /// </summary> /// <param name="gd">The <see cref="GrhData"/> to edit.</param> /// <param name="mapGrhWalls">The <see cref="MapGrhWalls"/> instance.</param> /// <param name="createWall">Delegate describing how to create wall instances.</param> /// <param name="deleteOnCancel">If the <see cref="GrhData"/> will be deleted if the editing is canceled.</param> /// <exception cref="ArgumentNullException"><paramref name="gd" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="mapGrhWalls" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="createWall" /> is <c>null</c>.</exception> /// <exception cref="ArgumentException">Cannot edit an <see cref="AutomaticAnimatedGrhData"/>.</exception> public EditGrhForm(GrhData gd, MapGrhWalls mapGrhWalls, CreateWallEntityHandler createWall, bool deleteOnCancel) { if (gd == null) throw new ArgumentNullException("gd"); if (mapGrhWalls == null) throw new ArgumentNullException("mapGrhWalls"); if (createWall == null) throw new ArgumentNullException("createWall"); if (gd is AutomaticAnimatedGrhData) throw new ArgumentException("Cannot edit an AutomaticAnimatedGrhData.", "gd"); DeleteOnCancel = deleteOnCancel; WasCanceled = false; // Set the local members _createWall = createWall; _gd = gd; _mapGrhWalls = mapGrhWalls; _grh = new Grh(gd, AnimType.Loop, TickCount.Now); InitializeComponent(); ShowGrhInfo(); }
/// <summary> /// Initializes a new instance of the <see cref="EditGrhForm"/> class. /// </summary> /// <param name="gd">The <see cref="GrhData"/> to edit.</param> /// <param name="mapGrhWalls">The <see cref="MapGrhWalls"/> instance.</param> /// <param name="createWall">Delegate describing how to create wall instances.</param> /// <param name="deleteOnCancel">If the <see cref="GrhData"/> will be deleted if the editing is canceled.</param> /// <exception cref="ArgumentNullException"><paramref name="gd" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="mapGrhWalls" /> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="createWall" /> is <c>null</c>.</exception> /// <exception cref="ArgumentException">Cannot edit an <see cref="AutomaticAnimatedGrhData"/>.</exception> public EditGrhForm(GrhData gd, MapGrhWalls mapGrhWalls, CreateWallEntityHandler createWall, bool deleteOnCancel) { if (gd == null) { throw new ArgumentNullException("gd"); } if (mapGrhWalls == null) { throw new ArgumentNullException("mapGrhWalls"); } if (createWall == null) { throw new ArgumentNullException("createWall"); } if (gd is AutomaticAnimatedGrhData) { throw new ArgumentException("Cannot edit an AutomaticAnimatedGrhData.", "gd"); } DeleteOnCancel = deleteOnCancel; WasCanceled = false; // Set the local members _createWall = createWall; _gd = gd; _mapGrhWalls = mapGrhWalls; _grh = new Grh(gd, AnimType.Loop, TickCount.Now); InitializeComponent(); ShowGrhInfo(); }