コード例 #1
0
        /// <summary>
        /// When files are presented for ReviewData, different icons are placed beside each filename.
        /// The basic symbol for 'In Progress' files is a green triangle.  The basic symbol for 'Completed'
        /// files is a blue square.  Special circumstances dictate that different symbols than these are used:
        ///   -
        /// </summary>
        /// <param name="basename"></param>
        /// <param name="baseIndex"></param>
        /// <returns></returns>
        private int CheckListImageIndex(string basename, int baseIndex)
        {
            int index = baseIndex; // Default value

            _ActivePollSummary activePollSummary = CFSysInfo.Data.Summaries.ActivePolls.Find_PollSummary(basename);

            if (activePollSummary != null)
            {
                if (activePollSummary.NumQuestions == 0)
                {
                    index = 0;
                }

                else if (activePollSummary.NumResponses == 0)
                {
                    index = 1;
                }

                else if (!activePollSummary.ReviewData)
                {
                    index = 4;
                }
            }

            return(index);
        }
コード例 #2
0
 // Sometimes most/all of the property values are already known.  This constructor allows them to be quickly set.
 public _ActivePollSummary(_ActivePollSummary summary)
 {
     Filename     = summary.Filename;
     Revision     = summary.Revision;
     PollSummary  = summary.PollSummary;
     ReviewData   = summary.ReviewData;
     NumQuestions = summary.NumQuestions;
     NumResponses = summary.NumResponses;
 }
コード例 #3
0
        /// <summary>
        /// Retrieves the top-level information about the specified poll.  First it tries to get it from CFSysInfo, but if it's not
        /// present then it queries the file itself for the data, and populates CFSysInfo to save this extra step the next time.
        /// </summary>
        /// <param name="filename"></param>          // This is the full pathname
        /// <param name="revision"></param>
        /// <param name="pollSummary"></param>
        /// <param name="reviewData"></param>
        /// <param name="questionCount"></param>
        /// <param name="respondentCount"></param>
        public void GetPollDetails(string filename, out int revision, out string pollSummary, out bool reviewData, out int questionCount, out int respondentCount)
        {
            string basename = Tools.StripPathAndExtension(filename);

            // Assign default values to out parameters
            pollSummary     = "";
            revision        = 0;
            reviewData      = true;
            questionCount   = 0;
            respondentCount = 0; // Note: Not used by Templates, only Active Polls

            // See if we're starting a new poll, and thus looking at templates
            if (OpenMode == SelectFileMode.RunPoll && NewPoll)
            {
                _TemplateSummary templateSummary = CFSysInfo.Data.Summaries.Templates.Find_Template(basename);
                if (templateSummary != null)
                {
                    revision      = templateSummary.Revision;
                    pollSummary   = templateSummary.PollSummary;
                    questionCount = templateSummary.NumQuestions;
                }
                else // Not in Summaries yet so get directly from the poll itself and then store this info in Summaries
                {
                    Cursor.Current = Cursors.WaitCursor;
                    string pollGuid     = "";
                    string lastEditGuid = "";
                    Tools.GetPollOverview(filename, out revision, out pollSummary, out questionCount, out pollGuid, out lastEditGuid);
                    templateSummary = new _TemplateSummary(basename, revision, pollSummary, questionCount, pollGuid, lastEditGuid);
                    CFSysInfo.Data.Summaries.Templates.Add(templateSummary);
                }
            }

            else // Either Resuming an existing poll (in Data) or Reviewing a poll (in Data)
            {
                _ActivePollSummary activePollSummary = CFSysInfo.Data.Summaries.ActivePolls.Find_PollSummary(basename);

                if (activePollSummary != null)
                {
                    pollSummary     = activePollSummary.PollSummary;
                    revision        = activePollSummary.Revision;
                    reviewData      = activePollSummary.ReviewData;
                    questionCount   = activePollSummary.NumQuestions;
                    respondentCount = activePollSummary.NumResponses;
                }
                else // Not in Summaries yet so get directly from the poll itself and then store this info in Summaries
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Tools.GetPollOverview(filename, out revision, out pollSummary, out reviewData, out questionCount, out respondentCount);
                    activePollSummary = new _ActivePollSummary(basename, revision, pollSummary, reviewData, questionCount, respondentCount);
                    CFSysInfo.Data.Summaries.ActivePolls.Add(activePollSummary);
                }
            }
        }
コード例 #4
0
            // Searches the Active Poll Summaries in the collection for one with the specified filename.
            // Returns 'true' if found, 'false' otherwise.
            public bool ContainsFilename(string filename)
            {
                for (int i = 0; i < List.Count; i++)
                {
                    _ActivePollSummary summary = (_ActivePollSummary)List[i];
                    if (summary.Filename.ToLower() == filename.ToLower())
                    {
                        return(true);
                    }
                }

                return(false); // If reaches here then a entry with the specified filename was not found
            }
コード例 #5
0
            // Searches the Active Poll Summaries in the collection for an object with the specified filename.
            // Returns the Summary object if it finds it, otherwise 'null'.
            public _ActivePollSummary Find_PollSummary(string filename)
            {
                for (int i = 0; i < List.Count; i++)
                {
                    _ActivePollSummary summary = (_ActivePollSummary)List[i];
                    if (summary.Filename.ToLower() == filename.ToLower())
                    {
                        return(summary);
                    }
                }

                return(null); // If reaches here then a Summary object with the specified filename was not found
            }
コード例 #6
0
 // Returns the index position that the 'value' occupies in the collection.
 public int IndexOf(_ActivePollSummary value)
 {
     return(base.IndexOf(value));
 }
コード例 #7
0
 public bool Contains(_ActivePollSummary value)
 {
     return(base.Contains(value));
 }
コード例 #8
0
 public void Remove(_ActivePollSummary value)
 {
     base.Remove(value);
 }
コード例 #9
0
 public void Insert(int index, _ActivePollSummary value)
 {
     base.Insert(index, value);
 }
コード例 #10
0
            public int Add(_ActivePollSummary value)
            {
                int index = base.Add(value);

                return(index);
            }