Exemple #1
0
        public SelectArsnovaTypeViewViewModel(ViewModelRequirements requirements)
            : base(requirements)
        {
            this.InitializeWindowCommandBindings();

            if (string.IsNullOrEmpty(this.SlideSessionModel.Hashtag))
            {
                var presentationName = Globals.ThisAddIn.Application.ActivePresentation.Name;
                var hashtagList      = requirements.SessionInformationProvider.GetHashtagList();

                while (hashtagList.Any(h => h.ToLower() == presentationName.ToLower()))
                {
                    var lastChar = presentationName.LastOrDefault();
                    if (char.IsNumber(lastChar))
                    {
                        var newNum = int.Parse(lastChar.ToString());
                        newNum++;
                        presentationName = presentationName.Substring(0, presentationName.Length - 1) + newNum;
                    }
                    else
                    {
                        presentationName += "1";
                    }
                }

                this.SlideSessionModel.Hashtag = presentationName;
            }
        }
        public AnswerOptionViewViewModel(ViewModelRequirements requirements, Guid questionId, bool isNew, SlideQuestionModel questionBeforeEdit)
            : base(requirements)
        {
            this.questionId         = questionId;
            this.isNew              = isNew;
            this.questionBeforeEdit = questionBeforeEdit;

            this.InitializeWindowCommandBindings();

            this.InitAnswerOptionList();
        }
Exemple #3
0
        public SessionOverviewViewViewModel(ViewModelRequirements requirements) : base(requirements)
        {
            this.InitializeWindowCommandBindings();

            foreach (var questionModel in this.SlideSessionModel.Questions)
            {
                questionModel.ObjectChangedEventHandler += delegate
                {
                    this.OnPropertyChanged(nameof(this.Questions));
                };
            }
        }
        protected BaseViewModel(ViewModelRequirements requirements)
        {
            this.ViewPresenter              = requirements.ViewPresenter;
            this.QuestionTypeTranslator     = requirements.QuestionTypeTranslator;
            this.LocalizationService        = requirements.LocalizationService;
            this.SessionManager             = requirements.SessionManager;
            this.SessionInformationProvider = requirements.SessionInformationProvider;
            this.SlideManipulator           = requirements.SlideManipulator;
            this.RibbonHelper = new RibbonHelper(this.ViewPresenter, this.LocalizationService);

            this.SlideSessionModel = requirements.SlideSessionModel;
        }
Exemple #5
0
        public QuestionViewViewModel(ViewModelRequirements requirements, Guid questionId, bool isNew, SlideQuestionModel questionBeforeEdit = null)
            : base(requirements)
        {
            this.questionId = questionId;
            this.isNew      = isNew;

            this.questionBeforeEdit = questionBeforeEdit ?? CopyHelper.CopySlideQuestionModel(this.SlideQuestionModel);

            this.InitializeWindowCommandBindings();

            this.QuestionTypes = this.SlideSessionModel.SessionType == SessionType.ArsnovaClick
                ? this.SessionInformationProvider.GetAvailableQuestionsClick()
                : this.SessionInformationProvider.GetAvailableQuestionsVoting();

            this.ExcelChartTypes = this.SessionInformationProvider.GetExcelChartTypes();
        }