public void CrossFromServer(int[] ServerIndex, int ServerID)
        {
            StateUpdate(2, ServerID);

            List<Collab> total = new List<Collab>();
            do
            {
                List<string> temp = UserAddedContents.Keys.ToList();
                foreach (string key in temp)
                {
                    total.AddRange(UserAddedContents[key]);
                }
            } while (false);

            int _listFirstIndex = total.FindIndex(x => x.Id == ServerID);
            Collab _editItem = total[_listFirstIndex];

            TimeSpan _span = (_editItem.EndDate - _editItem.StartDate); int _spandays = _span.Days + 1;

            Grid _overlapGrid = new Grid();

            RowDefinition row = new RowDefinition(); _overlapGrid.RowDefinitions.Add(row);
            ColumnDefinition column = new ColumnDefinition(); _overlapGrid.ColumnDefinitions.Add(column);
            _overlapGrid.Tag = ServerID;

            Button undo = new Button
            {
                Tag = ServerID,
                Background = Brushes.Transparent,
                BorderBrush = Brushes.Transparent,
                ToolTip = "Undo Missed",
                Content = new Image
                {
                    Width = 35,
                    Height = 35,
                    VerticalAlignment = VerticalAlignment.Center,
                    Source = new BitmapImage(new Uri("/Resources/undoCross.png", UriKind.Relative))
                }
            }; Grid.SetColumn(undo, 0); Grid.SetRow(undo, 0); _overlapGrid.Children.Add(undo); undo.Click += UndoClick;
            _overlapGrid.Background = Brushes.Transparent;
            Grid.SetRow(_overlapGrid, ServerIndex[0]); Grid.SetColumn(_overlapGrid, ServerIndex[1]); Grid.SetColumnSpan(_overlapGrid, _spandays);
            _overlapGrid.Style = (Style)FindResource("UndoStyle");
            GridsAddedToProject[_editItem.Discipline.ToUpper()].Children.Add(_overlapGrid);
        }
Exemplo n.º 2
0
        public UserContent(DateTime _startdatepicker, Collab IncomingContent, Dictionary <string, string> disciplines, Dictionary <string, SolidColorBrush> _discCol)
        {
            InitializeComponent();

            StartDateCntntBox.DisplayDateStart = _startdatepicker;
            EndDateCntntBox.DisplayDateStart   = _startdatepicker;
            StartDateCntntBox.SelectedDate     = IncomingContent.StartDate;
            EndDateCntntBox.SelectedDate       = IncomingContent.EndDate;

            discBox.ItemsSource     = disciplines.Keys;
            DisciplineColorsContent = disciplines;
            DisciplineColors        = _discCol;
            discColor.ItemsSource   = _discCol;

            discBox.SelectedIndex        = discBox.Items.IndexOf(IncomingContent.Discipline);
            discColor.SelectedIndex      = discColor.Items.IndexOf(IncomingContent.DisciplineColor);
            ContentBoxEntry.TextBoxEntry = IncomingContent.Content;

            discColor.IsEnabled = false;
            _edit = true;
        }