예제 #1
0
        private void EditVar(object sender, RoutedEventArgs e)
        {
            if (grdVariables.CurrentItem != null && grdVariables.CurrentItem.ToString() != "{NewItemPlaceholder}")
            {
                VariableBase selectedVarb = (VariableBase)grdVariables.CurrentItem;
                selectedVarb.NameBeforeEdit = selectedVarb.Name;
                VariableEditPage.eEditMode mode = VariableEditPage.eEditMode.Default;
                switch (mVariablesLevel)// variable page is generic so need to change editmode as per type of variable.
                {
                case eVariablesLevel.BusinessFlow:
                case eVariablesLevel.Activity:
                    mode = VariableEditPage.eEditMode.Default;
                    break;

                case eVariablesLevel.Solution:
                    mode = VariableEditPage.eEditMode.Global;
                    break;
                }
                VariableEditPage w = new VariableEditPage(selectedVarb, mContext, false, mode);
                w.ShowAsWindow(eWindowShowStyle.Dialog);
                RefreshGrid(sender, e);

                if (selectedVarb.NameBeforeEdit != selectedVarb.Name)
                {
                    UpdateVariableNameChange(selectedVarb);
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.AskToSelectVariable);
            }
        }
예제 #2
0
        private void VariablesGrid_grdMain_MouseDoubleClick(object sender, EventArgs e)
        {
            VariableBase selectedVarb = (VariableBase)grdVariables.CurrentItem;
            selectedVarb.NameBeforeEdit = selectedVarb.Name;

            VariableEditPage w = new VariableEditPage(selectedVarb, false);
            w.ShowAsWindow(eWindowShowStyle.Dialog);

            if (selectedVarb.NameBeforeEdit != selectedVarb.Name)
                UpdateVariableNameChange(selectedVarb);
        }
예제 #3
0
 private void XSharedRepoTabListView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (xSharedRepoTabListView.CurrentItem != null)
     {
         VariableEditPage w = new VariableEditPage((VariableBase)xSharedRepoTabListView.CurrentItem, mContext, false, VariableEditPage.eEditMode.SharedRepository);
         w.ShowAsWindow(eWindowShowStyle.Dialog);
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.AskToSelectVariable);
     }
 }
예제 #4
0
        private void AddVariable()
        {
            VariableBase newVar = (VariableBase)((VariableBase)VariablesGrid.CurrentItem).CreateCopy();

            if (mVariablesParentObj != null)
            {
                switch (mVariablesLevel)
                {
                case eVariablesLevel.Solution:
                    ((Solution)mVariablesParentObj).AddVariable(newVar);
                    break;

                case eVariablesLevel.BusinessFlow:
                    ((BusinessFlow)mVariablesParentObj).AddVariable(newVar);
                    break;

                case eVariablesLevel.Activity:
                    ((Activity)mVariablesParentObj).AddVariable(newVar);
                    break;
                }
            }
            else
            {
                return;
            }

            VariableEditPage varEditPage = new VariableEditPage(newVar, mContext);

            _pageGenericWin.Close();
            varEditPage.ShowAsWindow(eWindowShowStyle.Dialog);

            //make sure name is unique
            switch (mVariablesLevel)
            {
            case eVariablesLevel.Solution:
                ((Solution)mVariablesParentObj).SetUniqueVariableName(newVar);
                break;

            case eVariablesLevel.BusinessFlow:
                ((BusinessFlow)mVariablesParentObj).SetUniqueVariableName(newVar);
                break;

            case eVariablesLevel.Activity:
                ((Activity)mVariablesParentObj).SetUniqueVariableName(newVar);
                break;
            }
        }
예제 #5
0
        private void VariablesGrid_grdMain_MouseDoubleClick(object sender, EventArgs e)
        {
            VariableBase selectedVarb = (VariableBase)grdVariables.CurrentItem;

            selectedVarb.NameBeforeEdit = selectedVarb.Name;
            VariableEditPage.eEditMode editMode = VariableEditPage.eEditMode.Default;
            if (mContext != null && mContext.BusinessFlow == null)
            {
                editMode = VariableEditPage.eEditMode.SharedRepository;
            }
            if (mVariablesLevel == eVariablesLevel.Solution)
            {
                editMode = VariableEditPage.eEditMode.Global;
            }
            VariableEditPage w = new VariableEditPage(selectedVarb, mContext, false, editMode);

            w.ShowAsWindow(eWindowShowStyle.Dialog);

            if (selectedVarb.NameBeforeEdit != selectedVarb.Name)
            {
                UpdateVariableNameChange(selectedVarb);
            }
        }