/// <summary> /// Sets a two-way binding between the values of the selected tree view model items and the specified multiple selection. <para/> /// When the specified selection changes, the selection states of the view model items will be adapted. /// Likewise, when the selection states of the view model items change, the selection will be adapted. <para/> /// NOTE : If this tree view model already has a bound selection, then the selection binding must be broken first, otherwise an exception will be thrown. <para/> /// NOTE : A single selection binding can be set only if this tree view model item does not allow multiple selection. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="selection"></param> protected void SetSelectionBinding <T>(MultipleSelection <T> selection) { selection.AssertParameterNotNull(nameof(selection)); if (!AllowMultipleSelection) { throw new Exception("Error : Attempting to set a selection binding between a multiple selection and a list of view model which doesn't support multiple selection."); } if (HasBoundSelection) { throw new Exception("Error : Cannot set a selection binding on this list view model instance because one already exists. Break the current selection binding before setting a new one."); } SelectionBinding = new MultipleTreeSelectionBinding <T>(selection); SelectionBinding.Initialize(this); SelectionBinding.SyncItems = SyncItems; }
public MultipleTreeSelectionBinding(MultipleSelection <T> selection) { Selection = selection; }
/// <summary> /// Saves the talent. /// </summary> /// <returns>Talent object</returns> public Talent SaveTalent() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_Talent"; command.Parameters.Add(dbconn.GenerateParameterObj("@TalentID", SqlDbType.Int, TalentID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@TalentTreeID", SqlDbType.Int, TalentTreeID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@TalentName", SqlDbType.VarChar, TalentName.ToString(), 100)); command.Parameters.Add(dbconn.GenerateParameterObj("@TalentDescription", SqlDbType.VarChar, TalentDescription.ToString(), 4000)); command.Parameters.Add(dbconn.GenerateParameterObj("@TalentSpecial", SqlDbType.VarChar, TalentSpecial.ToString(), 1000)); command.Parameters.Add(dbconn.GenerateParameterObj("@TurnSegmentID", SqlDbType.Int, TurnSegmentID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@MultipleSelection", SqlDbType.Int, MultipleSelection.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
/// <summary> /// defines all of the actions /// </summary> public void DefineActions() { Click click = new Click(); Clear clear = new Clear(); Close close = new Close(); Exit exit = new Exit(); Next_Tab next_tab = new Next_Tab(); Previous_Tab previous_tab = new Previous_Tab(); WindowsCtrlTab wtab = new WindowsCtrlTab(); Idle idle = new Idle(); Next_Selection nextSelection = new Next_Selection(); Previous_Selection previousSelection = new Previous_Selection(); Scroll_Down scrollDown = new Scroll_Down(); Scroll_Up scrollUp = new Scroll_Up(); MousePress mousePress = new MousePress(); MouseRelease mouseRelease = new MouseRelease(); MultipleSelection multipleSelection = new MultipleSelection(); Maximize maximize = new Maximize(); Minimize minimize = new Minimize(); Lock locking = new Lock(); Unlock unlocking = new Unlock(); Undo undo = new Undo(); Redo redo = new Redo(); Open open = new Open(); //defining the click actions QlikMove.StandardHelper.ActionCore.Action clickAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.SIMPLE_SELECTION, new ActionPart[1] { click }); this.AddAction(clickAction); //defining the mouse press actions QlikMove.StandardHelper.ActionCore.Action mousePressedAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.MOUSE_PRESS, new ActionPart[1] { mousePress }); this.AddAction(mousePressedAction); //defining the mouse release actions QlikMove.StandardHelper.ActionCore.Action mouseReleasedAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.MOUSE_RELEASE, new ActionPart[1] { mouseRelease }); this.AddAction(mouseReleasedAction); //defining the exit action QlikMove.StandardHelper.ActionCore.Action exitAction = new StandardHelper.ActionCore.Action(ActionName.EXIT, new ActionPart[1] { exit }); this.AddAction(exitAction); //defining the next action QlikMove.StandardHelper.ActionCore.Action nextAction = new StandardHelper.ActionCore.Action(ActionName.NEXT_TAB, new ActionPart[1] { next_tab }); this.AddAction(nextAction); //defining the previous action QlikMove.StandardHelper.ActionCore.Action previousAction = new StandardHelper.ActionCore.Action(ActionName.PREVIOUS_TAB, new ActionPart[1] { previous_tab }); this.AddAction(previousAction); //defining the menu action QlikMove.StandardHelper.ActionCore.Action tabsAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.MENU, new ActionPart[1] { wtab }); this.AddAction(tabsAction); //defining the idle action QlikMove.StandardHelper.ActionCore.Action idleAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.IDLE, new ActionPart[1] { idle }); this.AddAction(idleAction); //defining the next selection action QlikMove.StandardHelper.ActionCore.Action nextSelectionAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.NEXT_SELECTION, new ActionPart[1] { nextSelection }); this.AddAction(nextSelectionAction); //defining the previous selection action QlikMove.StandardHelper.ActionCore.Action previousSelectionAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.PREVIOUS_SELECTION, new ActionPart[1] { previousSelection }); this.AddAction(previousSelectionAction); //defining the scrolling down action QlikMove.StandardHelper.ActionCore.Action scrollDownAction = new StandardHelper.ActionCore.Action(ActionName.SCROLL_DOWN, new ActionPart[1] { scrollDown }); this.AddAction(scrollDownAction); //defining the scrolling up action QlikMove.StandardHelper.ActionCore.Action scrollUpAction = new StandardHelper.ActionCore.Action(ActionName.SCROLL_UP, new ActionPart[1] { scrollUp }); this.AddAction(scrollUpAction); //defining the multiple selection action QlikMove.StandardHelper.ActionCore.Action multipleSelectionAction = new StandardHelper.ActionCore.Action(ActionName.MULTIPLE_SELECTION, new ActionPart[1] { multipleSelection }); this.AddAction(multipleSelectionAction); //defining the maximize action QlikMove.StandardHelper.ActionCore.Action maximizeAction = new StandardHelper.ActionCore.Action(ActionName.MAX, new ActionPart[1] { maximize }); this.AddAction(maximizeAction); //defining the minimize action QlikMove.StandardHelper.ActionCore.Action minimizeAction = new StandardHelper.ActionCore.Action(ActionName.MIN, new ActionPart[1] { minimize }); this.AddAction(minimizeAction); //defining the clear action QlikMove.StandardHelper.ActionCore.Action clearAction = new StandardHelper.ActionCore.Action(ActionName.CLEAR, new ActionPart[1] { clear }); this.AddAction(clearAction); //defining the undo action QlikMove.StandardHelper.ActionCore.Action undoAction = new StandardHelper.ActionCore.Action(ActionName.UNDO, new ActionPart[1] { undo }); this.AddAction(undoAction); //defining the redo action QlikMove.StandardHelper.ActionCore.Action redoAction = new StandardHelper.ActionCore.Action(ActionName.REDO, new ActionPart[1] { redo }); this.AddAction(redoAction); //defining the locking action QlikMove.StandardHelper.ActionCore.Action lockingAction = new StandardHelper.ActionCore.Action(ActionName.LOCK, new ActionPart[1] { locking }); this.AddAction(lockingAction); //defining the unlocking action QlikMove.StandardHelper.ActionCore.Action unlockingAction = new StandardHelper.ActionCore.Action(ActionName.UNLOCK, new ActionPart[1] { unlocking }); this.AddAction(unlockingAction); //defining the close action QlikMove.StandardHelper.ActionCore.Action closeAction = new StandardHelper.ActionCore.Action(ActionName.CLOSE, new ActionPart[1] { close }); this.AddAction(closeAction); //defining the open action QlikMove.StandardHelper.ActionCore.Action openAction = new StandardHelper.ActionCore.Action(ActionName.OPEN, new ActionPart[1] { open }); this.AddAction(openAction); LogHelper.logInput("Actions defined", LogHelper.logType.INFO, this); }