예제 #1
0
        public AddNewEntryWindow(Group currentGroup, IPreviewNewEntry previewNewEntry)
        {
            m_previewNewEntry = previewNewEntry;

            InitializeComponent();

            m_currentGroup = currentGroup;
            textBlockGroupName.Text = m_currentGroup.Name;
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var collectionViewSourceGroups = (CollectionViewSource)(this.FindResource("collectionViewSourceGroups"));
            collectionViewSourceGroups.Source = (from x in DictionaryEntities.Singleton.Groups
                                                 orderby x.TimeStamp descending
                                                 select x).ToList().AsReadOnly();

            if (Group != null)
            {
                dataGridGroups.SelectedItem = Group;
                Group = null;
            }
        }
예제 #3
0
        private void dataGridGroups_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dataGridGroups.IsEnabled)
                m_currentGroup = dataGridGroups.SelectedItem as Group;

            bool isGroupSelected = (m_currentGroup != null);

            buttonAddNewEntries.IsEnabled = isGroupSelected;
            dataGridEntries.IsEnabled = isGroupSelected;
            updateEntriesDataGrig();
        }
예제 #4
0
        private void HyperlinkCurrentGroup_Click(object sender, RoutedEventArgs e)
        {
            var window = new ChooseGroupWindow();
            window.Group = CurrentGroup;
            window.ShowDialog();

            if (window.Group != null)
            {
                CurrentGroup = window.Group;
            }
        }
예제 #5
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            textBlockCurrentGroup.DataContext = this;

            bool hasGroup = DictionaryEntities.Singleton.Groups.Count() > 0;

            if (hasGroup)
            {
                var timeStamp = DictionaryEntities.Singleton.Groups.Max(x => x.TimeStamp);
                var group = (from x in DictionaryEntities.Singleton.Groups
                             where x.TimeStamp == timeStamp
                             select x).Single();
                CurrentGroup = group;
            }
            else
            {
                buttonReset.Visibility = Visibility.Hidden;
                CurrentGroup = null;
            }
        }
예제 #6
0
        private void dataGridGroups_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Group = (Group)dataGridGroups.SelectedItem;

            Close();
        }
예제 #7
0
 /// <summary>
 /// Create a new Group object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="timeStamp">Initial value of the TimeStamp property.</param>
 public static Group CreateGroup(global::System.Guid id, global::System.String name, global::System.DateTime timeStamp)
 {
     Group group = new Group();
     group.Id = id;
     group.Name = name;
     group.TimeStamp = timeStamp;
     return group;
 }
예제 #8
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGroups(Group group)
 {
     base.AddObject("Groups", group);
 }