Exemple #1
0
		private void AddItemsToFlow()
		{
			_title = new DictionaryStatusControl(_lexEntryRepository.CountAllItems());
			_title.Font = new Font("Arial", 14);
			_title.BackColor = Color.Transparent;
			_title.ShowLogo = true;
			_title.Width = _flow.Width - _title.Margin.Left - _title.Margin.Right;
			_title.TabStop = false;
			_flow.Controls.Add(_title);

			foreach (ButtonGroup group in _buttonGroups)
			{
				AddButtonGroupToFlow(group);
			}
			_addedAllButtons = true;
		}
Exemple #2
0
		public void Activate()
		{
			if (IsActive)
			{
				throw new InvalidOperationException(
						"Activate should not be called when object is active.");
			}
			InitializeComponent();
			SuspendLayout();
			_panel.SuspendLayout();
			_panel.Controls.Clear();
			InitializeProjectNameLabel();
			int entriesCount = _lexEntryRepository.CountAllItems();
			ItemsToDoIndicator.MakeAllInstancesSameWidth(entriesCount);
			DictionaryStatusControl status = new DictionaryStatusControl(entriesCount);
			_panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
			_panel.Controls.Add(status);

			ITask currentWorkTask = _currentWorkTaskProvider.CurrentWorkTask;
			if (currentWorkTask != null)
			{
				TaskIndicator currentTaskIndicator = TaskIndicatorFromTask(currentWorkTask);
				_currentTaskIndicator = new CurrentTaskIndicatorControl(currentTaskIndicator);
				_currentTaskIndicator.Anchor = AnchorStyles.Left | AnchorStyles.Right |
											   AnchorStyles.Top;
				_currentTaskIndicator.Margin = new Padding(0, 0, 15, 5);
				_panel.Controls.Add(_currentTaskIndicator);
			}

			IList<ITask> taskList = ((WeSayWordsProject) BasilProject.Project).Tasks;

#if WantToShowIndicatorsForPinnedTasks
			foreach (ITask task in taskList)
			{
				if (task != this && task.IsPinned)
				{
					AddIndicator(TaskIndicatorFromTask(task));
				}
			}
#endif
			int count = 0;
			foreach (ITask task in taskList)
			{
				if (task != this && !task.IsPinned) // && (task != currentWorkTask))
				{
					count++;
				}
			}

			if (count > 1 || currentWorkTask == null)
			{
#if WantToShowIndicatorsForPinnedTasks
				GroupHeader header = new GroupHeader();
				header.Name = StringCatalog.Get("~Tasks");
				AddGroupHeader(header);
#endif

				foreach (ITask task in taskList)
				{
					if (task != this && !task.IsPinned && (task != currentWorkTask))
					{
						AddIndicator(TaskIndicatorFromTask(task));
					}
				}
			}

			_isActive = true;
			_panel.ResumeLayout(false);
			ResumeLayout(true);
		}