text stringlengths 1 22.8M |
|---|
Dorji Dema (born October 16, 1983) is an athlete from Bhutan who competes in archery.
At the 2008 Summer Olympics in Beijing Dema finished her ranking round with a total of 567 points. This gave her the 61st seed for the final competition bracket in which she faced Khatuna Narimanidze in the first round. The archer from Georgia was too strong and won the confrontation with 107-97, eliminating Dema straight away.
References
External links
1983 births
Living people
People from Thimphu
Olympic archers for Bhutan
Archers at the 2008 Summer Olympics
Bhutanese female archers
Archers at the 1998 Asian Games
Archers at the 2002 Asian Games
Archers at the 2006 Asian Games
Asian Games competitors for Bhutan |
Eyre Hutson (1830–1915) was an Anglican priest: most notably Archdeacon of the Virgin Islands from 1885 until his death.
He was born in Barbados on 6 September 1830. He was educated at Codrington College and ordained in 1855. After curacies in Trinidad and Barbados he was Chaplain to the Bishop of Antigua from 1879 until his appointment as Archdeacon with the Rectory of All Saint's, Danish West Indies.
His son Edward was Bishop of Antigua from 1911 until 1936; and Archbishop of the West Indies from 1922. Another son Eyre was Governor of British Honduras 1918 to 1925. A third son John Hutson was President of the Legislative Council of Barbados. His daughter Susan was the mother of grandson Archdeacon of Antigua from 1906 until 1921.
Notes
1830 births
19th-century Anglican priests
20th-century Anglican priests
Archdeacons of the Virgin Islands
Alumni of Codrington College
Barbadian religious leaders
1915 deaths |
André van der Merwe is a conductor, choral music arranger, and composer from Durbanville, Western Cape, South Africa. He studied for his Bachelor of Music at the University of Cape Town but due to an injury he changed his studies to a Bachelor of Drama (Directing) at the Stellenbosch University He served as the chairperson of the National Artistic Committee the 2018 World Choir Games held in Tshwane, South Africa.
He is currently the conductor of the Stellenbosch University Choir, the Stellenberg Girls Choir and his adult choir, Voces Cordis. The Stellenbosch University Choir has been voted best in the world by Interkultur most of the years between 2012 and 2020.
References
Living people
South African conductors (music)
Year of birth missing (living people)
People from the Western Cape
21st-century conductors (music) |
Thomas Andrew Detwiler (November 24, 1969 – September 21, 2022), also known as Harmless Farmer, was an American farmer who lost both of his arms in an accident as a very young child, and was known for his YouTube videos.
Biography
Detwiler was born in Urbana, Ohio, the son of a farmer and a middle school teacher. He had a sister and a brother. At the age of two, his paternal grandfather was working on a screw conveyor. Detwiler came up to his grandfather and imitated him, but came too close to the screw conveyor, losing both of his arms and receiving cuts to his face. He was rushed to the hospital.
At the age of nine, Detwiler was recognized by Ace Elliott who worked for the Dayton Daily News, in which Elliott noted that Detwiler could write with his legs. Detwiler attended Salem Elementary School and West Liberty-Salem High School, graduating in 1988.
Detwiler decided to make a YouTube channel on March 3, 2016. His first video, called Welcome to the Farm, was posted on November 1, 2018. He thought of receiving money while making YouTube videos for which he had gained popularity while his channel was receiving views in YouTube. He and his wife, Corkey Wallace, had one child, a daughter, Kylie Detwiler.
In 2020, Detwiler announced that he had been diagnosed with esophageal cancer. He then was afflicted with pneumonia and suffered an aneurysm. His last video was called New Tires For The Oliver 1600, which was posted on September 17, 2022. Detwiler died from the aneurysm on September 21, 2022, in Urbana, Ohio, aged 52.
References
1969 births
2022 deaths
People from Urbana, Ohio
Farmers from Ohio
Deaths from aneurysm
American YouTubers
20th-century American people
21st-century American people |
The Best Coach/Manager ESPY Award has been presented annually since 1993 to the head coach or manager of a team contesting play in a professional North American or collegiate sports league adjudged to be the best in a given calendar year.
Between 1993 and 2004, the award voting panel comprised variously fans; sportswriters and broadcasters, sports executives, and retired sportspersons, termed collectively experts; and ESPN personalities, but balloting thereafter has been exclusively by fans over the Internet from amongst choices selected by the ESPN Select Nominating Committee.
Through the 2001 iteration of the ESPY Awards, ceremonies were conducted in February of each year to honor achievements over the previous calendar year; awards presented thereafter are conferred in July and reflect performance from the June previous. The award wasn't awarded in 2020 due to the COVID-19 pandemic.
List of winners
See also
Jack Adams Award
MLS Coach of the Year Award
Major League Baseball Manager of the Year Award, The Sporting News Manager of the Year Award
National Basketball Association Coach of the Year Award
National Football League Coach of the Year Award
Clair Bee Coach of the Year Award, Henry Iba Award, Naismith College Coach of the Year Award (collegiate basketball)
Paul "Bear" Bryant Award, Walter Camp Coach of the Year Award, Bobby Dodd Coach of the Year Award (collegiate football)
Notes
References
ESPY Awards
Coaching awards
Awards established in 1993 |
The 2016 FIBA U20 European Championship was the 19th edition of the FIBA U20 European Championship. The competition took place in Helsinki, Finland, from 16 to 24 July 2016.
Participating teams
(Winners, 2015 FIBA Europe Under-20 Championship Division B)
(3rd place, 2015 FIBA Europe Under-20 Championship Division B)
(Runners-up, 2015 FIBA Europe Under-20 Championship Division B)
First round
In this round, the 16 teams are allocated in four groups of four teams each. All teams will advance to the Second Round of 16.
Group A
Group B
Group C
Group D
Final round
Round of 16
9th–16th place classification
9th–16th place quarterfinals
13th–16th place semifinals
15th place game
13th place game
9th–12th place semifinals
Eleventh place game
Ninth place game
Quarterfinals
5th–8th place classification
5th–8th place semifinals
Seventh place game
Fifth place game
Semifinals
Third place game
Final
Final standings
Awards
All-Tournament Team
Francis Alonso
Marc García
Kristupas Zemaitis
Lauri Markkanen
Ömer Yurtseven
References
External links
FIBA official website
2016–17 in European basketball
2016–17 in Finnish basketball
International youth basketball competitions hosted by Finland
2016
International sports competitions in Helsinki
July 2016 sports events in Europe
2010s in Helsinki |
```smalltalk
using System;
using NUnit.Framework;
using UnityEngine;
namespace UnityEditor.ShaderGraph.UnitTests
{
[TestFixture]
public class PixelShaderNodeTests
{
/* private UnityEngine.MaterialGraph.MaterialGraph m_Graph;
private Vector1Node m_InputOne;
private AbsoluteNode m_Abs;
private MetallicMasterNode m_PixelNode;
[TestFixtureSetUp]
public void RunBeforeAnyTests()
{
Debug.unityLogger.logHandler = new ConsoleLogHandler();
}
[SetUp]
public void TestSetUp()
{
m_Graph = new UnityEngine.MaterialGraph.MaterialGraph();
m_PixelNode = new MetallicMasterNode();
m_InputOne = new Vector1Node();
m_Abs = new AbsoluteNode();
m_Graph.AddNode(m_PixelNode);
m_Graph.AddNode(m_InputOne);
m_Graph.AddNode(m_PixelNode);
m_Graph.AddNode(m_Abs);
m_InputOne.value = 0.2f;
m_Graph.Connect(m_InputOne.GetSlotReference(Vector1Node.OutputSlotId), m_PixelNode.GetSlotReference(AbstractSurfaceMasterNode.NormalSlotId));
// m_Graph.Connect(m_InputOne.GetSlotReference(Vector1Node.OutputSlotId), m_Abs.GetSlotReference(Function1Input.InputSlotId));
//m_Graph.Connect(m_Abs.GetSlotReference(Function1Input.OutputSlotId), m_PixelNode.GetSlotReference(AbstractSurfaceMasterNode.AlbedoSlotId));
}
[Test]
public void TestNodeGeneratesCorrectNodeCode()
{
string expected = string.Format("half {0} = 0.2;" + Environment.NewLine
+ "half {1} = abs ({0});" + Environment.NewLine
+ "o.Albedo = {1};" + Environment.NewLine
+ "o.Normal = {0};" + Environment.NewLine
, m_InputOne.GetVariableNameForSlot(Vector1Node.OutputSlotId)
, m_Abs.GetVariableNameForSlot(Function1Input.OutputSlotId));
var generator = new ShaderGenerator();
m_PixelNode.GenerateNodeCode(generator, GenerationMode.ForReals);
Console.WriteLine(generator.GetShaderString(0));
Assert.AreEqual(expected, generator.GetShaderString(0));
Assert.AreEqual(string.Empty, generator.GetPragmaString());
}*/
}
}
``` |
```xml
import * as React from 'react';
import { styled } from '@mui/material/styles';
import { IconButton } from '@mui/material';
import ActionHide from '@mui/icons-material/RemoveCircleOutline';
import clsx from 'clsx';
import { useResourceContext, useTranslate } from 'ra-core';
export const FilterFormInput = props => {
const { filterElement, handleHide, className } = props;
const resource = useResourceContext(props);
const translate = useTranslate();
return (
<Root
data-source={filterElement.props.source}
className={clsx('filter-field', className)}
>
{React.cloneElement(filterElement, {
resource,
record: emptyRecord,
size: filterElement.props.size ?? 'small',
helperText: false,
// ignore defaultValue in Field because it was already set in Form (via mergedInitialValuesWithDefaultValues)
defaultValue: undefined,
})}
{!filterElement.props.alwaysOn && (
<IconButton
className={clsx(
'hide-filter',
FilterFormInputClasses.hideButton
)}
onClick={handleHide}
data-key={filterElement.props.source}
title={translate('ra.action.remove_filter')}
size="small"
>
<ActionHide />
</IconButton>
)}
<div className={FilterFormInputClasses.spacer}> </div>
</Root>
);
};
const PREFIX = 'RaFilterFormInput';
export const FilterFormInputClasses = {
spacer: `${PREFIX}-spacer`,
hideButton: `${PREFIX}-hideButton`,
};
const Root = styled('div', {
name: PREFIX,
overridesResolver: (props, styles) => styles.root,
})(({ theme }) => ({
display: 'flex',
alignItems: 'flex-end',
pointerEvents: 'auto',
[theme.breakpoints.down('sm')]: {
width: '100%',
},
[`& .${FilterFormInputClasses.spacer}`]: { width: theme.spacing(2) },
[`& .${FilterFormInputClasses.hideButton}`]: {
marginBottom: theme.spacing(1),
},
}));
const emptyRecord = {};
``` |
The men's road race at the 1932 UCI Road World Championships was the sixth edition of the event. The race took place on Wednesday 31 August 1932 in Rome, Italy. The race was won by Alfredo Binda of Italy.
Final classification
References
Men's Road Race
UCI Road World Championships – Men's road race |
Dearnaley is a surname. Notable people with the surname include:
George Dearnaley (born 1969), South African soccer player
Irvine Dearnaley (1877–1965), British cricketer
See also
Dearnley
Surnames of English origin |
Raja Zarith Sofiah binti Almarhum Sultan Idris Al-Mutawakkil Alallahi Shah (born 14 August 1959) is the Permaisuri (Queen consort) of Johor. She was born as a member of the Perak royal family. While still attending Somerville College, Oxford, she married the heir to the throne of Johor. Now a mother of six, she participates in the work of non-governmental organisations and universities, and writes a periodical column for a newspaper.
Early life and education
Raja Zarith Sofiah was born in Batu Gajah Hospital, Perak on 14 August 1959 as the third child and second daughter of Sultan Idris Shah II of Perak and Raja Perempuan Muzwin binti Raja Arif Shah. Her parents were first step-cousins once removed. She is a second step-cousin of Sultan Azlan Shah of Perak. Sultan Azlan's paternal grandfather, her paternal grandfather and her mother's paternal grandfather were children of Sultan Idris Shah I of Perak, all with different mothers.
She attended Datin Khadijah Primary School and then Raja Perempuan Kelsom School in Kuala Kangsar, before moving on to Cheltenham Ladies' College to complete her secondary education. She attended Somerville College, Oxford and obtained her Bachelor of Arts in Chinese studies from the University of Oxford in 1983 and her Master of Arts in 1986.
Current activities
Raja Zarith Sofiah is the chancellor of Universiti Teknologi Malaysia. She is also a Fellow of the School of Language Studies and Linguistics, Universiti Kebangsaan Malaysia (UKM). She delivered the keynote address at the 2011 UKM International Language Conference.
She is the Royal Patron of Oxford University Malaysia Club (beginning Michaelmas 2011).
Raja Zarith is a strong advocate of improving the use of English in Malaysia. In addition to Malay and English, she speaks Mandarin Chinese, Italian and French.
She has authored several children's books, including Puteri Gunung Ledang, and writes for The Star's "Mind Matters" column.
Raja Zarith supports various charitable and non-governmental organisations. She is a patron of the Johor Spastic Children's Association, Rotary Club of Tebrau Heart Fund and the Malaysian English Language Teaching Association. She is also the Chair of the Community Services Committee of the Malaysian Red Crescent Society.
Raja Zarith Sofiah is also active in religious activities. There is a foundation which is named after her which is called Yayasan Raja Zarith Sofiah Negeri Johor. It was launched on 28 November 2012 at the Kuala Lumpur campus of Universiti Teknologi Malaysia The foundation's purpose is to generate funds for various educational programmes. The foundation was set up after the Sultan of Johor and she agreed with the proposal by Universiti Teknologi Malaysia, in line with the Royal Johor Institution, in developing the teachings of Islam.
Marriage and children
On 22 September 1982, Raja Zarith Sofiah married the (then) Tunku Mahkota (Crown Prince) of Johor, Tunku Ibrahim Ismail. Ibrahim Ismail was proclaimed the 25th Sultan of Johor after the death of his father in January 2010. Raja Zarith was addressed as DYMM (HRH), the consort of the Sultan of Johor until her coronation took place. On her coronation day, she was conferred the title Permaisuri of Johor (Queen consort of Johor) with the style as Her Majesty.
She and Sultan Ibrahim have six children:
Tunku Ismail Idris Abdul Majid Abu Bakar, the Tunku Mahkota of Johor (born 30 June 1984)
Tunku Tun Aminah, (born 8 April 1986)
Tunku Idris Iskandar, the Tunku Temenggong of Johor (born 25 December 1987)
Tunku Abdul Jalil, the Tunku Laksamana of Johor (5 July 1990 – 5 December 2015)
Tunku Abdul Rahman, the Tunku Panglima of Johor (born 5 February 1993)
Tunku Abu Bakar, the Tunku Putera of Johor (born 30 May 2001)
Titles and styles
Raja Zarith Sofiah's full style and title in Malay: Raja Zarith Sofiah binti Almarhum Sultan Idris Shah, D.K. (I), D.K. (II), S.P.M.J., S.I.M.J., P.S.I., D.K. (Perak), S.P.C.M. (Perak), Permaisuri Johor
in English: Her Majesty Raja Zarith Sofiah binti Almarhum Sultan Idris Shah, D.K. (I), D.K. (II), S.P.M.J., S.I.M.J., P.S.I., D.K. (Perak), S.P.C.M. (Perak), Permaisuri of Johor
Honours
Honours of Johor
(Zarith Sofiah, Queen of Johor) :
First Class of the Royal Family Order of Johor (DK I)
Second Class of the Royal Family Order of Johor (DK II)
First Class of the Order of the Crown of Johor (SPMJ)
Grand Knight of the Order of Sultan Ibrahim of Johor (SMIJ) – 2017
Sultan Ibrahim Coronation Medal (PSI, 1st class, 23 March 2015)
Honours of Perak
(Zarith Sofiah, née Princess of Perak) :
Recipient of the Royal Family Order of Perak (DK, 22 May 2012)
Grand Knight of the Order of Cura Si Manja Kini (SPCM) – Dato' Seri (March 1983)
Ancestry
References
External links
"Mind Matters" at The Star
Johor royal consorts
Malaysian royal consorts
House of Temenggong of Johor
Royal House of Perak
Living people
1959 births
People from Perak
Malaysian people of Malay descent
Malaysian people of Chinese descent
Malaysian Muslims
People educated at Cheltenham Ladies' College
People associated with the National University of Malaysia
Alumni of Somerville College, Oxford
Daughters of monarchs
First Classes of the Royal Family Order of Johor
Knights Grand Commander of the Order of the Crown of Johor |
Reonal vs. Brown is a United States Court of Appeals for Veterans Claims case that dealt with the credibility and weight assigned to medical opinions.
Background
Bartolome R. Reonal served as a Philippine Scout from July 1946 to March 1947. His service medical records showed that he had broken his femur prior to service. He ended being medically discharged due to this pre-existing condition.
After service, Mr. Reonal claimed service connection for this condition. He was initially denied service connection and multiple attempts to reopen the claim were also denied. In 1988, he filed again for service connection, this time submitting a report from a doctor that stated that the condition was acquired during service and that this condition was documented on a separation report from the 20th Station Hospital at Pasig, Rizal, Philippines. The VA Regional Office did not reopen the claim once again and the Board of Veterans' Appeals (BVA) affirmed this decision. BVA noted that the medical opinion was based solely on the history of the claimant and that the doctor had not reviewed the service medical records.
Analysis
The Court noted that the presumption of credibility did not apply to the medical opinion provided, since it was provided on lay history alone and was in direct opposition to the documented medical history presented in the service medical records. Since the medical opinion was flawed, it did not serve to reopen the claim, as it did not have a reasonable possibility of changing the outcome of the final decision.
Decision
The Court affirmed the BVA decision and the claim was not reopened.
References
United States Court of Appeals for Veterans Claims cases
1993 in United States case law |
```smalltalk
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Security;
using System.Text;
using Microsoft.Toolkit.Uwp.UI.Automation.Peers;
using Microsoft.Toolkit.Uwp.UI.Controls.DataGridInternals;
using Microsoft.Toolkit.Uwp.UI.Controls.Primitives;
using Microsoft.Toolkit.Uwp.UI.Controls.Utilities;
using Microsoft.Toolkit.Uwp.UI.Data.Utilities;
using Microsoft.Toolkit.Uwp.UI.Utilities;
using Microsoft.Toolkit.Uwp.Utilities;
using Windows.ApplicationModel.DataTransfer;
using Windows.Devices.Input;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
using Windows.UI.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using DiagnosticsDebug = System.Diagnostics.Debug;
namespace Microsoft.Toolkit.Uwp.UI.Controls
{
/// <summary>
/// Control to represent data in columns and rows.
/// </summary>
#if FEATURE_VALIDATION_SUMMARY
[TemplatePart(Name = DataGrid.DATAGRID_elementValidationSummary, Type = typeof(ValidationSummary))]
#endif
[TemplatePart(Name = DataGrid.DATAGRID_elementRowsPresenterName, Type = typeof(DataGridRowsPresenter))]
[TemplatePart(Name = DataGrid.DATAGRID_elementColumnHeadersPresenterName, Type = typeof(DataGridColumnHeadersPresenter))]
[TemplatePart(Name = DataGrid.DATAGRID_elementFrozenColumnScrollBarSpacerName, Type = typeof(FrameworkElement))]
[TemplatePart(Name = DataGrid.DATAGRID_elementHorizontalScrollBarName, Type = typeof(ScrollBar))]
[TemplatePart(Name = DataGrid.DATAGRID_elementVerticalScrollBarName, Type = typeof(ScrollBar))]
[TemplateVisualState(Name = VisualStates.StateDisabled, GroupName = VisualStates.GroupCommon)]
[TemplateVisualState(Name = VisualStates.StateNormal, GroupName = VisualStates.GroupCommon)]
[TemplateVisualState(Name = VisualStates.StateTouchIndicator, GroupName = VisualStates.GroupScrollBars)]
[TemplateVisualState(Name = VisualStates.StateMouseIndicator, GroupName = VisualStates.GroupScrollBars)]
[TemplateVisualState(Name = VisualStates.StateMouseIndicatorFull, GroupName = VisualStates.GroupScrollBars)]
[TemplateVisualState(Name = VisualStates.StateNoIndicator, GroupName = VisualStates.GroupScrollBars)]
[TemplateVisualState(Name = VisualStates.StateSeparatorExpanded, GroupName = VisualStates.GroupScrollBarsSeparator)]
[TemplateVisualState(Name = VisualStates.StateSeparatorCollapsed, GroupName = VisualStates.GroupScrollBarsSeparator)]
[TemplateVisualState(Name = VisualStates.StateSeparatorExpandedWithoutAnimation, GroupName = VisualStates.GroupScrollBarsSeparator)]
[TemplateVisualState(Name = VisualStates.StateSeparatorCollapsedWithoutAnimation, GroupName = VisualStates.GroupScrollBarsSeparator)]
[TemplateVisualState(Name = VisualStates.StateInvalid, GroupName = VisualStates.GroupValidation)]
[TemplateVisualState(Name = VisualStates.StateValid, GroupName = VisualStates.GroupValidation)]
[StyleTypedProperty(Property = "CellStyle", StyleTargetType = typeof(DataGridCell))]
[StyleTypedProperty(Property = "ColumnHeaderStyle", StyleTargetType = typeof(DataGridColumnHeader))]
[StyleTypedProperty(Property = "DragIndicatorStyle", StyleTargetType = typeof(ContentControl))]
[StyleTypedProperty(Property = "DropLocationIndicatorStyle", StyleTargetType = typeof(Control))]
[StyleTypedProperty(Property = "RowHeaderStyle", StyleTargetType = typeof(DataGridRowHeader))]
[StyleTypedProperty(Property = "RowStyle", StyleTargetType = typeof(DataGridRow))]
public partial class DataGrid : Control
{
private enum ScrollBarVisualState
{
NoIndicator,
TouchIndicator,
MouseIndicator,
MouseIndicatorFull
}
private enum ScrollBarsSeparatorVisualState
{
SeparatorCollapsed,
SeparatorExpanded,
SeparatorExpandedWithoutAnimation,
SeparatorCollapsedWithoutAnimation
}
#if FEATURE_VALIDATION_SUMMARY
private const string DATAGRID_elementValidationSummary = "ValidationSummary";
#endif
private const string DATAGRID_elementRootName = "Root";
private const string DATAGRID_elementRowsPresenterName = "RowsPresenter";
private const string DATAGRID_elementColumnHeadersPresenterName = "ColumnHeadersPresenter";
private const string DATAGRID_elementFrozenColumnScrollBarSpacerName = "FrozenColumnScrollBarSpacer";
private const string DATAGRID_elementHorizontalScrollBarName = "HorizontalScrollBar";
private const string DATAGRID_elementRowHeadersPresenterName = "RowHeadersPresenter";
private const string DATAGRID_elementTopLeftCornerHeaderName = "TopLeftCornerHeader";
private const string DATAGRID_elementTopRightCornerHeaderName = "TopRightCornerHeader";
private const string DATAGRID_elementBottomRightCornerHeaderName = "BottomRightCorner";
private const string DATAGRID_elementVerticalScrollBarName = "VerticalScrollBar";
private const bool DATAGRID_defaultAutoGenerateColumns = true;
private const bool DATAGRID_defaultCanUserReorderColumns = true;
private const bool DATAGRID_defaultCanUserResizeColumns = true;
private const bool DATAGRID_defaultCanUserSortColumns = true;
private const DataGridGridLinesVisibility DATAGRID_defaultGridLinesVisibility = DataGridGridLinesVisibility.None;
private const DataGridHeadersVisibility DATAGRID_defaultHeadersVisibility = DataGridHeadersVisibility.Column;
private const DataGridRowDetailsVisibilityMode DATAGRID_defaultRowDetailsVisibility = DataGridRowDetailsVisibilityMode.VisibleWhenSelected;
private const DataGridSelectionMode DATAGRID_defaultSelectionMode = DataGridSelectionMode.Extended;
private const ScrollBarVisibility DATAGRID_defaultScrollBarVisibility = ScrollBarVisibility.Auto;
/// <summary>
/// The default order to use for columns when there is no <see cref="DisplayAttribute.Order"/>
/// value available for the property.
/// </summary>
/// <remarks>
/// The value of 10,000 comes from the DataAnnotations spec, allowing
/// some properties to be ordered at the beginning and some at the end.
/// </remarks>
private const int DATAGRID_defaultColumnDisplayOrder = 10000;
private const double DATAGRID_horizontalGridLinesThickness = 1;
private const double DATAGRID_minimumRowHeaderWidth = 4;
private const double DATAGRID_minimumColumnHeaderHeight = 4;
internal const double DATAGRID_maximumStarColumnWidth = 10000;
internal const double DATAGRID_minimumStarColumnWidth = 0.001;
private const double DATAGRID_mouseWheelDeltaDivider = 4.0;
private const double DATAGRID_maxHeadersThickness = 32768;
private const double DATAGRID_defaultRowHeight = 22;
internal const double DATAGRID_defaultRowGroupSublevelIndent = 20;
private const double DATAGRID_defaultMinColumnWidth = 20;
private const double DATAGRID_defaultMaxColumnWidth = double.PositiveInfinity;
private const double DATAGRID_defaultIncrementalLoadingThreshold = 3.0;
private const double DATAGRID_defaultDataFetchSize = 3.0;
// 2 seconds delay used to hide the scroll bars for example when OS animations are turned off.
private const int DATAGRID_noScrollBarCountdownMs = 2000;
// Used to work around double arithmetic rounding.
private const double DATAGRID_roundingDelta = 0.0001;
// DataGrid Template Parts
#if FEATURE_VALIDATION_SUMMARY
private ValidationSummary _validationSummary;
#endif
private UIElement _bottomRightCorner;
private DataGridColumnHeadersPresenter _columnHeadersPresenter;
private ScrollBar _hScrollBar;
private DataGridRowsPresenter _rowsPresenter;
private ScrollBar _vScrollBar;
private byte _autoGeneratingColumnOperationCount;
private bool _autoSizingColumns;
private List<ValidationResult> _bindingValidationResults;
private ContentControl _clipboardContentControl;
private IndexToValueTable<Visibility> _collapsedSlotsTable;
private bool _columnHeaderHasFocus;
private DataGridCellCoordinates _currentCellCoordinates;
// used to store the current column during a Reset
private int _desiredCurrentColumnIndex;
private int _editingColumnIndex;
private RoutedEventArgs _editingEventArgs;
private bool _executingLostFocusActions;
private bool _flushCurrentCellChanged;
private bool _focusEditingControl;
private FocusInputDeviceKind _focusInputDevice;
private DependencyObject _focusedObject;
private DataGridRow _focusedRow;
private FrameworkElement _frozenColumnScrollBarSpacer;
private bool _hasNoIndicatorStateStoryboardCompletedHandler;
private DispatcherQueueTimer _hideScrollBarsTimer;
// the sum of the widths in pixels of the scrolling columns preceding
// the first displayed scrolling column
private double _horizontalOffset;
private byte _horizontalScrollChangesIgnored;
private bool _ignoreNextScrollBarsLayout;
private List<ValidationResult> _indeiValidationResults;
private bool _initializingNewItem;
private bool _isHorizontalScrollBarInteracting;
private bool _isVerticalScrollBarInteracting;
// Set to True when the pointer is over the optional scroll bars.
private bool _isPointerOverHorizontalScrollBar;
private bool _isPointerOverVerticalScrollBar;
// Set to True to prevent the normal fade-out of the scroll bars.
private bool _keepScrollBarsShowing;
// Nth row of rows 0..N that make up the RowHeightEstimate
private int _lastEstimatedRow;
private List<DataGridRow> _loadedRows;
// prevents reentry into the VerticalScroll event handler
private Queue<Action> _lostFocusActions;
private bool _makeFirstDisplayedCellCurrentCellPending;
private bool _measured;
// the number of pixels of the firstDisplayedScrollingCol which are not displayed
private double _negHorizontalOffset;
// the number of pixels of DisplayData.FirstDisplayedScrollingRow which are not displayed
private int _noCurrentCellChangeCount;
private int _noFocusedColumnChangeCount;
private int _noSelectionChangeCount;
private double _oldEdgedRowsHeightCalculated = 0.0;
// Set to True to favor mouse indicators over panning indicators for the scroll bars.
private bool _preferMouseIndicators;
private DataGridCellCoordinates _previousAutomationFocusCoordinates;
private DataGridColumn _previousCurrentColumn;
private object _previousCurrentItem;
private List<ValidationResult> _propertyValidationResults;
private ScrollBarVisualState _proposedScrollBarsState;
private ScrollBarsSeparatorVisualState _proposedScrollBarsSeparatorState;
private string _rowGroupHeaderPropertyNameAlternative;
private ObservableCollection<Style> _rowGroupHeaderStyles;
// To figure out what the old RowGroupHeaderStyle was for each level, we need to keep a copy
// of the list. The old style important so we don't blow away styles set directly on the RowGroupHeader
private List<Style> _rowGroupHeaderStylesOld;
private double[] _rowGroupHeightsByLevel;
private double _rowHeaderDesiredWidth;
private Size? _rowsPresenterAvailableSize;
private bool _scrollingByHeight;
private DataGridSelectedItemsCollection _selectedItems;
private IndexToValueTable<Visibility> _showDetailsTable;
// Set to True when the mouse scroll bars are currently showing.
private bool _showingMouseIndicators;
private bool _successfullyUpdatedSelection;
private bool _temporarilyResetCurrentCell;
private bool _isUserSorting; // True if we're currently in a user invoked sorting operation
private ContentControl _topLeftCornerHeader;
private ContentControl _topRightCornerHeader;
private object _uneditedValue; // Represents the original current cell value at the time it enters editing mode.
private string _updateSourcePath;
private Dictionary<INotifyDataErrorInfo, string> _validationItems;
private List<ValidationResult> _validationResults;
private byte _verticalScrollChangesIgnored;
#if FEATURE_ICOLLECTIONVIEW_GROUP
private INotifyCollectionChanged _topLevelGroup;
#else
private IObservableVector<object> _topLevelGroup;
#endif
#if FEATURE_VALIDATION_SUMMARY
private ValidationSummaryItem _selectedValidationSummaryItem;
#endif
// An approximation of the sum of the heights in pixels of the scrolling rows preceding
// the first displayed scrolling row. Since the scrolled off rows are discarded, the grid
// does not know their actual height. The heights used for the approximation are the ones
// set as the rows were scrolled off.
private double _verticalOffset;
#if FEATURE_ICOLLECTIONVIEW_GROUP
// Cache event listeners for PropertyChanged and CollectionChanged events from CollectionViewGroups
private Dictionary<INotifyPropertyChanged, WeakEventListener<DataGrid, object, PropertyChangedEventArgs>> _groupsPropertyChangedListenersTable = new Dictionary<INotifyPropertyChanged, WeakEventListener<DataGrid, object, PropertyChangedEventArgs>>();
private Dictionary<INotifyCollectionChanged, WeakEventListener<DataGrid, object, NotifyCollectionChangedEventArgs>> _groupsCollectionChangedListenersTable = new Dictionary<INotifyCollectionChanged, WeakEventListener<DataGrid, object, NotifyCollectionChangedEventArgs>>();
#else
// Cache event listeners for VectorChanged events from ICollectionViewGroup's GroupItems
private Dictionary<IObservableVector<object>, WeakEventListener<DataGrid, object, IVectorChangedEventArgs>> _groupsVectorChangedListenersTable = new Dictionary<IObservableVector<object>, WeakEventListener<DataGrid, object, IVectorChangedEventArgs>>();
#endif
/// <summary>
/// Occurs one time for each public, non-static property in the bound data type when the
/// <see cref="ItemsSource"/> property is changed and the
/// <see cref="AutoGenerateColumns"/> property is true.
/// </summary>
public event EventHandler<DataGridAutoGeneratingColumnEventArgs> AutoGeneratingColumn;
/// <summary>
/// Occurs before a cell or row enters editing mode.
/// </summary>
public event EventHandler<DataGridBeginningEditEventArgs> BeginningEdit;
/// <summary>
/// Occurs after cell editing has ended.
/// </summary>
public event EventHandler<DataGridCellEditEndedEventArgs> CellEditEnded;
/// <summary>
/// Occurs immediately before cell editing has ended.
/// </summary>
public event EventHandler<DataGridCellEditEndingEventArgs> CellEditEnding;
/// <summary>
/// Occurs when the <see cref="Microsoft.Toolkit.Uwp.UI.Controls.DataGridColumn.DisplayIndex"/>
/// property of a column changes.
/// </summary>
public event EventHandler<DataGridColumnEventArgs> ColumnDisplayIndexChanged;
/// <summary>
/// Occurs when the user drops a column header that was being dragged using the mouse.
/// </summary>
public event EventHandler<DragCompletedEventArgs> ColumnHeaderDragCompleted;
/// <summary>
/// Occurs one or more times while the user drags a column header using the mouse.
/// </summary>
public event EventHandler<DragDeltaEventArgs> ColumnHeaderDragDelta;
/// <summary>
/// Occurs when the user begins dragging a column header using the mouse.
/// </summary>
public event EventHandler<DragStartedEventArgs> ColumnHeaderDragStarted;
/// <summary>
/// Raised when column reordering ends, to allow subscribers to clean up.
/// </summary>
public event EventHandler<DataGridColumnEventArgs> ColumnReordered;
/// <summary>
/// Raised when starting a column reordering action. Subscribers to this event can
/// set tooltip and caret UIElements, constrain tooltip position, indicate that
/// a preview should be shown, or cancel reordering.
/// </summary>
public event EventHandler<DataGridColumnReorderingEventArgs> ColumnReordering;
/// <summary>
/// This event is raised by OnCopyingRowClipboardContent method after the default row content is prepared.
/// Event listeners can modify or add to the row clipboard content.
/// </summary>
public event EventHandler<DataGridRowClipboardEventArgs> CopyingRowClipboardContent;
/// <summary>
/// Occurs when a different cell becomes the current cell.
/// </summary>
public event EventHandler<EventArgs> CurrentCellChanged;
/// <summary>
/// Occurs after a <see cref="DataGridRow"/>
/// is instantiated, so that you can customize it before it is used.
/// </summary>
public event EventHandler<DataGridRowEventArgs> LoadingRow;
/// <summary>
/// Occurs when a new row details template is applied to a row, so that you can customize
/// the details section before it is used.
/// </summary>
public event EventHandler<DataGridRowDetailsEventArgs> LoadingRowDetails;
/// <summary>
/// Occurs before a DataGridRowGroupHeader header is used.
/// </summary>
public event EventHandler<DataGridRowGroupHeaderEventArgs> LoadingRowGroup;
/// <summary>
/// Occurs when a cell in a <see cref="DataGridTemplateColumn"/> enters editing mode.
/// </summary>
public event EventHandler<DataGridPreparingCellForEditEventArgs> PreparingCellForEdit;
/// <summary>
/// Occurs when the <see cref="RowDetailsVisibilityMode"/>
/// property value changes.
/// </summary>
public event EventHandler<DataGridRowDetailsEventArgs> RowDetailsVisibilityChanged;
/// <summary>
/// Occurs when the row has been successfully committed or canceled.
/// </summary>
public event EventHandler<DataGridRowEditEndedEventArgs> RowEditEnded;
/// <summary>
/// Occurs immediately before the row has been successfully committed or canceled.
/// </summary>
public event EventHandler<DataGridRowEditEndingEventArgs> RowEditEnding;
/// <summary>
/// Occurs when the <see cref="SelectedItem"/> or
/// <see cref="SelectedItems"/> property value changes.
/// </summary>
public event SelectionChangedEventHandler SelectionChanged;
/// <summary>
/// Occurs when the <see cref="Microsoft.Toolkit.Uwp.UI.Controls.DataGridColumn"/> sorting request is triggered.
/// </summary>
public event EventHandler<DataGridColumnEventArgs> Sorting;
/// <summary>
/// Occurs when a <see cref="DataGridRow"/>
/// object becomes available for reuse.
/// </summary>
public event EventHandler<DataGridRowEventArgs> UnloadingRow;
/// <summary>
/// Occurs when the DataGridRowGroupHeader is available for reuse.
/// </summary>
public event EventHandler<DataGridRowGroupHeaderEventArgs> UnloadingRowGroup;
/// <summary>
/// Occurs when a row details element becomes available for reuse.
/// </summary>
public event EventHandler<DataGridRowDetailsEventArgs> UnloadingRowDetails;
/// <summary>
/// Initializes a new instance of the <see cref="DataGrid"/> class.
/// </summary>
public DataGrid()
{
this.TabNavigation = KeyboardNavigationMode.Once;
_loadedRows = new List<DataGridRow>();
_lostFocusActions = new Queue<Action>();
_selectedItems = new DataGridSelectedItemsCollection(this);
_rowGroupHeaderPropertyNameAlternative = Controls.Resources.DefaultRowGroupHeaderPropertyNameAlternative;
_rowGroupHeaderStyles = new ObservableCollection<Style>();
_rowGroupHeaderStyles.CollectionChanged += RowGroupHeaderStyles_CollectionChanged;
_rowGroupHeaderStylesOld = new List<Style>();
this.RowGroupHeadersTable = new IndexToValueTable<DataGridRowGroupInfo>();
_collapsedSlotsTable = new IndexToValueTable<Visibility>();
_validationItems = new Dictionary<INotifyDataErrorInfo, string>();
_validationResults = new List<ValidationResult>();
_bindingValidationResults = new List<ValidationResult>();
_propertyValidationResults = new List<ValidationResult>();
_indeiValidationResults = new List<ValidationResult>();
this.ColumnHeaderInteractionInfo = new DataGridColumnHeaderInteractionInfo();
this.DisplayData = new DataGridDisplayData(this);
this.ColumnsInternal = CreateColumnsInstance();
this.RowHeightEstimate = DATAGRID_defaultRowHeight;
this.RowDetailsHeightEstimate = 0;
_rowHeaderDesiredWidth = 0;
this.DataConnection = new DataGridDataConnection(this);
_showDetailsTable = new IndexToValueTable<Visibility>();
_focusInputDevice = FocusInputDeviceKind.None;
_proposedScrollBarsState = ScrollBarVisualState.NoIndicator;
_proposedScrollBarsSeparatorState = ScrollBarsSeparatorVisualState.SeparatorCollapsed;
this.AnchorSlot = -1;
_lastEstimatedRow = -1;
_editingColumnIndex = -1;
this.CurrentCellCoordinates = new DataGridCellCoordinates(-1, -1);
this.RowGroupHeaderHeightEstimate = DATAGRID_defaultRowHeight;
this.LastHandledKeyDown = VirtualKey.None;
this.DefaultStyleKey = typeof(DataGrid);
HookDataGridEvents();
}
/// <summary>
/// Gets or sets the <see cref="T:System.Windows.Media.Brush"/> that is used to paint the background of odd-numbered rows.
/// </summary>
/// <returns>
/// The brush that is used to paint the background of odd-numbered rows.
/// </returns>
public Brush AlternatingRowBackground
{
get { return GetValue(AlternatingRowBackgroundProperty) as Brush; }
set { SetValue(AlternatingRowBackgroundProperty, value); }
}
/// <summary>
/// Identifies the <see cref="AlternatingRowBackground"/>
/// dependency property.
/// </summary>
/// <returns>
/// The identifier for the <see cref="AlternatingRowBackground"/>
/// dependency property.
/// </returns>
public static readonly DependencyProperty AlternatingRowBackgroundProperty =
DependencyProperty.Register(
"AlternatingRowBackground",
typeof(Brush),
typeof(DataGrid),
new PropertyMetadata(null, OnAlternatingRowBackgroundPropertyChanged));
private static void OnAlternatingRowBackgroundPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureBackground();
}
}
/// <summary>
/// Gets or sets the <see cref="T:System.Windows.Media.Brush"/> that is used to paint the foreground of odd-numbered rows.
/// </summary>
/// <returns>
/// The brush that is used to paint the foreground of odd-numbered rows.
/// </returns>
public Brush AlternatingRowForeground
{
get { return GetValue(AlternatingRowForegroundProperty) as Brush; }
set { SetValue(AlternatingRowForegroundProperty, value); }
}
/// <summary>
/// Identifies the <see cref="AlternatingRowForeground"/>
/// dependency property.
/// </summary>
/// <returns>
/// The identifier for the <see cref="AlternatingRowForeground"/>
/// dependency property.
/// </returns>
public static readonly DependencyProperty AlternatingRowForegroundProperty =
DependencyProperty.Register(
"AlternatingRowForeground",
typeof(Brush),
typeof(DataGrid),
new PropertyMetadata(null, OnAlternatingRowForegroundPropertyChanged));
private static void OnAlternatingRowForegroundPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureForeground();
}
}
/// <summary>
/// Gets or sets a value indicating whether the row details sections remain
/// fixed at the width of the display area or can scroll horizontally.
/// </summary>
public bool AreRowDetailsFrozen
{
get { return (bool)GetValue(AreRowDetailsFrozenProperty); }
set { SetValue(AreRowDetailsFrozenProperty, value); }
}
/// <summary>
/// Identifies the AreRowDetailsFrozen dependency property.
/// </summary>
public static readonly DependencyProperty AreRowDetailsFrozenProperty =
DependencyProperty.Register(
"AreRowDetailsFrozen",
typeof(bool),
typeof(DataGrid),
null);
/// <summary>
/// Gets or sets a value indicating whether the row group header sections
/// remain fixed at the width of the display area or can scroll horizontally.
/// </summary>
public bool AreRowGroupHeadersFrozen
{
get { return (bool)GetValue(AreRowGroupHeadersFrozenProperty); }
set { SetValue(AreRowGroupHeadersFrozenProperty, value); }
}
/// <summary>
/// Identifies the AreRowDetailsFrozen dependency property.
/// </summary>
public static readonly DependencyProperty AreRowGroupHeadersFrozenProperty =
DependencyProperty.Register(
"AreRowGroupHeadersFrozen",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(true, OnAreRowGroupHeadersFrozenPropertyChanged));
private static void OnAreRowGroupHeadersFrozenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
ProcessFrozenColumnCount(dataGrid);
// Update elements in the RowGroupHeader that were previously frozen.
if ((bool)e.NewValue)
{
if (dataGrid._rowsPresenter != null)
{
foreach (UIElement element in dataGrid._rowsPresenter.Children)
{
DataGridRowGroupHeader groupHeader = element as DataGridRowGroupHeader;
if (groupHeader != null)
{
groupHeader.ClearFrozenStates();
}
}
}
}
}
/// <summary>
/// Gets or sets a value indicating whether columns are created
/// automatically when the <see cref="ItemsSource"/> property is set.
/// </summary>
public bool AutoGenerateColumns
{
get { return (bool)GetValue(AutoGenerateColumnsProperty); }
set { SetValue(AutoGenerateColumnsProperty, value); }
}
/// <summary>
/// Identifies the AutoGenerateColumns dependency property.
/// </summary>
public static readonly DependencyProperty AutoGenerateColumnsProperty =
DependencyProperty.Register(
"AutoGenerateColumns",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultAutoGenerateColumns, OnAutoGenerateColumnsPropertyChanged));
private static void OnAutoGenerateColumnsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
bool value = (bool)e.NewValue;
if (value)
{
dataGrid.InitializeElements(false /*recycleRows*/);
}
else
{
dataGrid.RemoveAutoGeneratedColumns();
}
}
/// <summary>
/// Gets or sets a value indicating whether the user can change
/// the column display order by dragging column headers with the mouse.
/// </summary>
public bool CanUserReorderColumns
{
get { return (bool)GetValue(CanUserReorderColumnsProperty); }
set { SetValue(CanUserReorderColumnsProperty, value); }
}
/// <summary>
/// Identifies the CanUserReorderColumns dependency property.
/// </summary>
public static readonly DependencyProperty CanUserReorderColumnsProperty =
DependencyProperty.Register(
"CanUserReorderColumns",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultCanUserReorderColumns));
/// <summary>
/// Gets or sets a value indicating whether the user can adjust column widths using the mouse.
/// </summary>
public bool CanUserResizeColumns
{
get { return (bool)GetValue(CanUserResizeColumnsProperty); }
set { SetValue(CanUserResizeColumnsProperty, value); }
}
/// <summary>
/// Identifies the CanUserResizeColumns dependency property.
/// </summary>
public static readonly DependencyProperty CanUserResizeColumnsProperty =
DependencyProperty.Register(
"CanUserResizeColumns",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultCanUserResizeColumns, OnCanUserResizeColumnsPropertyChanged));
/// <summary>
/// CanUserResizeColumns property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its CanUserResizeColumns.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnCanUserResizeColumnsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
dataGrid.EnsureHorizontalLayout();
}
/// <summary>
/// Gets or sets a value indicating whether the user can sort columns by clicking the column header.
/// </summary>
public bool CanUserSortColumns
{
get { return (bool)GetValue(CanUserSortColumnsProperty); }
set { SetValue(CanUserSortColumnsProperty, value); }
}
/// <summary>
/// Identifies the CanUserSortColumns dependency property.
/// </summary>
public static readonly DependencyProperty CanUserSortColumnsProperty =
DependencyProperty.Register(
"CanUserSortColumns",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultCanUserSortColumns));
/// <summary>
/// Gets or sets the style that is used when rendering the data grid cells.
/// </summary>
public Style CellStyle
{
get { return GetValue(CellStyleProperty) as Style; }
set { SetValue(CellStyleProperty, value); }
}
/// <summary>
/// Identifies the <see cref="CellStyle"/> dependency property.
/// </summary>
public static readonly DependencyProperty CellStyleProperty =
DependencyProperty.Register(
"CellStyle",
typeof(Style),
typeof(DataGrid),
new PropertyMetadata(null, OnCellStylePropertyChanged));
private static void OnCellStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (dataGrid != null)
{
Style previousStyle = e.OldValue as Style;
foreach (DataGridRow row in dataGrid.GetAllRows())
{
foreach (DataGridCell cell in row.Cells)
{
cell.EnsureStyle(previousStyle);
}
row.FillerCell.EnsureStyle(previousStyle);
}
dataGrid.InvalidateRowHeightEstimate();
}
}
/// <summary>
/// Gets or sets the property which determines how DataGrid content is copied to the Clipboard.
/// </summary>
public DataGridClipboardCopyMode ClipboardCopyMode
{
get { return (DataGridClipboardCopyMode)GetValue(ClipboardCopyModeProperty); }
set { SetValue(ClipboardCopyModeProperty, value); }
}
/// <summary>
/// Identifies the <see cref="ClipboardCopyMode"/> dependency property.
/// </summary>
public static readonly DependencyProperty ClipboardCopyModeProperty =
DependencyProperty.Register(
"ClipboardCopyMode",
typeof(DataGridClipboardCopyMode),
typeof(DataGrid),
new PropertyMetadata(DataGridClipboardCopyMode.ExcludeHeader));
/// <summary>
/// Gets or sets the height of the column headers row.
/// </summary>
public double ColumnHeaderHeight
{
get { return (double)GetValue(ColumnHeaderHeightProperty); }
set { SetValue(ColumnHeaderHeightProperty, value); }
}
/// <summary>
/// Identifies the ColumnHeaderHeight dependency property.
/// </summary>
public static readonly DependencyProperty ColumnHeaderHeightProperty =
DependencyProperty.Register(
"ColumnHeaderHeight",
typeof(double),
typeof(DataGrid),
new PropertyMetadata(double.NaN, OnColumnHeaderHeightPropertyChanged));
/// <summary>
/// ColumnHeaderHeightProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its ColumnHeaderHeight.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnColumnHeaderHeightPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double value = (double)e.NewValue;
if (value < DATAGRID_minimumColumnHeaderHeight)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "ColumnHeaderHeight", DATAGRID_minimumColumnHeaderHeight);
}
if (value > DATAGRID_maxHeadersThickness)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeLessThanOrEqualTo("value", "ColumnHeaderHeight", DATAGRID_maxHeadersThickness);
}
dataGrid.InvalidateMeasure();
}
}
/// <summary>
/// Gets or sets the style that is used when rendering the column headers.
/// </summary>
public Style ColumnHeaderStyle
{
get { return GetValue(ColumnHeaderStyleProperty) as Style; }
set { SetValue(ColumnHeaderStyleProperty, value); }
}
/// <summary>
/// Identifies the ColumnHeaderStyle dependency property.
/// </summary>
public static readonly DependencyProperty ColumnHeaderStyleProperty =
DependencyProperty.Register(
"ColumnHeaderStyle",
typeof(Style),
typeof(DataGrid),
new PropertyMetadata(null, OnColumnHeaderStylePropertyChanged));
private static void OnColumnHeaderStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
// TODO: ColumnHeaderStyle should be applied to the TopLeftCorner and the TopRightCorner as well
DataGrid dataGrid = d as DataGrid;
if (dataGrid != null)
{
Style previousStyle = e.OldValue as Style;
foreach (DataGridColumn column in dataGrid.Columns)
{
column.HeaderCell.EnsureStyle(previousStyle);
}
if (dataGrid.ColumnsInternal.FillerColumn != null)
{
dataGrid.ColumnsInternal.FillerColumn.HeaderCell.EnsureStyle(previousStyle);
}
}
}
/// <summary>
/// Gets or sets the standard width or automatic sizing mode of columns in the control.
/// </summary>
public DataGridLength ColumnWidth
{
get { return (DataGridLength)GetValue(ColumnWidthProperty); }
set { SetValue(ColumnWidthProperty, value); }
}
/// <summary>
/// Identifies the ColumnWidth dependency property.
/// </summary>
public static readonly DependencyProperty ColumnWidthProperty =
DependencyProperty.Register(
"ColumnWidth",
typeof(DataGridLength),
typeof(DataGrid),
new PropertyMetadata(DataGridLength.Auto, OnColumnWidthPropertyChanged));
/// <summary>
/// ColumnWidthProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its ColumnWidth.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnColumnWidthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
foreach (DataGridColumn column in dataGrid.ColumnsInternal.GetDisplayedColumns())
{
if (column.InheritsWidth)
{
column.SetWidthInternalNoCallback(dataGrid.ColumnWidth);
}
}
dataGrid.EnsureHorizontalLayout();
}
/// <summary>
/// Gets or sets the amount of data to fetch for virtualizing/prefetch operations.
/// </summary>
/// <returns>
/// The amount of data to fetch per interval, in pages.
/// </returns>
public double DataFetchSize
{
get { return (double)GetValue(DataFetchSizeProperty); }
set { SetValue(DataFetchSizeProperty, value); }
}
/// <summary>
/// Identifies the <see cref="DataFetchSize"/> dependency property
/// </summary>
public static readonly DependencyProperty DataFetchSizeProperty =
DependencyProperty.Register(
nameof(DataFetchSize),
typeof(double),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultDataFetchSize, OnDataFetchSizePropertyChanged));
/// <summary>
/// DataFetchSizeProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its DataFetchSize.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnDataFetchSizePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double oldValue = (double)e.OldValue;
double newValue = (double)e.NewValue;
if (double.IsNaN(newValue))
{
dataGrid.SetValueNoCallback(e.Property, oldValue);
throw DataGridError.DataGrid.ValueCannotBeSetToNAN(nameof(dataGrid.DataFetchSize));
}
if (newValue < 0)
{
dataGrid.SetValueNoCallback(e.Property, oldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", nameof(dataGrid.DataFetchSize), 0);
}
}
}
/// <summary>
/// Gets or sets the style that is used when rendering the drag indicator
/// that is displayed while dragging column headers.
/// </summary>
public Style DragIndicatorStyle
{
get { return GetValue(DragIndicatorStyleProperty) as Style; }
set { SetValue(DragIndicatorStyleProperty, value); }
}
/// <summary>
/// Identifies the <see cref="DragIndicatorStyle"/>
/// dependency property.
/// </summary>
public static readonly DependencyProperty DragIndicatorStyleProperty =
DependencyProperty.Register(
"DragIndicatorStyle",
typeof(Style),
typeof(DataGrid),
null);
/// <summary>
/// Gets or sets the style that is used when rendering the column headers.
/// </summary>
public Style DropLocationIndicatorStyle
{
get { return GetValue(DropLocationIndicatorStyleProperty) as Style; }
set { SetValue(DropLocationIndicatorStyleProperty, value); }
}
/// <summary>
/// Identifies the <see cref="DropLocationIndicatorStyle"/>
/// dependency property.
/// </summary>
public static readonly DependencyProperty DropLocationIndicatorStyleProperty =
DependencyProperty.Register(
"DropLocationIndicatorStyle",
typeof(Style),
typeof(DataGrid),
null);
/// <summary>
/// Gets or sets the number of columns that the user cannot scroll horizontally.
/// </summary>
public int FrozenColumnCount
{
get { return (int)GetValue(FrozenColumnCountProperty); }
set { SetValue(FrozenColumnCountProperty, value); }
}
/// <summary>
/// Identifies the <see cref="FrozenColumnCount"/>
/// dependency property.
/// </summary>
public static readonly DependencyProperty FrozenColumnCountProperty =
DependencyProperty.Register(
"FrozenColumnCount",
typeof(int),
typeof(DataGrid),
new PropertyMetadata(0, OnFrozenColumnCountPropertyChanged));
private static void OnFrozenColumnCountPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
if ((int)e.NewValue < 0)
{
dataGrid.SetValueNoCallback(DataGrid.FrozenColumnCountProperty, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "FrozenColumnCount", 0);
}
ProcessFrozenColumnCount(dataGrid);
}
}
private static void ProcessFrozenColumnCount(DataGrid dataGrid)
{
dataGrid.CorrectColumnFrozenStates();
dataGrid.ComputeScrollBarsLayout();
dataGrid.InvalidateColumnHeadersArrange();
dataGrid.InvalidateCellsArrange();
}
/// <summary>
/// Gets or sets a value indicating which grid lines separating inner cells are shown.
/// </summary>
public DataGridGridLinesVisibility GridLinesVisibility
{
get { return (DataGridGridLinesVisibility)GetValue(GridLinesVisibilityProperty); }
set { SetValue(GridLinesVisibilityProperty, value); }
}
/// <summary>
/// Identifies the GridLinesVisibility dependency property.
/// </summary>
public static readonly DependencyProperty GridLinesVisibilityProperty =
DependencyProperty.Register(
"GridLinesVisibility",
typeof(DataGridGridLinesVisibility),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultGridLinesVisibility, OnGridLinesVisibilityPropertyChanged));
/// <summary>
/// GridLinesProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its GridLines.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnGridLinesVisibilityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureGridLines();
row.InvalidateHorizontalArrange();
}
foreach (DataGridRowGroupHeader rowGroupHeader in dataGrid.GetAllRowGroupHeaders())
{
rowGroupHeader.EnsureGridLine();
}
}
/// <summary>
/// Gets or sets a value indicating the visibility of row and column headers.
/// </summary>
public DataGridHeadersVisibility HeadersVisibility
{
get { return (DataGridHeadersVisibility)GetValue(HeadersVisibilityProperty); }
set { SetValue(HeadersVisibilityProperty, value); }
}
/// <summary>
/// Identifies the HeadersVisibility dependency property.
/// </summary>
public static readonly DependencyProperty HeadersVisibilityProperty =
DependencyProperty.Register(
"HeadersVisibility",
typeof(DataGridHeadersVisibility),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultHeadersVisibility, OnHeadersVisibilityPropertyChanged));
/// <summary>
/// HeadersVisibilityProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its HeadersVisibility.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnHeadersVisibilityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
DataGridHeadersVisibility newValue = (DataGridHeadersVisibility)e.NewValue;
DataGridHeadersVisibility oldValue = (DataGridHeadersVisibility)e.OldValue;
Func<DataGridHeadersVisibility, DataGridHeadersVisibility, bool> hasFlags = (DataGridHeadersVisibility value, DataGridHeadersVisibility flags) => ((value & flags) == flags);
bool newValueCols = hasFlags(newValue, DataGridHeadersVisibility.Column);
bool newValueRows = hasFlags(newValue, DataGridHeadersVisibility.Row);
bool oldValueCols = hasFlags(oldValue, DataGridHeadersVisibility.Column);
bool oldValueRows = hasFlags(oldValue, DataGridHeadersVisibility.Row);
// Columns
if (newValueCols != oldValueCols)
{
if (dataGrid._columnHeadersPresenter != null)
{
dataGrid.EnsureColumnHeadersVisibility();
if (!newValueCols)
{
dataGrid._columnHeadersPresenter.Measure(new Size(0.0, 0.0));
}
else
{
dataGrid.EnsureVerticalGridLines();
}
dataGrid.InvalidateMeasure();
}
}
// Rows
if (newValueRows != oldValueRows && dataGrid._rowsPresenter != null)
{
foreach (FrameworkElement element in dataGrid._rowsPresenter.Children)
{
DataGridRow row = element as DataGridRow;
if (row != null)
{
row.EnsureHeaderStyleAndVisibility(null);
if (newValueRows)
{
row.ApplyState(false /*animate*/);
row.EnsureHeaderVisibility();
}
}
else
{
DataGridRowGroupHeader rowGroupHeader = element as DataGridRowGroupHeader;
if (rowGroupHeader != null)
{
rowGroupHeader.EnsureHeaderStyleAndVisibility(null);
}
}
}
dataGrid.InvalidateRowHeightEstimate();
dataGrid.InvalidateRowsMeasure(true /*invalidateIndividualElements*/);
}
// TODO: This isn't necessary if the TopLeftCorner and the TopRightCorner Autosize to 0.
// See if their templates can be changed to do that.
if (dataGrid._topLeftCornerHeader != null)
{
dataGrid._topLeftCornerHeader.Visibility = (newValueRows && newValueCols) ? Visibility.Visible : Visibility.Collapsed;
if (dataGrid._topLeftCornerHeader.Visibility == Visibility.Collapsed)
{
dataGrid._topLeftCornerHeader.Measure(new Size(0.0, 0.0));
}
}
}
/// <summary>
/// Gets or sets the <see cref="T:System.Windows.Media.Brush"/> that is used to paint grid lines separating rows.
/// </summary>
public Brush HorizontalGridLinesBrush
{
get { return GetValue(HorizontalGridLinesBrushProperty) as Brush; }
set { SetValue(HorizontalGridLinesBrushProperty, value); }
}
/// <summary>
/// Identifies the HorizontalGridLinesBrush dependency property.
/// </summary>
public static readonly DependencyProperty HorizontalGridLinesBrushProperty =
DependencyProperty.Register(
"HorizontalGridLinesBrush",
typeof(Brush),
typeof(DataGrid),
new PropertyMetadata(null, OnHorizontalGridLinesBrushPropertyChanged));
/// <summary>
/// HorizontalGridLinesBrushProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its HorizontalGridLinesBrush.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnHorizontalGridLinesBrushPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property) && dataGrid._rowsPresenter != null)
{
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureGridLines();
}
foreach (DataGridRowGroupHeader rowGroupHeader in dataGrid.GetAllRowGroupHeaders())
{
rowGroupHeader.EnsureGridLine();
}
}
}
/// <summary>
/// Gets or sets a value indicating how the horizontal scroll bar is displayed.
/// </summary>
public ScrollBarVisibility HorizontalScrollBarVisibility
{
get { return (ScrollBarVisibility)GetValue(HorizontalScrollBarVisibilityProperty); }
set { SetValue(HorizontalScrollBarVisibilityProperty, value); }
}
/// <summary>
/// Identifies the HorizontalScrollBarVisibility dependency property.
/// </summary>
public static readonly DependencyProperty HorizontalScrollBarVisibilityProperty =
DependencyProperty.Register(
"HorizontalScrollBarVisibility",
typeof(ScrollBarVisibility),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultScrollBarVisibility, OnHorizontalScrollBarVisibilityPropertyChanged));
/// <summary>
/// HorizontalScrollBarVisibilityProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its HorizontalScrollBarVisibility.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnHorizontalScrollBarVisibilityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property) && (ScrollBarVisibility)e.NewValue != (ScrollBarVisibility)e.OldValue)
{
dataGrid.UpdateRowsPresenterManipulationMode(true /*horizontalMode*/, false /*verticalMode*/);
if (dataGrid._hScrollBar != null)
{
if (dataGrid.IsHorizontalScrollBarOverCells)
{
dataGrid.ComputeScrollBarsLayout();
}
else
{
dataGrid.InvalidateMeasure();
}
}
}
}
/// <summary>
/// Gets or sets a value indicating whether the user can edit the values in the control.
/// </summary>
public bool IsReadOnly
{
get { return (bool)GetValue(IsReadOnlyProperty); }
set { SetValue(IsReadOnlyProperty, value); }
}
/// <summary>
/// Identifies the IsReadOnly dependency property.
/// </summary>
public static readonly DependencyProperty IsReadOnlyProperty =
DependencyProperty.Register(
"IsReadOnly",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(false, OnIsReadOnlyPropertyChanged));
/// <summary>
/// IsReadOnlyProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its IsReadOnly.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnIsReadOnlyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
bool value = (bool)e.NewValue;
if (value && !dataGrid.CommitEdit(DataGridEditingUnit.Row, true /*exitEditing*/))
{
dataGrid.CancelEdit(DataGridEditingUnit.Row, false /*raiseEvents*/);
}
#if FEATURE_IEDITABLECOLLECTIONVIEW
dataGrid.UpdateNewItemPlaceholder();
#endif
}
}
/// <summary>
/// Gets a value indicating whether data in the grid is valid.
/// </summary>
public bool IsValid
{
get
{
return (bool)GetValue(IsValidProperty);
}
internal set
{
if (value != this.IsValid)
{
if (value)
{
VisualStates.GoToState(this, true, VisualStates.StateValid);
}
else
{
VisualStates.GoToState(this, true, VisualStates.StateInvalid, VisualStates.StateValid);
}
this.SetValueNoCallback(DataGrid.IsValidProperty, value);
}
}
}
/// <summary>
/// Identifies the IsValid dependency property.
/// </summary>
public static readonly DependencyProperty IsValidProperty =
DependencyProperty.Register(
"IsValid",
typeof(bool),
typeof(DataGrid),
new PropertyMetadata(true, OnIsValidPropertyChanged));
/// <summary>
/// IsValidProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its IsValid.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnIsValidPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
dataGrid.SetValueNoCallback(DataGrid.IsValidProperty, e.OldValue);
throw DataGridError.DataGrid.UnderlyingPropertyIsReadOnly("IsValid");
}
}
/// <summary>
/// Gets or sets the threshold range that governs when the DataGrid class will begin to prefetch more items.
/// </summary>
/// <returns>
/// The loading threshold, in terms of pages.
/// </returns>
public double IncrementalLoadingThreshold
{
get { return (double)GetValue(IncrementalLoadingThresholdProperty); }
set { SetValue(IncrementalLoadingThresholdProperty, value); }
}
/// <summary>
/// Identifies the <see cref="IncrementalLoadingThreshold"/> dependency property
/// </summary>
public static readonly DependencyProperty IncrementalLoadingThresholdProperty =
DependencyProperty.Register(
nameof(IncrementalLoadingThreshold),
typeof(double),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultIncrementalLoadingThreshold, OnIncrementalLoadingThresholdPropertyChanged));
/// <summary>
/// IncrementalLoadingThresholdProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its IncrementalLoadingThreshold.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnIncrementalLoadingThresholdPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double oldValue = (double)e.OldValue;
double newValue = (double)e.NewValue;
if (double.IsNaN(newValue))
{
dataGrid.SetValueNoCallback(e.Property, oldValue);
throw DataGridError.DataGrid.ValueCannotBeSetToNAN(nameof(dataGrid.IncrementalLoadingThreshold));
}
if (newValue < 0)
{
dataGrid.SetValueNoCallback(e.Property, oldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", nameof(dataGrid.IncrementalLoadingThreshold), 0);
}
if (newValue > oldValue)
{
dataGrid.LoadMoreDataFromIncrementalItemsSource();
}
}
}
/// <summary>
/// Gets or sets a value that indicates the conditions for prefetch operations by the DataGrid class.
/// </summary>
/// <returns>
/// An enumeration value that indicates the conditions that trigger prefetch operations. The default is **Edge**.
/// </returns>
public IncrementalLoadingTrigger IncrementalLoadingTrigger
{
get { return (IncrementalLoadingTrigger)GetValue(IncrementalLoadingTriggerProperty); }
set { SetValue(IncrementalLoadingTriggerProperty, value); }
}
/// <summary>
/// Identifies the <see cref="IncrementalLoadingTrigger"/> dependency property
/// </summary>
public static readonly DependencyProperty IncrementalLoadingTriggerProperty =
DependencyProperty.Register(
nameof(IncrementalLoadingTrigger),
typeof(IncrementalLoadingTrigger),
typeof(DataGrid),
new PropertyMetadata(IncrementalLoadingTrigger.Edge));
/// <summary>
/// Gets or sets a collection that is used to generate the content of the control.
/// </summary>
public IEnumerable ItemsSource
{
get { return GetValue(ItemsSourceProperty) as IEnumerable; }
set { SetValue(ItemsSourceProperty, value); }
}
/// <summary>
/// Identifies the <see cref="ItemsSource"/> dependency property.
/// </summary>
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register(
"ItemsSource",
typeof(IEnumerable),
typeof(DataGrid),
new PropertyMetadata(null, OnItemsSourcePropertyChanged));
/// <summary>
/// ItemsSourceProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its ItemsSource.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnItemsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
DiagnosticsDebug.Assert(dataGrid.DataConnection != null, "Expected non-null DataConnection.");
if (dataGrid.LoadingOrUnloadingRow)
{
dataGrid.SetValueNoCallback(DataGrid.ItemsSourceProperty, e.OldValue);
throw DataGridError.DataGrid.CannotChangeItemsWhenLoadingRows();
}
// Try to commit edit on the old DataSource, but force a cancel if it fails.
if (!dataGrid.CommitEdit())
{
dataGrid.CancelEdit(DataGridEditingUnit.Row, false);
}
dataGrid.DataConnection.UnWireEvents(dataGrid.DataConnection.DataSource);
dataGrid.DataConnection.ClearDataProperties();
dataGrid.ClearRowGroupHeadersTable();
// The old selected indexes are no longer relevant. There's a perf benefit from
// updating the selected indexes with a null DataSource, because we know that all
// of the previously selected indexes have been removed from selection.
dataGrid.DataConnection.DataSource = null;
dataGrid._selectedItems.UpdateIndexes();
dataGrid.CoerceSelectedItem();
// Wrap an IEnumerable in an ICollectionView if it's not already one.
bool setDefaultSelection = false;
IEnumerable newItemsSource = e.NewValue as IEnumerable;
if (newItemsSource != null && !(newItemsSource is ICollectionView))
{
dataGrid.DataConnection.DataSource = DataGridDataConnection.CreateView(newItemsSource);
}
else
{
dataGrid.DataConnection.DataSource = newItemsSource;
setDefaultSelection = true;
}
if (dataGrid.DataConnection.DataSource != null)
{
// Setup the column headers.
if (dataGrid.DataConnection.DataType != null)
{
foreach (DataGridBoundColumn boundColumn in dataGrid.ColumnsInternal.GetDisplayedColumns(column => column is DataGridBoundColumn))
{
boundColumn.SetHeaderFromBinding();
}
}
dataGrid.DataConnection.WireEvents(dataGrid.DataConnection.DataSource);
}
// Wait for the current cell to be set before we raise any SelectionChanged events.
dataGrid._makeFirstDisplayedCellCurrentCellPending = true;
// Clear out the old rows and remove the generated columns.
dataGrid.ClearRows(false /*recycle*/);
dataGrid.RemoveAutoGeneratedColumns();
// Set the SlotCount (from the data count and number of row group headers) before we make the default selection.
dataGrid.PopulateRowGroupHeadersTable();
dataGrid.RefreshSlotCounts();
dataGrid.SelectedItem = null;
if (dataGrid.DataConnection.CollectionView != null && setDefaultSelection)
{
dataGrid.SelectedItem = dataGrid.DataConnection.CollectionView.CurrentItem;
}
// Treat this like the DataGrid has never been measured because all calculations at
// this point are invalid until the next layout cycle. For instance, the ItemsSource
// can be set when the DataGrid is not part of the visual tree.
dataGrid._measured = false;
dataGrid.InvalidateMeasure();
}
}
/// <summary>
/// Gets or sets the maximum width of columns in the <see cref="DataGrid"/>.
/// </summary>
public double MaxColumnWidth
{
get { return (double)GetValue(MaxColumnWidthProperty); }
set { SetValue(MaxColumnWidthProperty, value); }
}
/// <summary>
/// Identifies the MaxColumnWidth dependency property.
/// </summary>
public static readonly DependencyProperty MaxColumnWidthProperty =
DependencyProperty.Register(
"MaxColumnWidth",
typeof(double),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultMaxColumnWidth, OnMaxColumnWidthPropertyChanged));
/// <summary>
/// MaxColumnWidthProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its ColumnWidth.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnMaxColumnWidthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double oldValue = (double)e.OldValue;
double newValue = (double)e.NewValue;
if (double.IsNaN(newValue))
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueCannotBeSetToNAN("MaxColumnWidth");
}
if (newValue < 0)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "MaxColumnWidth", 0);
}
if (dataGrid.MinColumnWidth > newValue)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "MaxColumnWidth", "MinColumnWidth");
}
foreach (DataGridColumn column in dataGrid.ColumnsInternal.GetDisplayedColumns())
{
dataGrid.OnColumnMaxWidthChanged(column, Math.Min(column.MaxWidth, oldValue));
}
}
}
/// <summary>
/// Gets or sets the minimum width of columns in the <see cref="DataGrid"/>.
/// </summary>
public double MinColumnWidth
{
get { return (double)GetValue(MinColumnWidthProperty); }
set { SetValue(MinColumnWidthProperty, value); }
}
/// <summary>
/// Identifies the MinColumnWidth dependency property.
/// </summary>
public static readonly DependencyProperty MinColumnWidthProperty =
DependencyProperty.Register(
"MinColumnWidth",
typeof(double),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultMinColumnWidth, OnMinColumnWidthPropertyChanged));
/// <summary>
/// MinColumnWidthProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its ColumnWidth.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnMinColumnWidthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double oldValue = (double)e.OldValue;
double newValue = (double)e.NewValue;
if (double.IsNaN(newValue))
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueCannotBeSetToNAN("MinColumnWidth");
}
if (newValue < 0)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "MinColumnWidth", 0);
}
if (double.IsPositiveInfinity(newValue))
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueCannotBeSetToInfinity("MinColumnWidth");
}
if (dataGrid.MaxColumnWidth < newValue)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeLessThanOrEqualTo("value", "MinColumnWidth", "MaxColumnWidth");
}
foreach (DataGridColumn column in dataGrid.ColumnsInternal.GetDisplayedColumns())
{
dataGrid.OnColumnMinWidthChanged(column, Math.Max(column.MinWidth, oldValue));
}
}
}
/// <summary>
/// Gets or sets the <see cref="T:System.Windows.Media.Brush"/> that is used to paint row backgrounds.
/// </summary>
public Brush RowBackground
{
get { return GetValue(RowBackgroundProperty) as Brush; }
set { SetValue(RowBackgroundProperty, value); }
}
/// <summary>
/// Identifies the <see cref="RowBackground"/> dependency property.
/// </summary>
public static readonly DependencyProperty RowBackgroundProperty =
DependencyProperty.Register(
"RowBackground",
typeof(Brush),
typeof(DataGrid),
new PropertyMetadata(null, OnRowBackgroundPropertyChanged));
private static void OnRowBackgroundPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
// Go through the Displayed rows and update the background
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureBackground();
}
}
/// <summary>
/// Gets or sets the template that is used to display the content of the details section of rows.
/// </summary>
public DataTemplate RowDetailsTemplate
{
get { return GetValue(RowDetailsTemplateProperty) as DataTemplate; }
set { SetValue(RowDetailsTemplateProperty, value); }
}
/// <summary>
/// Identifies the RowDetailsTemplate dependency property.
/// </summary>
public static readonly DependencyProperty RowDetailsTemplateProperty =
DependencyProperty.Register(
"RowDetailsTemplate",
typeof(DataTemplate),
typeof(DataGrid),
new PropertyMetadata(null, OnRowDetailsTemplatePropertyChanged));
private static void OnRowDetailsTemplatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
// Update the RowDetails templates if necessary
if (dataGrid._rowsPresenter != null)
{
foreach (DataGridRow row in dataGrid.GetAllRows())
{
if (dataGrid.GetRowDetailsVisibility(row.Index) == Visibility.Visible)
{
// DetailsPreferredHeight is initialized when the DetailsElement's size changes.
row.ApplyDetailsTemplate(false /*initializeDetailsPreferredHeight*/);
}
}
}
dataGrid.UpdateRowDetailsHeightEstimate();
dataGrid.InvalidateMeasure();
}
/// <summary>
/// Gets or sets a value indicating when the details sections of rows are displayed.
/// </summary>
public DataGridRowDetailsVisibilityMode RowDetailsVisibilityMode
{
get { return (DataGridRowDetailsVisibilityMode)GetValue(RowDetailsVisibilityModeProperty); }
set { SetValue(RowDetailsVisibilityModeProperty, value); }
}
/// <summary>
/// Identifies the RowDetailsVisibilityMode dependency property.
/// </summary>
public static readonly DependencyProperty RowDetailsVisibilityModeProperty =
DependencyProperty.Register(
"RowDetailsVisibilityMode",
typeof(DataGridRowDetailsVisibilityMode),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultRowDetailsVisibility, OnRowDetailsVisibilityModePropertyChanged));
/// <summary>
/// RowDetailsVisibilityModeProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its RowDetailsVisibilityMode.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnRowDetailsVisibilityModePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
dataGrid.UpdateRowDetailsVisibilityMode((DataGridRowDetailsVisibilityMode)e.NewValue);
}
/// <summary>
/// Gets or sets the <see cref="T:System.Windows.Media.Brush"/> that is used as the default cells foreground.
/// </summary>
public Brush RowForeground
{
get { return GetValue(RowForegroundProperty) as Brush; }
set { SetValue(RowForegroundProperty, value); }
}
/// <summary>
/// Identifies the <see cref="RowForeground"/> dependency property.
/// </summary>
public static readonly DependencyProperty RowForegroundProperty =
DependencyProperty.Register(
"RowForeground",
typeof(Brush),
typeof(DataGrid),
new PropertyMetadata(null, OnRowForegroundPropertyChanged));
private static void OnRowForegroundPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
// Go through the Displayed rows and update the foreground
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureForeground();
}
}
/// <summary>
/// Gets or sets the standard height of rows in the control.
/// </summary>
public double RowHeight
{
get { return (double)GetValue(RowHeightProperty); }
set { SetValue(RowHeightProperty, value); }
}
/// <summary>
/// Identifies the RowHeight dependency property.
/// </summary>
public static readonly DependencyProperty RowHeightProperty =
DependencyProperty.Register(
"RowHeight",
typeof(double),
typeof(DataGrid),
new PropertyMetadata(double.NaN, OnRowHeightPropertyChanged));
/// <summary>
/// RowHeightProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its RowHeight.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnRowHeightPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double value = (double)e.NewValue;
if (value < DataGridRow.DATAGRIDROW_minimumHeight)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "RowHeight", 0);
}
if (value > DataGridRow.DATAGRIDROW_maximumHeight)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeLessThanOrEqualTo("value", "RowHeight", DataGridRow.DATAGRIDROW_maximumHeight);
}
dataGrid.InvalidateRowHeightEstimate();
// Re-measure all the rows due to the Height change
dataGrid.InvalidateRowsMeasure(true);
// DataGrid needs to update the layout information and the ScrollBars
dataGrid.InvalidateMeasure();
}
}
/// <summary>
/// Gets or sets the width of the row header column.
/// </summary>
public double RowHeaderWidth
{
get { return (double)GetValue(RowHeaderWidthProperty); }
set { SetValue(RowHeaderWidthProperty, value); }
}
/// <summary>
/// Identifies the RowHeaderWidth dependency property.
/// </summary>
public static readonly DependencyProperty RowHeaderWidthProperty =
DependencyProperty.Register(
"RowHeaderWidth",
typeof(double),
typeof(DataGrid),
new PropertyMetadata(double.NaN, OnRowHeaderWidthPropertyChanged));
/// <summary>
/// RowHeaderWidthProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its RowHeaderWidth.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnRowHeaderWidthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
double value = (double)e.NewValue;
if (value < DATAGRID_minimumRowHeaderWidth)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "RowHeaderWidth", DATAGRID_minimumRowHeaderWidth);
}
if (value > DATAGRID_maxHeadersThickness)
{
dataGrid.SetValueNoCallback(e.Property, e.OldValue);
throw DataGridError.DataGrid.ValueMustBeLessThanOrEqualTo("value", "RowHeaderWidth", DATAGRID_maxHeadersThickness);
}
dataGrid.EnsureRowHeaderWidth();
}
}
/// <summary>
/// Gets or sets the style that is used when rendering the row headers.
/// </summary>
public Style RowHeaderStyle
{
get { return GetValue(RowHeaderStyleProperty) as Style; }
set { SetValue(RowHeaderStyleProperty, value); }
}
/// <summary>
/// Identifies the <see cref="RowHeaderStyle"/> dependency property.
/// </summary>
public static readonly DependencyProperty RowHeaderStyleProperty =
DependencyProperty.Register(
"RowHeaderStyle",
typeof(Style),
typeof(DataGrid),
new PropertyMetadata(null, OnRowHeaderStylePropertyChanged));
private static void OnRowHeaderStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (dataGrid != null && dataGrid._rowsPresenter != null)
{
// Set HeaderStyle for displayed rows
Style previousStyle = e.OldValue as Style;
foreach (UIElement element in dataGrid._rowsPresenter.Children)
{
DataGridRow row = element as DataGridRow;
if (row != null)
{
row.EnsureHeaderStyleAndVisibility(previousStyle);
}
else
{
DataGridRowGroupHeader groupHeader = element as DataGridRowGroupHeader;
if (groupHeader != null)
{
groupHeader.EnsureHeaderStyleAndVisibility(previousStyle);
}
}
}
dataGrid.InvalidateRowHeightEstimate();
}
}
/// <summary>
/// Gets or sets the style that is used when rendering the rows.
/// </summary>
public Style RowStyle
{
get { return GetValue(RowStyleProperty) as Style; }
set { SetValue(RowStyleProperty, value); }
}
/// <summary>
/// Identifies the <see cref="RowStyle"/> dependency property.
/// </summary>
public static readonly DependencyProperty RowStyleProperty =
DependencyProperty.Register(
"RowStyle",
typeof(Style),
typeof(DataGrid),
new PropertyMetadata(null, OnRowStylePropertyChanged));
private static void OnRowStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (dataGrid != null)
{
if (dataGrid._rowsPresenter != null)
{
// Set the style for displayed rows if it has not already been set
foreach (DataGridRow row in dataGrid.GetAllRows())
{
EnsureElementStyle(row, e.OldValue as Style, e.NewValue as Style);
}
}
dataGrid.InvalidateRowHeightEstimate();
}
}
/// <summary>
/// Gets or sets the selection behavior of the data grid.
/// </summary>
public DataGridSelectionMode SelectionMode
{
get { return (DataGridSelectionMode)GetValue(SelectionModeProperty); }
set { SetValue(SelectionModeProperty, value); }
}
/// <summary>
/// Identifies the SelectionMode dependency property.
/// </summary>
public static readonly DependencyProperty SelectionModeProperty =
DependencyProperty.Register(
"SelectionMode",
typeof(DataGridSelectionMode),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultSelectionMode, OnSelectionModePropertyChanged));
/// <summary>
/// SelectionModeProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its SelectionMode.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnSelectionModePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
dataGrid.ClearRowSelection(true /*resetAnchorSlot*/);
}
}
/// <summary>
/// Gets or sets the index of the current selection.
/// </summary>
/// <returns>The index of the current selection, or -1 if the selection is empty.</returns>
public int SelectedIndex
{
get { return (int)GetValue(SelectedIndexProperty); }
set { SetValue(SelectedIndexProperty, value); }
}
/// <summary>
/// Identifies the SelectedIndex dependency property.
/// </summary>
public static readonly DependencyProperty SelectedIndexProperty =
DependencyProperty.Register(
"SelectedIndex",
typeof(int),
typeof(DataGrid),
new PropertyMetadata(-1, OnSelectedIndexPropertyChanged));
/// <summary>
/// SelectedIndexProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its SelectedIndex.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnSelectedIndexPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
int index = (int)e.NewValue;
// GetDataItem returns null if index is >= Count, we do not check newValue
// against Count here to avoid enumerating through an Enumerable twice
// Setting SelectedItem coerces the finally value of the SelectedIndex
object newSelectedItem = (index < 0) ? null : dataGrid.DataConnection.GetDataItem(index);
dataGrid.SelectedItem = newSelectedItem;
if (dataGrid.SelectedItem != newSelectedItem)
{
d.SetValueNoCallback(e.Property, e.OldValue);
}
}
}
/// <summary>
/// Gets or sets the data item corresponding to the selected row.
/// </summary>
public object SelectedItem
{
get { return GetValue(SelectedItemProperty) as object; }
set { SetValue(SelectedItemProperty, value); }
}
/// <summary>
/// Identifies the SelectedItem dependency property.
/// </summary>
public static readonly DependencyProperty SelectedItemProperty =
DependencyProperty.Register(
"SelectedItem",
typeof(object),
typeof(DataGrid),
new PropertyMetadata(null, OnSelectedItemPropertyChanged));
/// <summary>
/// SelectedItemProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its SelectedItem.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnSelectedItemPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property))
{
int rowIndex = (e.NewValue == null) ? -1 : dataGrid.DataConnection.IndexOf(e.NewValue);
if (rowIndex == -1)
{
// If the Item is null or it's not found, clear the Selection
if (!dataGrid.CommitEdit(DataGridEditingUnit.Row, true /*exitEditing*/))
{
// Edited value couldn't be committed or aborted
d.SetValueNoCallback(e.Property, e.OldValue);
return;
}
// Clear all row selections
dataGrid.ClearRowSelection(true /*resetAnchorSlot*/);
}
else
{
int slot = dataGrid.SlotFromRowIndex(rowIndex);
if (slot != dataGrid.CurrentSlot)
{
if (!dataGrid.CommitEdit(DataGridEditingUnit.Row, true /*exitEditing*/))
{
// Edited value couldn't be committed or aborted
d.SetValueNoCallback(e.Property, e.OldValue);
return;
}
if (slot >= dataGrid.SlotCount || slot < -1)
{
if (dataGrid.DataConnection.CollectionView != null)
{
dataGrid.DataConnection.CollectionView.MoveCurrentToPosition(rowIndex);
}
}
}
int oldSelectedIndex = dataGrid.SelectedIndex;
if (oldSelectedIndex != rowIndex)
{
dataGrid.SetValueNoCallback(DataGrid.SelectedIndexProperty, rowIndex);
}
try
{
dataGrid._noSelectionChangeCount++;
int columnIndex = dataGrid.CurrentColumnIndex;
if (columnIndex == -1)
{
columnIndex = dataGrid.FirstDisplayedNonFillerColumnIndex;
}
if (dataGrid.IsSlotOutOfSelectionBounds(slot))
{
dataGrid.ClearRowSelection(slot /*slotException*/, true /*resetAnchorSlot*/);
return;
}
dataGrid.UpdateSelectionAndCurrency(columnIndex, slot, DataGridSelectionAction.SelectCurrent, false /*scrollIntoView*/);
}
finally
{
dataGrid.NoSelectionChangeCount--;
}
if (!dataGrid._successfullyUpdatedSelection)
{
dataGrid.SetValueNoCallback(DataGrid.SelectedIndexProperty, oldSelectedIndex);
d.SetValueNoCallback(e.Property, e.OldValue);
}
}
}
}
/// <summary>
/// Gets or sets the <see cref="T:System.Windows.Media.Brush"/> that is used to paint grid lines separating columns.
/// </summary>
public Brush VerticalGridLinesBrush
{
get { return GetValue(VerticalGridLinesBrushProperty) as Brush; }
set { SetValue(VerticalGridLinesBrushProperty, value); }
}
/// <summary>
/// Identifies the VerticalGridLinesBrush dependency property.
/// </summary>
public static readonly DependencyProperty VerticalGridLinesBrushProperty =
DependencyProperty.Register(
"VerticalGridLinesBrush",
typeof(Brush),
typeof(DataGrid),
new PropertyMetadata(null, OnVerticalGridLinesBrushPropertyChanged));
/// <summary>
/// VerticalGridLinesBrushProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its VerticalGridLinesBrush.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnVerticalGridLinesBrushPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (dataGrid._rowsPresenter != null)
{
foreach (DataGridRow row in dataGrid.GetAllRows())
{
row.EnsureGridLines();
}
}
}
/// <summary>
/// Gets or sets a value indicating how the vertical scroll bar is displayed.
/// </summary>
public ScrollBarVisibility VerticalScrollBarVisibility
{
get { return (ScrollBarVisibility)GetValue(VerticalScrollBarVisibilityProperty); }
set { SetValue(VerticalScrollBarVisibilityProperty, value); }
}
/// <summary>
/// Identifies the VerticalScrollBarVisibility dependency property.
/// </summary>
public static readonly DependencyProperty VerticalScrollBarVisibilityProperty =
DependencyProperty.Register(
"VerticalScrollBarVisibility",
typeof(ScrollBarVisibility),
typeof(DataGrid),
new PropertyMetadata(DATAGRID_defaultScrollBarVisibility, OnVerticalScrollBarVisibilityPropertyChanged));
/// <summary>
/// VerticalScrollBarVisibilityProperty property changed handler.
/// </summary>
/// <param name="d">DataGrid that changed its VerticalScrollBarVisibility.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnVerticalScrollBarVisibilityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGrid dataGrid = d as DataGrid;
if (!dataGrid.IsHandlerSuspended(e.Property) && (ScrollBarVisibility)e.NewValue != (ScrollBarVisibility)e.OldValue)
{
dataGrid.UpdateRowsPresenterManipulationMode(false /*horizontalMode*/, true /*verticalMode*/);
if (dataGrid._vScrollBar != null)
{
if (dataGrid.IsVerticalScrollBarOverCells)
{
dataGrid.ComputeScrollBarsLayout();
}
else
{
dataGrid.InvalidateMeasure();
}
}
}
}
/// <summary>
/// Gets a collection that contains all the columns in the control.
/// </summary>
public ObservableCollection<DataGridColumn> Columns
{
get
{
// we use a backing field here because the field's type
// is a subclass of the property's
return this.ColumnsInternal;
}
}
/// <summary>
/// Gets or sets the column that contains the current cell.
/// </summary>
public DataGridColumn CurrentColumn
{
get
{
if (this.CurrentColumnIndex == -1)
{
return null;
}
DiagnosticsDebug.Assert(this.CurrentColumnIndex < this.ColumnsItemsInternal.Count, "Expected CurrentColumnIndex smaller than ColumnsItemsInternal.Count.");
return this.ColumnsItemsInternal[this.CurrentColumnIndex];
}
set
{
DataGridColumn dataGridColumn = value;
if (dataGridColumn == null)
{
throw DataGridError.DataGrid.ValueCannotBeSetToNull("value", "CurrentColumn");
}
if (this.CurrentColumn != dataGridColumn)
{
if (dataGridColumn.OwningGrid != this)
{
// Provided column does not belong to this DataGrid
throw DataGridError.DataGrid.ColumnNotInThisDataGrid();
}
if (dataGridColumn.Visibility == Visibility.Collapsed)
{
// CurrentColumn cannot be set to an invisible column
throw DataGridError.DataGrid.ColumnCannotBeCollapsed();
}
if (this.CurrentSlot == -1)
{
// There is no current row so the current column cannot be set
throw DataGridError.DataGrid.NoCurrentRow();
}
bool beginEdit = _editingColumnIndex != -1;
if (!EndCellEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, this.ContainsFocus /*keepFocus*/, true /*raiseEvents*/))
{
// Edited value couldn't be committed or aborted
return;
}
if (_noFocusedColumnChangeCount == 0)
{
this.ColumnHeaderHasFocus = false;
}
this.UpdateSelectionAndCurrency(dataGridColumn.Index, this.CurrentSlot, DataGridSelectionAction.None, false /*scrollIntoView*/);
DiagnosticsDebug.Assert(_successfullyUpdatedSelection, "Expected _successfullyUpdatedSelection is true.");
if (beginEdit &&
_editingColumnIndex == -1 &&
this.CurrentSlot != -1 &&
this.CurrentColumnIndex != -1 &&
this.CurrentColumnIndex == dataGridColumn.Index &&
dataGridColumn.OwningGrid == this &&
!GetColumnEffectiveReadOnlyState(dataGridColumn))
{
// Returning to editing mode since the grid was in that mode prior to the EndCellEdit call above.
BeginCellEdit(new RoutedEventArgs());
}
}
}
}
/// <summary>
/// Gets or sets the label to display in a DataGridRowGroupHeader when its PropertyName is not set.
/// </summary>
public string RowGroupHeaderPropertyNameAlternative
{
get
{
return _rowGroupHeaderPropertyNameAlternative;
}
set
{
_rowGroupHeaderPropertyNameAlternative = value;
}
}
/// <summary>
/// Gets the style that is used when rendering the row group header.
/// </summary>
public ObservableCollection<Style> RowGroupHeaderStyles
{
get
{
return _rowGroupHeaderStyles;
}
}
/// <summary>
/// Gets a list that contains the data items corresponding to the selected rows.
/// </summary>
public IList SelectedItems
{
get { return _selectedItems as IList; }
}
/// <summary>
/// Gets the data item bound to the row that contains the current cell.
/// </summary>
protected object CurrentItem
{
get
{
if (this.CurrentSlot == -1 ||
this.RowGroupHeadersTable.Contains(this.CurrentSlot) ||
this.ItemsSource /*this.DataConnection.DataSource*/ == null)
{
return null;
}
return this.DataConnection.GetDataItem(RowIndexFromSlot(this.CurrentSlot));
}
}
internal static double HorizontalGridLinesThickness
{
get
{
return DATAGRID_horizontalGridLinesThickness;
}
}
internal int AnchorSlot
{
get;
private set;
}
internal double ActualRowHeaderWidth
{
get
{
if (!this.AreRowHeadersVisible)
{
return 0;
}
else
{
return !double.IsNaN(this.RowHeaderWidth) ? this.RowHeaderWidth : this.RowHeadersDesiredWidth;
}
}
}
internal double ActualRowsPresenterHeight
{
get
{
if (_rowsPresenter != null)
{
return _rowsPresenter.ActualHeight;
}
return 0;
}
}
internal bool AllowsManipulation
{
get
{
return _rowsPresenter != null &&
(_rowsPresenter.ManipulationMode & (ManipulationModes.TranslateX | ManipulationModes.TranslateY)) != ManipulationModes.None;
}
}
internal bool AreColumnHeadersVisible
{
get
{
return (this.HeadersVisibility & DataGridHeadersVisibility.Column) == DataGridHeadersVisibility.Column;
}
}
internal bool AreRowHeadersVisible
{
get
{
return (this.HeadersVisibility & DataGridHeadersVisibility.Row) == DataGridHeadersVisibility.Row;
}
}
/// <summary>
/// Gets or sets a value indicating whether or not at least one auto-sizing column is waiting for all the rows
/// to be measured before its final width is determined.
/// </summary>
internal bool AutoSizingColumns
{
get
{
return _autoSizingColumns;
}
set
{
if (_autoSizingColumns && value == false && this.ColumnsInternal != null)
{
double adjustment = this.CellsWidth - this.ColumnsInternal.VisibleEdgedColumnsWidth;
this.AdjustColumnWidths(0, adjustment, false);
foreach (DataGridColumn column in this.ColumnsInternal.GetVisibleColumns())
{
column.IsInitialDesiredWidthDetermined = true;
}
this.ColumnsInternal.EnsureVisibleEdgedColumnsWidth();
this.ComputeScrollBarsLayout();
InvalidateColumnHeadersMeasure();
InvalidateRowsMeasure(true);
}
_autoSizingColumns = value;
}
}
internal double AvailableSlotElementRoom
{
get;
set;
}
// Height currently available for cells this value is smaller. This height is reduced by the existence of ColumnHeaders
// or a horizontal scrollbar. Layout is asynchronous so changes to the ColumnHeaders or the horizontal scrollbar are
// not reflected immediately.
internal double CellsHeight
{
get
{
return this.RowsPresenterAvailableSize.HasValue ? this.RowsPresenterAvailableSize.Value.Height : 0;
}
}
// Width currently available for cells this value is smaller. This width is reduced by the existence of RowHeaders
// or a vertical scrollbar. Layout is asynchronous so changes to the RowHeaders or the vertical scrollbar are
// not reflected immediately
internal double CellsWidth
{
get
{
double rowsWidth = double.PositiveInfinity;
if (this.RowsPresenterAvailableSize.HasValue)
{
rowsWidth = Math.Max(0, this.RowsPresenterAvailableSize.Value.Width - this.ActualRowHeaderWidth);
}
return double.IsPositiveInfinity(rowsWidth) ? this.ColumnsInternal.VisibleEdgedColumnsWidth : rowsWidth;
}
}
/// <summary>
/// Gets an empty content control that's used during the DataGrid's copy procedure
/// to determine the value of a ClipboardContentBinding for a particular column and item.
/// </summary>
internal ContentControl ClipboardContentControl
{
get
{
if (_clipboardContentControl == null)
{
_clipboardContentControl = new ContentControl();
}
return _clipboardContentControl;
}
}
internal bool ColumnHeaderHasFocus
{
get
{
return _columnHeaderHasFocus;
}
set
{
DiagnosticsDebug.Assert(!value || (this.ColumnHeaders != null && this.AreColumnHeadersVisible), "Expected value==False || (non-null ColumnHeaders and AreColumnHeadersVisible==True)");
if (_columnHeaderHasFocus != value)
{
_columnHeaderHasFocus = value;
if (this.CurrentColumn != null && this.IsSlotVisible(this.CurrentSlot))
{
UpdateCurrentState(this.DisplayData.GetDisplayedElement(this.CurrentSlot), this.CurrentColumnIndex, true /*applyCellState*/);
}
DataGridColumn oldFocusedColumn = this.FocusedColumn;
this.FocusedColumn = null;
if (_columnHeaderHasFocus)
{
this.FocusedColumn = this.CurrentColumn == null ? this.ColumnsInternal.FirstVisibleNonFillerColumn : this.CurrentColumn;
}
if (oldFocusedColumn != null && oldFocusedColumn.HasHeaderCell)
{
oldFocusedColumn.HeaderCell.ApplyState(true);
}
if (this.FocusedColumn != null && this.FocusedColumn.HasHeaderCell)
{
this.FocusedColumn.HeaderCell.ApplyState(true);
ScrollColumnIntoView(this.FocusedColumn.Index);
}
}
}
}
internal DataGridColumnHeaderInteractionInfo ColumnHeaderInteractionInfo
{
get;
set;
}
internal DataGridColumnHeadersPresenter ColumnHeaders
{
get
{
return _columnHeadersPresenter;
}
}
internal DataGridColumnCollection ColumnsInternal
{
get;
private set;
}
internal List<DataGridColumn> ColumnsItemsInternal
{
get
{
return this.ColumnsInternal.ItemsInternal;
}
}
internal bool ContainsFocus
{
get;
private set;
}
internal int CurrentColumnIndex
{
get
{
return this.CurrentCellCoordinates.ColumnIndex;
}
private set
{
this.CurrentCellCoordinates.ColumnIndex = value;
}
}
internal int CurrentSlot
{
get
{
return this.CurrentCellCoordinates.Slot;
}
private set
{
this.CurrentCellCoordinates.Slot = value;
}
}
internal DataGridDataConnection DataConnection
{
get;
private set;
}
internal DataGridDisplayData DisplayData
{
get;
private set;
}
internal int EditingColumnIndex
{
get
{
return _editingColumnIndex;
}
}
internal DataGridRow EditingRow
{
get;
private set;
}
internal double FirstDisplayedScrollingColumnHiddenWidth
{
get
{
return _negHorizontalOffset;
}
}
internal DataGridColumn FocusedColumn
{
get;
set;
}
internal bool HasColumnUserInteraction
{
get
{
return this.ColumnHeaderInteractionInfo.HasUserInteraction;
}
}
// When the RowsPresenter's width increases, the HorizontalOffset will be incorrect until
// the scrollbar's layout is recalculated, which doesn't occur until after the cells are measured.
// This property exists to account for this scenario, and avoid collapsing the incorrect cells.
internal double HorizontalAdjustment
{
get;
private set;
}
// the sum of the widths in pixels of the scrolling columns preceding
// the first displayed scrolling column
internal double HorizontalOffset
{
get
{
return _horizontalOffset;
}
set
{
if (value < 0)
{
value = 0;
}
double widthNotVisible = Math.Max(0, this.ColumnsInternal.VisibleEdgedColumnsWidth - this.CellsWidth);
if (value > widthNotVisible)
{
value = widthNotVisible;
}
if (value == _horizontalOffset)
{
return;
}
SetHorizontalOffset(value);
_horizontalOffset = value;
this.DisplayData.FirstDisplayedScrollingCol = ComputeFirstVisibleScrollingColumn();
// update the lastTotallyDisplayedScrollingCol
ComputeDisplayedColumns();
}
}
internal ScrollBar HorizontalScrollBar
{
get
{
return _hScrollBar;
}
}
internal bool LoadingOrUnloadingRow
{
get;
private set;
}
internal bool InDisplayIndexAdjustments
{
get;
set;
}
internal double NegVerticalOffset
{
get;
private set;
}
internal int NoCurrentCellChangeCount
{
get
{
return _noCurrentCellChangeCount;
}
set
{
DiagnosticsDebug.Assert(value >= 0, "Expected positive NoCurrentCellChangeCount.");
_noCurrentCellChangeCount = value;
if (value == 0)
{
FlushCurrentCellChanged();
}
}
}
internal double RowDetailsHeightEstimate
{
get;
private set;
}
internal double RowHeadersDesiredWidth
{
get
{
return _rowHeaderDesiredWidth;
}
set
{
// We only auto grow
if (_rowHeaderDesiredWidth < value)
{
double oldActualRowHeaderWidth = this.ActualRowHeaderWidth;
_rowHeaderDesiredWidth = value;
if (oldActualRowHeaderWidth != this.ActualRowHeaderWidth)
{
bool invalidated = EnsureRowHeaderWidth();
// If we didn't invalidate in Ensure and we have star columns, force the column widths to be recomputed here.
if (!invalidated && this.ColumnsInternal.VisibleStarColumnCount > 0)
{
this.ColumnsInternal.EnsureVisibleEdgedColumnsWidth();
InvalidateMeasure();
}
}
}
}
}
internal double RowGroupHeaderHeightEstimate
{
get;
private set;
}
internal IndexToValueTable<DataGridRowGroupInfo> RowGroupHeadersTable
{
get;
private set;
}
internal double[] RowGroupSublevelIndents
{
get;
private set;
}
internal double RowHeightEstimate
{
get;
private set;
}
internal Size? RowsPresenterAvailableSize
{
get
{
return _rowsPresenterAvailableSize;
}
set
{
if (_rowsPresenterAvailableSize.HasValue && value.HasValue && value.Value.Width > this.RowsPresenterAvailableSize.Value.Width)
{
// When the available cells width increases, the horizontal offset can be incorrect.
// Store away an adjustment to use during the CellsPresenter's measure, so that the
// ShouldDisplayCell method correctly determines if a cell will be in view.
//
// | h. offset | new available cells width |
// |-------------->|----------------------------------------->|
// __________________________________________________ |
// | | | | | |
// | column0 | column1 | column2 | column3 |<----->|
// | | | | | adj. |
double adjustment = (_horizontalOffset + value.Value.Width) - this.ColumnsInternal.VisibleEdgedColumnsWidth;
this.HorizontalAdjustment = Math.Min(this.HorizontalOffset, Math.Max(0, adjustment));
}
else
{
this.HorizontalAdjustment = 0;
}
bool loadMoreDataFromIncrementalItemsSource = _rowsPresenterAvailableSize.HasValue && value.HasValue && value.Value.Height > _rowsPresenterAvailableSize.Value.Height;
_rowsPresenterAvailableSize = value;
if (loadMoreDataFromIncrementalItemsSource)
{
LoadMoreDataFromIncrementalItemsSource();
}
}
}
// This flag indicates whether selection has actually changed during a selection operation,
// and exists to ensure that FlushSelectionChanged doesn't unnecessarily raise SelectionChanged.
internal bool SelectionHasChanged
{
get;
set;
}
internal int SlotCount
{
get;
private set;
}
internal bool UpdatedStateOnTapped
{
get;
set;
}
/// <summary>
/// Gets a value indicating whether or not to use star-sizing logic. If the DataGrid has infinite available space,
/// then star sizing doesn't make sense. In this case, all star columns grow to a predefined size of
/// 10,000 pixels in order to show the developer that star columns shouldn't be used.
/// </summary>
internal bool UsesStarSizing
{
get
{
if (this.ColumnsInternal != null)
{
return this.ColumnsInternal.VisibleStarColumnCount > 0 &&
(!this.RowsPresenterAvailableSize.HasValue || !double.IsPositiveInfinity(this.RowsPresenterAvailableSize.Value.Width));
}
return false;
}
}
internal double VerticalOffset
{
get
{
return _verticalOffset;
}
set
{
bool loadMoreDataFromIncrementalItemsSource = _verticalOffset < value;
_verticalOffset = value;
if (loadMoreDataFromIncrementalItemsSource)
{
LoadMoreDataFromIncrementalItemsSource();
}
}
}
internal ScrollBar VerticalScrollBar
{
get
{
return _vScrollBar;
}
}
internal int VisibleSlotCount
{
get;
set;
}
private bool AreAllScrollBarsCollapsed
{
get
{
return (_hScrollBar == null || _hScrollBar.Visibility == Visibility.Collapsed) &&
(_vScrollBar == null || _vScrollBar.Visibility == Visibility.Collapsed);
}
}
private bool AreBothScrollBarsVisible
{
get
{
return _hScrollBar != null && _hScrollBar.Visibility == Visibility.Visible &&
_vScrollBar != null && _vScrollBar.Visibility == Visibility.Visible;
}
}
private DataGridCellCoordinates CurrentCellCoordinates
{
get
{
return _currentCellCoordinates;
}
set
{
_currentCellCoordinates = value;
}
}
private int FirstDisplayedNonFillerColumnIndex
{
get
{
DataGridColumn column = this.ColumnsInternal.FirstVisibleNonFillerColumn;
if (column != null)
{
if (column.IsFrozen)
{
return column.Index;
}
else
{
if (this.DisplayData.FirstDisplayedScrollingCol >= column.Index)
{
return this.DisplayData.FirstDisplayedScrollingCol;
}
else
{
return column.Index;
}
}
}
return -1;
}
}
private bool IsHorizontalScrollBarInteracting
{
get
{
return _isHorizontalScrollBarInteracting;
}
set
{
if (_isHorizontalScrollBarInteracting != value)
{
_isHorizontalScrollBarInteracting = value;
if (_hScrollBar != null)
{
if (_isHorizontalScrollBarInteracting)
{
// Prevent the vertical scroll bar from fading out while the user is interacting with the horizontal one.
_keepScrollBarsShowing = true;
ShowScrollBars();
}
else
{
// Make the scroll bars fade out, after the normal delay.
_keepScrollBarsShowing = false;
HideScrollBars(true /*useTransitions*/);
}
}
}
}
}
private bool IsHorizontalScrollBarOverCells
{
get
{
return _columnHeadersPresenter != null && Grid.GetColumnSpan(_columnHeadersPresenter) == 2;
}
}
private bool IsVerticalScrollBarInteracting
{
get
{
return _isVerticalScrollBarInteracting;
}
set
{
if (_isVerticalScrollBarInteracting != value)
{
_isVerticalScrollBarInteracting = value;
if (_vScrollBar != null)
{
if (_isVerticalScrollBarInteracting)
{
// Prevent the horizontal scroll bar from fading out while the user is interacting with the vertical one.
_keepScrollBarsShowing = true;
ShowScrollBars();
}
else
{
// Make the scroll bars fade out, after the normal delay.
_keepScrollBarsShowing = false;
HideScrollBars(true /*useTransitions*/);
}
}
}
}
}
private bool IsVerticalScrollBarOverCells
{
get
{
return _rowsPresenter != null && Grid.GetRowSpan(_rowsPresenter) == 2;
}
}
private VirtualKey LastHandledKeyDown
{
get;
set;
}
private int NoSelectionChangeCount
{
get
{
return _noSelectionChangeCount;
}
set
{
DiagnosticsDebug.Assert(value >= 0, "Expected positive NoSelectionChangeCount.");
_noSelectionChangeCount = value;
if (value == 0)
{
FlushSelectionChanged();
}
}
}
/// <summary>
/// Enters editing mode for the current cell and current row (if they're not already in editing mode).
/// </summary>
/// <returns>True if operation was successful. False otherwise.</returns>
public bool BeginEdit()
{
return BeginEdit(null);
}
/// <summary>
/// Enters editing mode for the current cell and current row (if they're not already in editing mode).
/// </summary>
/// <param name="editingEventArgs">Provides information about the user gesture that caused the call to BeginEdit. Can be null.</param>
/// <returns>True if operation was successful. False otherwise.</returns>
public bool BeginEdit(RoutedEventArgs editingEventArgs)
{
if (this.CurrentColumnIndex == -1 || !GetRowSelection(this.CurrentSlot))
{
return false;
}
DiagnosticsDebug.Assert(this.CurrentColumnIndex >= 0, "Expected positive CurrentColumnIndex.");
DiagnosticsDebug.Assert(this.CurrentColumnIndex < this.ColumnsItemsInternal.Count, "Expected CurrentColumnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.CurrentSlot >= -1, "Expected CurrentSlot greater than or equal to -1.");
DiagnosticsDebug.Assert(this.CurrentSlot < this.SlotCount, "Expected CurrentSlot smaller than SlotCount.");
DiagnosticsDebug.Assert(this.EditingRow == null || this.EditingRow.Slot == this.CurrentSlot, "Expected null EditingRow or EditingRow.Slot equal to CurrentSlot.");
if (GetColumnEffectiveReadOnlyState(this.CurrentColumn))
{
// Current column is read-only
return false;
}
return BeginCellEdit(editingEventArgs);
}
/// <summary>
/// Cancels editing mode and restores the original value.
/// </summary>
/// <returns>True if operation was successful. False otherwise.</returns>
public bool CancelEdit()
{
return CancelEdit(DataGridEditingUnit.Row);
}
/// <summary>
/// Cancels editing mode for the specified DataGridEditingUnit and restores its original value.
/// </summary>
/// <param name="editingUnit">Specifies whether to cancel edit for a Cell or Row.</param>
/// <returns>True if operation was successful. False otherwise.</returns>
public bool CancelEdit(DataGridEditingUnit editingUnit)
{
return this.CancelEdit(editingUnit, true /*raiseEvents*/);
}
/// <summary>
/// Commits editing mode and pushes changes to the backend.
/// </summary>
/// <returns>True if operation was successful. False otherwise.</returns>
public bool CommitEdit()
{
return CommitEdit(DataGridEditingUnit.Row, true);
}
/// <summary>
/// Commits editing mode for the specified DataGridEditingUnit and pushes changes to the backend.
/// </summary>
/// <param name="editingUnit">Specifies whether to commit edit for a Cell or Row.</param>
/// <param name="exitEditingMode">Editing mode is left if True.</param>
/// <returns>True if operation was successful. False otherwise.</returns>
public bool CommitEdit(DataGridEditingUnit editingUnit, bool exitEditingMode)
{
if (!EndCellEdit(DataGridEditAction.Commit, editingUnit == DataGridEditingUnit.Cell ? exitEditingMode : true, this.ContainsFocus /*keepFocus*/, true /*raiseEvents*/))
{
return false;
}
if (editingUnit == DataGridEditingUnit.Row)
{
return EndRowEdit(DataGridEditAction.Commit, exitEditingMode, true /*raiseEvents*/);
}
return true;
}
/// <summary>
/// Returns the Group at the indicated level or null if the item is not in the ItemsSource
/// </summary>
/// <param name="item">item</param>
/// <param name="groupLevel">groupLevel</param>
/// <returns>The group the given item falls under or null if the item is not in the ItemsSource</returns>
public ICollectionViewGroup GetGroupFromItem(object item, int groupLevel)
{
int itemIndex = this.DataConnection.IndexOf(item);
if (itemIndex == -1)
{
return null;
}
int groupHeaderSlot = this.RowGroupHeadersTable.GetPreviousIndex(SlotFromRowIndex(itemIndex));
DataGridRowGroupInfo rowGroupInfo = this.RowGroupHeadersTable.GetValueAt(groupHeaderSlot);
while (rowGroupInfo != null && rowGroupInfo.Level != groupLevel)
{
groupHeaderSlot = this.RowGroupHeadersTable.GetPreviousIndex(rowGroupInfo.Slot);
rowGroupInfo = this.RowGroupHeadersTable.GetValueAt(groupHeaderSlot);
}
return rowGroupInfo == null ? null : rowGroupInfo.CollectionViewGroup;
}
/// <summary>
/// Scrolls the specified item or RowGroupHeader and/or column into view.
/// If item is not null: scrolls the row representing the item into view;
/// If column is not null: scrolls the column into view;
/// If both item and column are null, the method returns without scrolling.
/// </summary>
/// <param name="item">an item from the DataGrid's items source or a CollectionViewGroup from the collection view</param>
/// <param name="column">a column from the DataGrid's columns collection</param>
public void ScrollIntoView(object item, DataGridColumn column)
{
if ((column == null && (item == null || this.FirstDisplayedNonFillerColumnIndex == -1)) ||
(column != null && column.OwningGrid != this))
{
// no-op
return;
}
if (item == null)
{
// scroll column into view
this.ScrollSlotIntoView(column.Index, this.DisplayData.FirstScrollingSlot, false /*forCurrentCellChange*/, true /*forceHorizontalScroll*/);
}
else
{
int slot;
DataGridRowGroupInfo rowGroupInfo = null;
ICollectionViewGroup collectionViewGroup = item as ICollectionViewGroup;
if (collectionViewGroup != null)
{
rowGroupInfo = RowGroupInfoFromCollectionViewGroup(collectionViewGroup);
if (rowGroupInfo == null)
{
Debug.Fail("Expected non-null rowGroupInfo.");
return;
}
slot = rowGroupInfo.Slot;
}
else
{
// the row index will be set to -1 if the item is null or not in the list
int rowIndex = this.DataConnection.IndexOf(item);
if (rowIndex == -1 || (this.IsReadOnly && rowIndex == this.DataConnection.NewItemPlaceholderIndex))
{
return;
}
slot = SlotFromRowIndex(rowIndex);
}
int columnIndex = (column == null) ? this.FirstDisplayedNonFillerColumnIndex : column.Index;
if (_collapsedSlotsTable.Contains(slot))
{
// We need to expand all parent RowGroups so that the slot is visible
if (rowGroupInfo != null)
{
ExpandRowGroupParentChain(rowGroupInfo.Level - 1, rowGroupInfo.Slot);
}
else
{
rowGroupInfo = this.RowGroupHeadersTable.GetValueAt(this.RowGroupHeadersTable.GetPreviousIndex(slot));
DiagnosticsDebug.Assert(rowGroupInfo != null, "Expected non-null rowGroupInfo.");
if (rowGroupInfo != null)
{
ExpandRowGroupParentChain(rowGroupInfo.Level, rowGroupInfo.Slot);
}
}
// Update ScrollBar and display information
this.NegVerticalOffset = 0;
SetVerticalOffset(0);
ResetDisplayedRows();
this.DisplayData.FirstScrollingSlot = 0;
ComputeScrollBarsLayout();
}
ScrollSlotIntoView(columnIndex, slot, true /*forCurrentCellChange*/, true /*forceHorizontalScroll*/);
}
}
/// <summary>
/// Arranges the content of the <see cref="DataGridRow"/>.
/// </summary>
/// <param name="finalSize">
/// The final area within the parent that this element should use to arrange itself and its children.
/// </param>
/// <returns>
/// The actual size used by the <see cref="DataGridRow"/>.
/// </returns>
protected override Size ArrangeOverride(Size finalSize)
{
if (_makeFirstDisplayedCellCurrentCellPending)
{
MakeFirstDisplayedCellCurrentCell();
}
if (this.ActualWidth != finalSize.Width)
{
// If our final width has changed, we might need to update the filler
InvalidateColumnHeadersArrange();
InvalidateCellsArrange();
}
return base.ArrangeOverride(finalSize);
}
/// <summary>
/// Measures the children of a <see cref="DataGridRow"/> to prepare for
/// arranging them during the
/// <see cref="M:System.Windows.Controls.DataGridRow.ArrangeOverride(System.Windows.Size)"/> pass.
/// </summary>
/// <returns>
/// The size that the <see cref="DataGridRow"/> determines it needs during layout, based on its calculations of child object allocated sizes.
/// </returns>
/// <param name="availableSize">
/// The available size that this element can give to child elements. Indicates an upper limit that
/// child elements should not exceed.
/// </param>
protected override Size MeasureOverride(Size availableSize)
{
// Delay layout until after the initial measure to avoid invalid calculations when the
// DataGrid is not part of the visual tree
if (!_measured)
{
_measured = true;
// We don't need to clear the rows because it was already done when the ItemsSource changed
RefreshRowsAndColumns(false /*clearRows*/);
// Update our estimates now that the DataGrid has all of the information necessary
UpdateRowDetailsHeightEstimate();
// Update frozen columns to account for columns added prior to loading or auto-generated columns
if (this.FrozenColumnCountWithFiller > 0)
{
ProcessFrozenColumnCount(this);
}
}
Size desiredSize;
// This is a shortcut to skip layout if we don't have any columns
if (this.ColumnsInternal.Count == 0)
{
if (_hScrollBar != null && _hScrollBar.Visibility != Visibility.Collapsed)
{
_hScrollBar.Visibility = Visibility.Collapsed;
}
if (_vScrollBar != null && _vScrollBar.Visibility != Visibility.Collapsed)
{
_vScrollBar.Visibility = Visibility.Collapsed;
}
desiredSize = base.MeasureOverride(availableSize);
}
else
{
if (_rowsPresenter != null)
{
_rowsPresenter.InvalidateMeasure();
}
InvalidateColumnHeadersMeasure();
desiredSize = base.MeasureOverride(availableSize);
ComputeScrollBarsLayout();
}
return desiredSize;
}
/// <summary>
/// Comparator class so we can sort list by the display index
/// </summary>
public class DisplayIndexComparer : IComparer<DataGridColumn>
{
// Calls CaseInsensitiveComparer.Compare with the parameters reversed.
int IComparer<DataGridColumn>.Compare(DataGridColumn x, DataGridColumn y)
{
return (x.DisplayIndexWithFiller < y.DisplayIndexWithFiller) ? -1 : 1;
}
}
/// <summary>
/// Builds the visual tree for the column header when a new template is applied.
/// </summary>
protected override void OnApplyTemplate()
{
// The template has changed, so we need to refresh the visuals
_measured = false;
_hasNoIndicatorStateStoryboardCompletedHandler = false;
_keepScrollBarsShowing = false;
if (_columnHeadersPresenter != null)
{
// If we're applying a new template, we want to remove the old column headers first
_columnHeadersPresenter.Children.Clear();
}
_columnHeadersPresenter = GetTemplateChild(DATAGRID_elementColumnHeadersPresenterName) as DataGridColumnHeadersPresenter;
if (_columnHeadersPresenter != null)
{
if (this.ColumnsInternal.FillerColumn != null)
{
this.ColumnsInternal.FillerColumn.IsRepresented = false;
}
_columnHeadersPresenter.OwningGrid = this;
// Columns were added before our Template was applied, add the ColumnHeaders now
List<DataGridColumn> sortedInternal = new List<DataGridColumn>(this.ColumnsItemsInternal);
sortedInternal.Sort(new DisplayIndexComparer());
foreach (DataGridColumn column in sortedInternal)
{
InsertDisplayedColumnHeader(column);
}
}
if (_rowsPresenter != null)
{
// If we're applying a new template, we want to remove the old rows first
this.UnloadElements(false /*recycle*/);
}
_rowsPresenter = GetTemplateChild(DATAGRID_elementRowsPresenterName) as DataGridRowsPresenter;
if (_rowsPresenter != null)
{
_rowsPresenter.OwningGrid = this;
InvalidateRowHeightEstimate();
UpdateRowDetailsHeightEstimate();
UpdateRowsPresenterManipulationMode(true /*horizontalMode*/, true /*verticalMode*/);
}
_frozenColumnScrollBarSpacer = GetTemplateChild(DATAGRID_elementFrozenColumnScrollBarSpacerName) as FrameworkElement;
if (_hScrollBar != null)
{
_isHorizontalScrollBarInteracting = false;
_isPointerOverHorizontalScrollBar = false;
UnhookHorizontalScrollBarEvents();
}
_hScrollBar = GetTemplateChild(DATAGRID_elementHorizontalScrollBarName) as ScrollBar;
if (_hScrollBar != null)
{
_hScrollBar.IsTabStop = false;
_hScrollBar.Maximum = 0.0;
_hScrollBar.Orientation = Orientation.Horizontal;
_hScrollBar.Visibility = Visibility.Collapsed;
HookHorizontalScrollBarEvents();
}
if (_vScrollBar != null)
{
_isVerticalScrollBarInteracting = false;
_isPointerOverVerticalScrollBar = false;
UnhookVerticalScrollBarEvents();
}
_vScrollBar = GetTemplateChild(DATAGRID_elementVerticalScrollBarName) as ScrollBar;
if (_vScrollBar != null)
{
_vScrollBar.IsTabStop = false;
_vScrollBar.Maximum = 0.0;
_vScrollBar.Orientation = Orientation.Vertical;
_vScrollBar.Visibility = Visibility.Collapsed;
HookVerticalScrollBarEvents();
}
_topLeftCornerHeader = GetTemplateChild(DATAGRID_elementTopLeftCornerHeaderName) as ContentControl;
EnsureTopLeftCornerHeader(); // EnsureTopLeftCornerHeader checks for a null _topLeftCornerHeader;
_topRightCornerHeader = GetTemplateChild(DATAGRID_elementTopRightCornerHeaderName) as ContentControl;
_bottomRightCorner = GetTemplateChild(DATAGRID_elementBottomRightCornerHeaderName) as UIElement;
#if FEATURE_VALIDATION_SUMMARY
if (_validationSummary != null)
{
_validationSummary.FocusingInvalidControl -= new EventHandler<FocusingInvalidControlEventArgs>(ValidationSummary_FocusingInvalidControl);
_validationSummary.SelectionChanged -= new EventHandler<SelectionChangedEventArgs>(ValidationSummary_SelectionChanged);
}
_validationSummary = GetTemplateChild(DATAGRID_elementValidationSummary) as ValidationSummary;
if (_validationSummary != null)
{
// The ValidationSummary defaults to using its parent if Target is null, so the only
// way to prevent it from automatically picking up errors is to set it to some useless element.
if (_validationSummary.Target == null)
{
_validationSummary.Target = new Rectangle();
}
_validationSummary.FocusingInvalidControl += new EventHandler<FocusingInvalidControlEventArgs>(ValidationSummary_FocusingInvalidControl);
_validationSummary.SelectionChanged += new EventHandler<SelectionChangedEventArgs>(ValidationSummary_SelectionChanged);
if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
{
DiagnosticsDebug.Assert(_validationSummary.Errors != null);
// Do not add the default design time errors when in design mode.
_validationSummary.Errors.Clear();
}
}
#endif
FrameworkElement root = GetTemplateChild(DATAGRID_elementRootName) as FrameworkElement;
if (root != null)
{
IList<VisualStateGroup> rootVisualStateGroups = VisualStateManager.GetVisualStateGroups(root);
if (rootVisualStateGroups != null)
{
int groupCount = rootVisualStateGroups.Count;
for (int groupIndex = 0; groupIndex < groupCount; groupIndex++)
{
VisualStateGroup group = rootVisualStateGroups[groupIndex];
if (group != null)
{
IList<VisualState> visualStates = group.States;
if (visualStates != null)
{
int stateCount = visualStates.Count;
for (int stateIndex = 0; stateIndex < stateCount; stateIndex++)
{
VisualState state = visualStates[stateIndex];
if (state != null)
{
string stateName = state.Name;
Storyboard stateStoryboard = state.Storyboard;
if (stateStoryboard != null)
{
if (stateName == VisualStates.StateNoIndicator)
{
stateStoryboard.Completed += NoIndicatorStateStoryboard_Completed;
_hasNoIndicatorStateStoryboardCompletedHandler = true;
}
else if (stateName == VisualStates.StateTouchIndicator || stateName == VisualStates.StateMouseIndicator || stateName == VisualStates.StateMouseIndicatorFull)
{
stateStoryboard.Completed += IndicatorStateStoryboard_Completed;
}
}
}
}
}
}
}
}
}
HideScrollBars(false /*useTransitions*/);
UpdateDisabledVisual();
}
/// <summary>
/// Raises the AutoGeneratingColumn event.
/// </summary>
protected virtual void OnAutoGeneratingColumn(DataGridAutoGeneratingColumnEventArgs e)
{
EventHandler<DataGridAutoGeneratingColumnEventArgs> handler = this.AutoGeneratingColumn;
if (handler != null)
{
handler(this, e);
}
}
/// <summary>
/// Raises the BeginningEdit event.
/// </summary>
protected virtual void OnBeginningEdit(DataGridBeginningEditEventArgs e)
{
EventHandler<DataGridBeginningEditEventArgs> handler = this.BeginningEdit;
if (handler != null)
{
handler(this, e);
}
}
/// <summary>
/// Raises the CellEditEnded event.
/// </summary>
protected virtual void OnCellEditEnded(DataGridCellEditEndedEventArgs e)
{
EventHandler<DataGridCellEditEndedEventArgs> handler = this.CellEditEnded;
if (handler != null)
{
handler(this, e);
}
// Raise the automation invoke event for the cell that just ended edit
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null && AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
{
peer.RaiseAutomationInvokeEvents(DataGridEditingUnit.Cell, e.Column, e.Row);
}
}
/// <summary>
/// Raises the CellEditEnding event.
/// </summary>
protected virtual void OnCellEditEnding(DataGridCellEditEndingEventArgs e)
{
EventHandler<DataGridCellEditEndingEventArgs> handler = this.CellEditEnding;
if (handler != null)
{
handler(this, e);
}
}
/// <summary>
/// This method raises the CopyingRowClipboardContent event.
/// </summary>
/// <param name="e">Contains the necessary information for generating the row clipboard content.</param>
protected virtual void OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs e)
{
EventHandler<DataGridRowClipboardEventArgs> handler = this.CopyingRowClipboardContent;
if (handler != null)
{
handler(this, e);
}
}
/// <summary>
/// Creates AutomationPeer (<see cref="UIElement.OnCreateAutomationPeer"/>)
/// </summary>
/// <returns>An automation peer for this <see cref="DataGrid"/>.</returns>
protected override AutomationPeer OnCreateAutomationPeer()
{
return new DataGridAutomationPeer(this);
}
/// <summary>
/// Raises the CurrentCellChanged event.
/// </summary>
protected virtual void OnCurrentCellChanged(EventArgs e)
{
EventHandler<EventArgs> handler = this.CurrentCellChanged;
if (handler != null)
{
handler(this, e);
}
if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected))
{
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationCellSelectedEvent(this.CurrentSlot, this.CurrentColumnIndex);
}
}
}
/// <summary>
/// Raises the LoadingRow event for row preparation.
/// </summary>
protected virtual void OnLoadingRow(DataGridRowEventArgs e)
{
EventHandler<DataGridRowEventArgs> handler = this.LoadingRow;
if (handler != null)
{
DiagnosticsDebug.Assert(!_loadedRows.Contains(e.Row), "Expected e.Rows not contained in _loadedRows.");
_loadedRows.Add(e.Row);
this.LoadingOrUnloadingRow = true;
try
{
handler(this, e);
}
finally
{
this.LoadingOrUnloadingRow = false;
DiagnosticsDebug.Assert(_loadedRows.Contains(e.Row), "Expected e.Rows contained in _loadedRows.");
_loadedRows.Remove(e.Row);
}
}
}
/// <summary>
/// Raises the LoadingRowGroup event
/// </summary>
/// <param name="e">EventArgs</param>
protected virtual void OnLoadingRowGroup(DataGridRowGroupHeaderEventArgs e)
{
EventHandler<DataGridRowGroupHeaderEventArgs> handler = this.LoadingRowGroup;
if (handler != null)
{
this.LoadingOrUnloadingRow = true;
try
{
handler(this, e);
}
finally
{
this.LoadingOrUnloadingRow = false;
}
}
}
/// <summary>
/// Raises the LoadingRowDetails for row details preparation
/// </summary>
protected virtual void OnLoadingRowDetails(DataGridRowDetailsEventArgs e)
{
EventHandler<DataGridRowDetailsEventArgs> handler = this.LoadingRowDetails;
if (handler != null)
{
this.LoadingOrUnloadingRow = true;
try
{
handler(this, e);
}
finally
{
this.LoadingOrUnloadingRow = false;
}
}
}
/// <summary>
/// Scrolls the DataGrid according to the direction of the delta.
/// </summary>
/// <param name="e">PointerRoutedEventArgs</param>
protected override void OnPointerWheelChanged(PointerRoutedEventArgs e)
{
base.OnPointerWheelChanged(e);
if (!e.Handled)
{
PointerPoint pointerPoint = e.GetCurrentPoint(this);
// A horizontal scroll happens if the mouse has a horizontal wheel OR if the horizontal scrollbar is not disabled AND the vertical scrollbar IS disabled
bool isForHorizontalScroll = pointerPoint.Properties.IsHorizontalMouseWheel ||
(this.HorizontalScrollBarVisibility != ScrollBarVisibility.Disabled && this.VerticalScrollBarVisibility == ScrollBarVisibility.Disabled);
if ((isForHorizontalScroll && this.HorizontalScrollBarVisibility == ScrollBarVisibility.Disabled) ||
(!isForHorizontalScroll && this.VerticalScrollBarVisibility == ScrollBarVisibility.Disabled))
{
return;
}
double offsetDelta = -pointerPoint.Properties.MouseWheelDelta / DATAGRID_mouseWheelDeltaDivider;
if (isForHorizontalScroll && pointerPoint.Properties.IsHorizontalMouseWheel)
{
offsetDelta *= -1.0;
}
e.Handled = ProcessScrollOffsetDelta(offsetDelta, isForHorizontalScroll);
}
}
/// <summary>
/// Raises the PreparingCellForEdit event.
/// </summary>
protected virtual void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
{
EventHandler<DataGridPreparingCellForEditEventArgs> handler = this.PreparingCellForEdit;
if (handler != null)
{
handler(this, e);
}
// Raise the automation invoke event for the cell that just began edit because now
// its editable content has been loaded
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null && AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
{
peer.RaiseAutomationInvokeEvents(DataGridEditingUnit.Cell, e.Column, e.Row);
}
}
/// <summary>
/// Raises the RowEditEnded event.
/// </summary>
protected virtual void OnRowEditEnded(DataGridRowEditEndedEventArgs e)
{
EventHandler<DataGridRowEditEndedEventArgs> handler = this.RowEditEnded;
if (handler != null)
{
handler(this, e);
}
// Raise the automation invoke event for the row that just ended edit because the edits
// to its associated item have either been committed or reverted
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null && AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
{
peer.RaiseAutomationInvokeEvents(DataGridEditingUnit.Row, null, e.Row);
}
}
/// <summary>
/// Raises the RowEditEnding event.
/// </summary>
protected virtual void OnRowEditEnding(DataGridRowEditEndingEventArgs e)
{
EventHandler<DataGridRowEditEndingEventArgs> handler = this.RowEditEnding;
if (handler != null)
{
handler(this, e);
}
}
/// <summary>
/// Raises the SelectionChanged event and clears the _selectionChanged.
/// This event won't get raised again until after _selectionChanged is set back to true.
/// </summary>
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
{
SelectionChangedEventHandler handler = this.SelectionChanged;
if (handler != null)
{
handler(this, e);
}
if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected) ||
AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementAddedToSelection) ||
AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection))
{
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationSelectionEvents(e);
}
}
}
/// <summary>
/// Raises the UnloadingRow event for row recycling.
/// </summary>
protected virtual void OnUnloadingRow(DataGridRowEventArgs e)
{
EventHandler<DataGridRowEventArgs> handler = this.UnloadingRow;
if (handler != null)
{
this.LoadingOrUnloadingRow = true;
try
{
handler(this, e);
}
finally
{
this.LoadingOrUnloadingRow = false;
}
}
}
/// <summary>
/// Raises the UnloadingRowDetails event
/// </summary>
protected virtual void OnUnloadingRowDetails(DataGridRowDetailsEventArgs e)
{
EventHandler<DataGridRowDetailsEventArgs> handler = this.UnloadingRowDetails;
if (handler != null)
{
this.LoadingOrUnloadingRow = true;
try
{
handler(this, e);
}
finally
{
this.LoadingOrUnloadingRow = false;
}
}
}
/// <summary>
/// Raises the UnloadingRowGroup event
/// </summary>
/// <param name="e">EventArgs</param>
protected virtual void OnUnloadingRowGroup(DataGridRowGroupHeaderEventArgs e)
{
EventHandler<DataGridRowGroupHeaderEventArgs> handler = this.UnloadingRowGroup;
if (handler != null)
{
this.LoadingOrUnloadingRow = true;
try
{
handler(this, e);
}
finally
{
this.LoadingOrUnloadingRow = false;
}
}
}
internal static DataGridCell GetOwningCell(FrameworkElement element)
{
DiagnosticsDebug.Assert(element != null, "Expected non-null element.");
DataGridCell cell = element as DataGridCell;
while (element != null && cell == null)
{
element = element.Parent as FrameworkElement;
cell = element as DataGridCell;
}
return cell;
}
/// <summary>
/// Cancels editing mode for the specified DataGridEditingUnit and restores its original value.
/// </summary>
/// <param name="editingUnit">Specifies whether to cancel edit for a Cell or Row.</param>
/// <param name="raiseEvents">Specifies whether or not to raise editing events</param>
/// <returns>True if operation was successful. False otherwise.</returns>
internal bool CancelEdit(DataGridEditingUnit editingUnit, bool raiseEvents)
{
if (!EndCellEdit(DataGridEditAction.Cancel, true, this.ContainsFocus /*keepFocus*/, raiseEvents))
{
return false;
}
if (editingUnit == DataGridEditingUnit.Row)
{
return EndRowEdit(DataGridEditAction.Cancel, true, raiseEvents);
}
return true;
}
/// <summary>
/// call when: selection changes or SelectedItems object changes
/// </summary>
internal void CoerceSelectedItem()
{
object selectedItem = null;
if (this.SelectionMode == DataGridSelectionMode.Extended &&
this.CurrentSlot != -1 &&
_selectedItems.ContainsSlot(this.CurrentSlot))
{
selectedItem = this.CurrentItem;
}
else if (_selectedItems.Count > 0)
{
selectedItem = _selectedItems[0];
}
if (this.SelectedItem != selectedItem)
{
this.SetValueNoCallback(DataGrid.SelectedItemProperty, selectedItem);
}
// Update the SelectedIndex
int newIndex = -1;
if (selectedItem != null)
{
newIndex = this.DataConnection.IndexOf(selectedItem);
}
if (this.SelectedIndex != newIndex)
{
this.SetValueNoCallback(DataGrid.SelectedIndexProperty, newIndex);
}
}
internal IEnumerable<object> GetSelectionInclusive(int startRowIndex, int endRowIndex)
{
int endSlot = SlotFromRowIndex(endRowIndex);
foreach (int slot in _selectedItems.GetSlots(SlotFromRowIndex(startRowIndex)))
{
if (slot > endSlot)
{
break;
}
yield return this.DataConnection.GetDataItem(RowIndexFromSlot(slot));
}
}
internal void InitializeElements(bool recycleRows)
{
try
{
_noCurrentCellChangeCount++;
// The underlying collection has changed and our editing row (if there is one)
// is no longer relevant, so we should force a cancel edit.
CancelEdit(DataGridEditingUnit.Row, false /*raiseEvents*/);
// We want to persist selection throughout a reset, so store away the selected items
List<object> selectedItemsCache = new List<object>(_selectedItems.SelectedItemsCache);
if (recycleRows)
{
RefreshRows(recycleRows /*recycleRows*/, true /*clearRows*/);
}
else
{
RefreshRowsAndColumns(true /*clearRows*/);
}
// Re-select the old items
_selectedItems.SelectedItemsCache = selectedItemsCache;
CoerceSelectedItem();
if (this.RowDetailsVisibilityMode != DataGridRowDetailsVisibilityMode.Collapsed)
{
UpdateRowDetailsVisibilityMode(this.RowDetailsVisibilityMode);
}
// The currently displayed rows may have incorrect visual states because of the selection change
ApplyDisplayedRowsState(this.DisplayData.FirstScrollingSlot, this.DisplayData.LastScrollingSlot);
}
finally
{
this.NoCurrentCellChangeCount--;
}
}
// Returns the item or the CollectionViewGroup that is used as the DataContext for a given slot.
// If the DataContext is an item, rowIndex is set to the index of the item within the collection.
internal object ItemFromSlot(int slot, ref int rowIndex)
{
if (this.RowGroupHeadersTable.Contains(slot))
{
DataGridRowGroupInfo groupInfo = this.RowGroupHeadersTable.GetValueAt(slot);
if (groupInfo != null)
{
return groupInfo.CollectionViewGroup;
}
}
else
{
rowIndex = RowIndexFromSlot(slot);
return this.DataConnection.GetDataItem(rowIndex);
}
return null;
}
internal void LoadMoreDataFromIncrementalItemsSource()
{
LoadMoreDataFromIncrementalItemsSource(totalVisibleHeight: EdgedRowsHeightCalculated);
}
internal void OnRowDetailsChanged()
{
if (!_scrollingByHeight)
{
// Update layout when RowDetails are expanded or collapsed, just updating the vertical scroll bar is not enough
// since rows could be added or removed.
InvalidateMeasure();
}
}
internal void OnUserSorting()
{
_isUserSorting = true;
}
internal void OnUserSorted()
{
_isUserSorting = false;
}
internal bool ProcessDownKey()
{
bool shift, ctrl;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return ProcessDownKeyInternal(shift, ctrl);
}
internal bool ProcessEndKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessEndKey(shift, ctrl);
}
internal bool ProcessEnterKey()
{
bool ctrl, shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessEnterKey(shift, ctrl);
}
internal bool ProcessHomeKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessHomeKey(shift, ctrl);
}
internal void ProcessHorizontalScroll(ScrollEventType scrollEventType)
{
if (scrollEventType == ScrollEventType.EndScroll)
{
this.IsHorizontalScrollBarInteracting = false;
}
else if (scrollEventType == ScrollEventType.ThumbTrack)
{
this.IsHorizontalScrollBarInteracting = true;
}
if (_horizontalScrollChangesIgnored > 0)
{
return;
}
// If the user scrolls with the buttons, we need to update the new value of the scroll bar since we delay
// this calculation. If they scroll in another other way, the scroll bar's correct value has already been set
double scrollBarValueDifference = 0;
if (scrollEventType == ScrollEventType.SmallIncrement)
{
scrollBarValueDifference = GetHorizontalSmallScrollIncrease();
}
else if (scrollEventType == ScrollEventType.SmallDecrement)
{
scrollBarValueDifference = -GetHorizontalSmallScrollDecrease();
}
_horizontalScrollChangesIgnored++;
try
{
if (scrollBarValueDifference != 0)
{
DiagnosticsDebug.Assert(_horizontalOffset + scrollBarValueDifference >= 0, "Expected positive _horizontalOffset + scrollBarValueDifference.");
SetHorizontalOffset(_horizontalOffset + scrollBarValueDifference);
}
UpdateHorizontalOffset(_hScrollBar.Value);
}
finally
{
_horizontalScrollChangesIgnored--;
}
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationScrollEvents();
}
}
internal bool ProcessLeftKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessLeftKey(shift, ctrl);
}
internal bool ProcessNextKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessNextKey(shift, ctrl);
}
internal bool ProcessPriorKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessPriorKey(shift, ctrl);
}
internal bool ProcessRightKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessRightKey(shift, ctrl);
}
internal bool ProcessScrollOffsetDelta(double offsetDelta, bool isForHorizontalScroll)
{
if (this.IsEnabled && this.DisplayData.NumDisplayedScrollingElements > 0)
{
if (isForHorizontalScroll)
{
double newHorizontalOffset = this.HorizontalOffset + offsetDelta;
if (newHorizontalOffset < 0)
{
newHorizontalOffset = 0;
}
double maxHorizontalOffset = Math.Max(0, this.ColumnsInternal.VisibleEdgedColumnsWidth - this.CellsWidth);
if (newHorizontalOffset > maxHorizontalOffset)
{
newHorizontalOffset = maxHorizontalOffset;
}
if (newHorizontalOffset != this.HorizontalOffset)
{
UpdateHorizontalOffset(newHorizontalOffset);
return true;
}
}
else
{
if (offsetDelta < 0)
{
offsetDelta = Math.Max(-_verticalOffset, offsetDelta);
}
else if (offsetDelta > 0)
{
if (_vScrollBar != null && this.VerticalScrollBarVisibility == ScrollBarVisibility.Visible)
{
offsetDelta = Math.Min(Math.Max(0, _vScrollBar.Maximum - _verticalOffset), offsetDelta);
}
else
{
double maximum = this.EdgedRowsHeightCalculated - this.CellsHeight;
offsetDelta = Math.Min(Math.Max(0, maximum - _verticalOffset), offsetDelta);
}
}
if (offsetDelta != 0)
{
this.DisplayData.PendingVerticalScrollHeight = offsetDelta;
InvalidateRowsMeasure(false /*invalidateIndividualRows*/);
return true;
}
}
}
return false;
}
/// <summary>
/// Selects items and updates currency based on parameters
/// </summary>
/// <param name="columnIndex">column index to make current</param>
/// <param name="item">data item or CollectionViewGroup to make current</param>
/// <param name="backupSlot">slot to use in case the item is no longer valid</param>
/// <param name="action">selection action to perform</param>
/// <param name="scrollIntoView">whether or not the new current item should be scrolled into view</param>
internal void ProcessSelectionAndCurrency(int columnIndex, object item, int backupSlot, DataGridSelectionAction action, bool scrollIntoView)
{
_noSelectionChangeCount++;
_noCurrentCellChangeCount++;
try
{
int slot = -1;
ICollectionViewGroup group = item as ICollectionViewGroup;
if (group != null)
{
DataGridRowGroupInfo groupInfo = this.RowGroupInfoFromCollectionViewGroup(group);
if (groupInfo != null)
{
slot = groupInfo.Slot;
}
}
else
{
slot = this.SlotFromRowIndex(this.DataConnection.IndexOf(item));
}
if (slot == -1)
{
slot = backupSlot;
}
if (slot < 0 || slot > this.SlotCount)
{
return;
}
switch (action)
{
case DataGridSelectionAction.AddCurrentToSelection:
SetRowSelection(slot, true /*isSelected*/, true /*setAnchorIndex*/);
break;
case DataGridSelectionAction.RemoveCurrentFromSelection:
SetRowSelection(slot, false /*isSelected*/, false /*setAnchorRowIndex*/);
break;
case DataGridSelectionAction.SelectFromAnchorToCurrent:
if (this.SelectionMode == DataGridSelectionMode.Extended && this.AnchorSlot != -1)
{
int anchorSlot = this.AnchorSlot;
ClearRowSelection(slot /*slotException*/, false /*resetAnchorSlot*/);
if (slot <= anchorSlot)
{
SetRowsSelection(slot, anchorSlot);
}
else
{
SetRowsSelection(anchorSlot, slot);
}
}
else
{
goto case DataGridSelectionAction.SelectCurrent;
}
break;
case DataGridSelectionAction.SelectCurrent:
ClearRowSelection(slot /*rowIndexException*/, true /*setAnchorRowIndex*/);
break;
case DataGridSelectionAction.None:
break;
}
if (this.CurrentSlot != slot || (this.CurrentColumnIndex != columnIndex && columnIndex != -1))
{
if (columnIndex == -1)
{
if (this.CurrentColumnIndex != -1)
{
columnIndex = this.CurrentColumnIndex;
}
else
{
DataGridColumn firstVisibleColumn = this.ColumnsInternal.FirstVisibleNonFillerColumn;
if (firstVisibleColumn != null)
{
columnIndex = firstVisibleColumn.Index;
}
}
}
if (columnIndex != -1)
{
if (!SetCurrentCellCore(columnIndex, slot, true /*commitEdit*/, SlotFromRowIndex(this.SelectedIndex) != slot /*endRowEdit*/)
|| (scrollIntoView && !ScrollSlotIntoView(columnIndex, slot, true /*forCurrentCellChange*/, false /*forceHorizontalScroll*/)))
{
return;
}
}
}
_successfullyUpdatedSelection = true;
}
finally
{
this.NoCurrentCellChangeCount--;
this.NoSelectionChangeCount--;
}
}
internal bool ProcessUpKey()
{
bool ctrl;
bool shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessUpKey(shift, ctrl);
}
internal void ProcessVerticalScroll(ScrollEventType scrollEventType)
{
if (scrollEventType == ScrollEventType.EndScroll)
{
this.IsVerticalScrollBarInteracting = false;
}
else if (scrollEventType == ScrollEventType.ThumbTrack)
{
this.IsVerticalScrollBarInteracting = true;
}
if (_verticalScrollChangesIgnored > 0)
{
return;
}
DiagnosticsDebug.Assert(DoubleUtil.LessThanOrClose(_vScrollBar.Value, _vScrollBar.Maximum), "Expected _vScrollBar.Value smaller than or close to _vScrollBar.Maximum.");
_verticalScrollChangesIgnored++;
try
{
DiagnosticsDebug.Assert(_vScrollBar != null, "Expected non-null _vScrollBar.");
if (scrollEventType == ScrollEventType.SmallIncrement)
{
this.DisplayData.PendingVerticalScrollHeight = GetVerticalSmallScrollIncrease();
double newVerticalOffset = _verticalOffset + this.DisplayData.PendingVerticalScrollHeight;
if (newVerticalOffset > _vScrollBar.Maximum)
{
this.DisplayData.PendingVerticalScrollHeight -= newVerticalOffset - _vScrollBar.Maximum;
}
}
else if (scrollEventType == ScrollEventType.SmallDecrement)
{
if (DoubleUtil.GreaterThan(this.NegVerticalOffset, 0))
{
this.DisplayData.PendingVerticalScrollHeight -= this.NegVerticalOffset;
}
else
{
int previousScrollingSlot = this.GetPreviousVisibleSlot(this.DisplayData.FirstScrollingSlot);
if (previousScrollingSlot >= 0)
{
ScrollSlotIntoView(previousScrollingSlot, false /*scrolledHorizontally*/);
}
return;
}
}
else
{
this.DisplayData.PendingVerticalScrollHeight = _vScrollBar.Value - _verticalOffset;
}
if (!DoubleUtil.IsZero(this.DisplayData.PendingVerticalScrollHeight))
{
// Invalidate so the scroll happens on idle
InvalidateRowsMeasure(false /*invalidateIndividualElements*/);
}
}
finally
{
_verticalScrollChangesIgnored--;
}
}
internal void RefreshRowsAndColumns(bool clearRows)
{
if (_measured)
{
try
{
_noCurrentCellChangeCount++;
if (clearRows)
{
ClearRows(false);
ClearRowGroupHeadersTable();
PopulateRowGroupHeadersTable();
RefreshSlotCounts();
}
if (this.AutoGenerateColumns)
{
// Column auto-generation refreshes the rows too
AutoGenerateColumnsPrivate();
}
foreach (DataGridColumn column in this.ColumnsItemsInternal)
{
// We don't need to refresh the state of AutoGenerated column headers because they're up-to-date
if (!column.IsAutoGenerated && column.HasHeaderCell)
{
column.HeaderCell.ApplyState(false);
}
}
RefreshRows(false /*recycleRows*/, false /*clearRows*/);
if (this.Columns.Count > 0 && this.CurrentColumnIndex == -1)
{
MakeFirstDisplayedCellCurrentCell();
}
else
{
_makeFirstDisplayedCellCurrentCellPending = false;
_desiredCurrentColumnIndex = -1;
FlushCurrentCellChanged();
}
}
finally
{
this.NoCurrentCellChangeCount--;
}
}
else
{
if (clearRows)
{
ClearRows(false /*recycle*/);
}
ClearRowGroupHeadersTable();
PopulateRowGroupHeadersTable();
RefreshSlotCounts();
}
}
internal void ResetColumnHeaderInteractionInfo()
{
DataGridColumnHeaderInteractionInfo interactionInfo = this.ColumnHeaderInteractionInfo;
if (interactionInfo != null)
{
interactionInfo.CapturedPointer = null;
interactionInfo.DragMode = DataGridColumnHeader.DragMode.None;
interactionInfo.DragPointerId = 0;
interactionInfo.DragColumn = null;
interactionInfo.DragStart = null;
interactionInfo.PressedPointerPositionHeaders = null;
interactionInfo.LastPointerPositionHeaders = null;
}
if (this.ColumnHeaders != null)
{
this.ColumnHeaders.DragColumn = null;
this.ColumnHeaders.DragIndicator = null;
this.ColumnHeaders.DropLocationIndicator = null;
}
}
internal bool ScrollSlotIntoView(int columnIndex, int slot, bool forCurrentCellChange, bool forceHorizontalScroll)
{
DiagnosticsDebug.Assert(columnIndex >= 0, "Expected positive columnIndex.");
DiagnosticsDebug.Assert(columnIndex < this.ColumnsItemsInternal.Count, "Expected columnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.DisplayData.FirstDisplayedScrollingCol >= -1, "Expected DisplayData.FirstDisplayedScrollingCol greater than or equal to -1.");
DiagnosticsDebug.Assert(this.DisplayData.FirstDisplayedScrollingCol < this.ColumnsItemsInternal.Count, "Expected smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.DisplayData.LastTotallyDisplayedScrollingCol >= -1, "Expected DisplayData.LastTotallyDisplayedScrollingCol greater than or equal to -1.");
DiagnosticsDebug.Assert(this.DisplayData.LastTotallyDisplayedScrollingCol < this.ColumnsItemsInternal.Count, "Expected DisplayData.LastTotallyDisplayedScrollingCol smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(!IsSlotOutOfBounds(slot), "Expected IsSlotOutOfBounds(slot) is false.");
DiagnosticsDebug.Assert(this.DisplayData.FirstScrollingSlot >= -1, "Expected DisplayData.FirstScrollingSlot greater than or equal to -1.");
DiagnosticsDebug.Assert(this.DisplayData.FirstScrollingSlot < this.SlotCount, "Expected DisplayData.FirstScrollingSlot smaller than SlotCount.");
DiagnosticsDebug.Assert(this.ColumnsItemsInternal[columnIndex].IsVisible, "Expected ColumnsItemsInternal[columnIndex].IsVisible is true.");
if (this.CurrentColumnIndex >= 0 &&
(this.CurrentColumnIndex != columnIndex || this.CurrentSlot != slot))
{
if (!CommitEditForOperation(columnIndex, slot, forCurrentCellChange) || IsInnerCellOutOfBounds(columnIndex, slot))
{
return false;
}
}
double oldHorizontalOffset = this.HorizontalOffset;
bool rowGroupHeadersTableContainsSlot = this.RowGroupHeadersTable.Contains(slot);
// scroll horizontally unless we're on a RowGroupHeader and we're not forcing horizontal scrolling
if ((forceHorizontalScroll || (slot != -1 && !rowGroupHeadersTableContainsSlot)) &&
!ScrollColumnIntoView(columnIndex))
{
return false;
}
// scroll vertically
if (!ScrollSlotIntoView(slot, oldHorizontalOffset != this.HorizontalOffset /*scrolledHorizontally*/))
{
return false;
}
// Scrolling horizontally or vertically could cause less rows to be displayed
this.DisplayData.FullyRecycleElements();
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationScrollEvents();
}
return true;
}
// Convenient overload that commits the current edit.
internal bool SetCurrentCellCore(int columnIndex, int slot)
{
return SetCurrentCellCore(columnIndex, slot, true /*commitEdit*/, true /*endRowEdit*/);
}
internal void UpdateHorizontalOffset(double newValue)
{
if (this.HorizontalOffset != newValue)
{
this.HorizontalOffset = newValue;
InvalidateColumnHeadersMeasure();
InvalidateRowsMeasure(true);
}
}
internal bool UpdateSelectionAndCurrency(int columnIndex, int slot, DataGridSelectionAction action, bool scrollIntoView)
{
_successfullyUpdatedSelection = false;
_noSelectionChangeCount++;
_noCurrentCellChangeCount++;
try
{
if (this.ColumnsInternal.RowGroupSpacerColumn.IsRepresented &&
columnIndex == this.ColumnsInternal.RowGroupSpacerColumn.Index)
{
columnIndex = -1;
}
if (IsSlotOutOfSelectionBounds(slot) || (columnIndex != -1 && IsColumnOutOfBounds(columnIndex)))
{
return false;
}
int newCurrentPosition = -1;
object item = ItemFromSlot(slot, ref newCurrentPosition);
if (newCurrentPosition == this.DataConnection.NewItemPlaceholderIndex)
{
newCurrentPosition = -1;
}
if (this.EditingRow != null && slot != this.EditingRow.Slot && !CommitEdit(DataGridEditingUnit.Row, true))
{
return false;
}
if (this.DataConnection.CollectionView != null &&
this.DataConnection.CollectionView.CurrentPosition != newCurrentPosition)
{
this.DataConnection.MoveCurrentTo(item, slot, columnIndex, action, scrollIntoView);
}
else
{
this.ProcessSelectionAndCurrency(columnIndex, item, slot, action, scrollIntoView);
}
}
finally
{
this.NoCurrentCellChangeCount--;
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
internal void UpdateStateOnCurrentChanged(object currentItem, int currentPosition)
{
if ((currentItem == this.CurrentItem) &&
(_isUserSorting || (currentItem == this.SelectedItem && currentPosition == this.SelectedIndex)))
{
// The DataGrid's CurrentItem is already up-to-date, so we don't need to do anything.
// In the sorting case, we receive a CurrentChanged notification if the current item
// changes position in the CollectionView. However, our CurrentItem is already
// in the correct position in this case, and we do not want to update the selection so
// we no-op here.
return;
}
int columnIndex = this.CurrentColumnIndex;
if (columnIndex == -1)
{
if (this.IsColumnOutOfBounds(_desiredCurrentColumnIndex))
{
columnIndex = this.FirstDisplayedNonFillerColumnIndex;
}
else if (this.ColumnsInternal.RowGroupSpacerColumn.IsRepresented && _desiredCurrentColumnIndex == this.ColumnsInternal.RowGroupSpacerColumn.Index)
{
columnIndex = this.FirstDisplayedNonFillerColumnIndex;
}
else
{
columnIndex = _desiredCurrentColumnIndex;
}
}
// The CollectionView will potentially raise multiple CurrentChanged events during a single
// add operation, so we should avoid resetting our desired column index until it's committed.
if (!this.DataConnection.IsAddingNew)
{
_desiredCurrentColumnIndex = -1;
}
try
{
_noSelectionChangeCount++;
_noCurrentCellChangeCount++;
if (!this.CommitEdit())
{
this.CancelEdit(DataGridEditingUnit.Row, false);
}
this.ClearRowSelection(true);
if (currentItem == null)
{
SetCurrentCellCore(-1, -1);
}
else
{
int slot = SlotFromRowIndex(currentPosition);
this.ProcessSelectionAndCurrency(columnIndex, currentItem, slot, DataGridSelectionAction.SelectCurrent, false);
}
}
finally
{
this.NoCurrentCellChangeCount--;
this.NoSelectionChangeCount--;
}
}
internal bool UpdateStateOnTapped(TappedRoutedEventArgs args, int columnIndex, int slot, bool allowEdit)
{
bool ctrl, shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.UpdateStateOnTapped(args, columnIndex, slot, allowEdit, shift, ctrl);
}
internal void UpdateVerticalScrollBar()
{
if (_vScrollBar != null && _vScrollBar.Visibility == Visibility.Visible)
{
double cellsHeight = this.CellsHeight;
double edgedRowsHeightCalculated = this.EdgedRowsHeightCalculated;
UpdateVerticalScrollBar(
edgedRowsHeightCalculated > cellsHeight /*needVertScrollBar*/,
this.VerticalScrollBarVisibility == ScrollBarVisibility.Visible /*forceVertScrollBar*/,
edgedRowsHeightCalculated,
cellsHeight);
}
}
/// <summary>
/// If the editing element has focus, this method will set focus to the DataGrid itself
/// in order to force the element to lose focus. It will then wait for the editing element's
/// LostFocus event, at which point it will perform the specified action.
/// NOTE: It is important to understand that the specified action will be performed when the editing
/// element loses focus only if this method returns true. If it returns false, then the action
/// will not be performed later on, and should instead be performed by the caller, if necessary.
/// </summary>
/// <param name="action">Action to perform after the editing element loses focus</param>
/// <returns>True if the editing element had focus and the action was cached away; false otherwise</returns>
internal bool WaitForLostFocus(Action action)
{
if (this.EditingRow != null && this.EditingColumnIndex != -1 && !_executingLostFocusActions)
{
DataGridColumn editingColumn = this.ColumnsItemsInternal[this.EditingColumnIndex];
FrameworkElement editingElement = editingColumn.GetCellContent(this.EditingRow);
if (editingElement != null && editingElement.ContainsChild(_focusedObject))
{
DiagnosticsDebug.Assert(_lostFocusActions != null, "Expected non-null _lostFocusActions.");
_lostFocusActions.Enqueue(action);
editingElement.LostFocus += new RoutedEventHandler(EditingElement_LostFocus);
this.IsTabStop = true;
this.Focus(FocusState.Programmatic);
return true;
}
}
return false;
}
// Applies the given Style to the Row if it's supposed to use DataGrid.RowStyle
private static void EnsureElementStyle(FrameworkElement element, Style oldDataGridStyle, Style newDataGridStyle)
{
DiagnosticsDebug.Assert(element != null, "Expected non-null element.");
// Apply the DataGrid style if the row was using the old DataGridRowStyle before
if (element != null && (element.Style == null || element.Style == oldDataGridStyle))
{
element.SetStyleWithType(newDataGridStyle);
}
}
private bool AddNewItem(RoutedEventArgs editingEventArgs)
{
#if FEATURE_IEDITABLECOLLECTIONVIEW
if (this.DataConnection.EditableCollectionView != null && this.DataConnection.EditableCollectionView.CanAddNew)
{
_desiredCurrentColumnIndex = this.CurrentColumnIndex;
object addItem = this.DataConnection.EditableCollectionView.AddNew();
if (this.CurrentItem != this.DataConnection.EditableCollectionView.CurrentAddItem)
{
int newItemSlot = SlotFromRowIndex(this.DataConnection.IndexOf(addItem));
SetAndSelectCurrentCell(this.CurrentColumnIndex, newItemSlot, true);
if (!_successfullyUpdatedSelection)
{
return false;
}
}
return BeginCellEdit(editingEventArgs);
}
#endif
return false;
}
private void AddNewCellPrivate(DataGridRow row, DataGridColumn column)
{
DataGridCell newCell = new DataGridCell();
PopulateCellContent(false /*isCellEdited*/, column, row, newCell);
if (row.OwningGrid != null)
{
newCell.OwningColumn = column;
newCell.Visibility = column.Visibility;
}
if (column is DataGridFillerColumn)
{
Windows.UI.Xaml.Automation.AutomationProperties.SetAccessibilityView(
newCell,
AccessibilityView.Raw);
}
newCell.EnsureStyle(null);
row.Cells.Insert(column.Index, newCell);
}
// TODO: Call this method once the UISettings has a public property for the "Automatically hide scroll bars in Windows" setting
// private void AutoHideScrollBarsChanged()
// {
// if (UISettingsHelper.AreSettingsAutoHidingScrollBars)
// {
// SwitchScrollBarsVisualStates(_proposedScrollBarsState, _proposedScrollBarsSeparatorState, true /*useTransitions*/);
// }
// else
// {
// if (this.AreBothScrollBarsVisible)
// {
// if (UISettingsHelper.AreSettingsEnablingAnimations)
// {
// SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicatorFull, this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorExpanded : ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
// }
// else
// {
// SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicatorFull, this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorExpandedWithoutAnimation : ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
// }
// }
// else
// {
// if (UISettingsHelper.AreSettingsEnablingAnimations)
// {
// SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicator, ScrollBarsSeparatorVisualState.SeparatorCollapsed, true/*useTransitions*/);
// }
// else
// {
// SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicator, this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorCollapsedWithoutAnimation : ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
// }
// }
// }
// }
private bool BeginCellEdit(RoutedEventArgs editingEventArgs)
{
if (this.CurrentColumnIndex == -1 || !GetRowSelection(this.CurrentSlot))
{
return false;
}
DiagnosticsDebug.Assert(this.CurrentColumnIndex >= 0, "Expected positive CurrentColumnIndex.");
DiagnosticsDebug.Assert(this.CurrentColumnIndex < this.ColumnsItemsInternal.Count, "Expected CurrentColumnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.CurrentSlot >= -1, "Expected CurrentSlot greater than or equal to -1.");
DiagnosticsDebug.Assert(this.CurrentSlot < this.SlotCount, "Expected CurrentSlot smaller than SlotCount.");
DiagnosticsDebug.Assert(this.EditingRow == null || this.EditingRow.Slot == this.CurrentSlot, "Expected null EditingRow or EditingRow.Slot equal to CurrentSlot.");
DiagnosticsDebug.Assert(!GetColumnEffectiveReadOnlyState(this.CurrentColumn), "Expected GetColumnEffectiveReadOnlyState(CurrentColumn) is false.");
DiagnosticsDebug.Assert(this.CurrentColumn.IsVisible, "Expected CurrentColumn.IsVisible is true.");
if (_editingColumnIndex != -1)
{
// Current cell is already in edit mode
DiagnosticsDebug.Assert(_editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals CurrentColumnIndex.");
return true;
}
// When we begin edit on the NewItemPlaceHolder row, we should try to add a new item.
if (this.CurrentSlot == SlotFromRowIndex(this.DataConnection.NewItemPlaceholderIndex))
{
return this.AddNewItem(editingEventArgs);
}
// Get or generate the editing row if it doesn't exist
DataGridRow dataGridRow = this.EditingRow;
if (dataGridRow == null)
{
DiagnosticsDebug.Assert(!this.RowGroupHeadersTable.Contains(this.CurrentSlot), "Expected CurrentSlot not contained in RowGroupHeadersTable.");
if (this.IsSlotVisible(this.CurrentSlot))
{
dataGridRow = this.DisplayData.GetDisplayedElement(this.CurrentSlot) as DataGridRow;
DiagnosticsDebug.Assert(dataGridRow != null, "Expected non-null dataGridRow.");
}
else
{
dataGridRow = GenerateRow(RowIndexFromSlot(this.CurrentSlot), this.CurrentSlot);
dataGridRow.Clip = new RectangleGeometry();
}
if (this.DataConnection.IsAddingNew)
{
// We just began editing the new item row, so set a flag that prevents us from running
// full entity validation until the user explicitly attempts to end editing the row.
_initializingNewItem = true;
}
}
DiagnosticsDebug.Assert(dataGridRow != null, "Expected non-null dataGridRow.");
// Cache these to see if they change later
int currentRowIndex = this.CurrentSlot;
int currentColumnIndex = this.CurrentColumnIndex;
// Raise the BeginningEdit event
DataGridCell dataGridCell = dataGridRow.Cells[this.CurrentColumnIndex];
DataGridBeginningEditEventArgs e = new DataGridBeginningEditEventArgs(this.CurrentColumn, dataGridRow, editingEventArgs);
OnBeginningEdit(e);
if (e.Cancel ||
currentRowIndex != this.CurrentSlot ||
currentColumnIndex != this.CurrentColumnIndex ||
!GetRowSelection(this.CurrentSlot) ||
(this.EditingRow == null && !BeginRowEdit(dataGridRow)))
{
// If either BeginningEdit was canceled, currency/selection was changed in the event handler,
// or we failed opening the row for edit, then we can no longer continue BeginCellEdit
return false;
}
if (this.EditingRow == null || this.EditingRow.Slot != this.CurrentSlot)
{
// This check was added to safeguard against a ListCollectionView bug where the collection changed currency
// during a CommitNew operation but failed to raise a CurrentChanged event.
return false;
}
// Finally, we can prepare the cell for editing
_editingColumnIndex = this.CurrentColumnIndex;
_editingEventArgs = editingEventArgs;
this.EditingRow.Cells[this.CurrentColumnIndex].ApplyCellState(true /*animate*/);
PopulateCellContent(true /*isCellEdited*/, this.CurrentColumn, dataGridRow, dataGridCell);
return true;
}
private bool BeginRowEdit(DataGridRow dataGridRow)
{
DiagnosticsDebug.Assert(this.EditingRow == null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(dataGridRow != null, "Expected non-null dataGridRow.");
DiagnosticsDebug.Assert(this.CurrentSlot >= -1, "Expected CurrentSlot greater than or equal to -1.");
DiagnosticsDebug.Assert(this.CurrentSlot < this.SlotCount, "Expected CurrentSlot smaller than SlotCount.");
if (this.DataConnection.BeginEdit(dataGridRow.DataContext))
{
this.EditingRow = dataGridRow;
this.GenerateEditingElements();
this.ValidateEditingRow(false /*scrollIntoView*/, true /*wireEvents*/);
// Raise the automation invoke event for the row that just began edit
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null && AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
{
peer.RaiseAutomationInvokeEvents(DataGridEditingUnit.Row, null, dataGridRow);
}
return true;
}
return false;
}
private bool CancelRowEdit(bool exitEditingMode)
{
if (this.EditingRow == null)
{
return true;
}
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Index >= -1, "Expected EditingRow greater or equal to -1.");
DiagnosticsDebug.Assert(this.EditingRow.Slot < this.SlotCount, "Expected EditingRow smaller than SlotCount.");
DiagnosticsDebug.Assert(this.CurrentColumn != null, "Expected non-null CurrentColumn.");
object dataItem = this.EditingRow.DataContext;
if (!this.DataConnection.CancelEdit(dataItem))
{
return false;
}
foreach (DataGridColumn column in this.Columns)
{
if (!exitEditingMode && column.Index == _editingColumnIndex && column is DataGridBoundColumn)
{
continue;
}
PopulateCellContent(!exitEditingMode && column.Index == _editingColumnIndex /*isCellEdited*/, column, this.EditingRow, this.EditingRow.Cells[column.Index]);
}
return true;
}
private bool CommitEditForOperation(int columnIndex, int slot, bool forCurrentCellChange)
{
if (forCurrentCellChange)
{
if (!EndCellEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, true /*keepFocus*/, true /*raiseEvents*/))
{
return false;
}
if (this.CurrentSlot != slot &&
!EndRowEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, true /*raiseEvents*/))
{
return false;
}
}
if (IsColumnOutOfBounds(columnIndex))
{
return false;
}
if (slot >= this.SlotCount)
{
// Current cell was reset because the commit deleted row(s).
// Since the user wants to change the current cell, we don't
// want to end up with no current cell. We pick the last row
// in the grid which may be the 'new row'.
int lastSlot = this.LastVisibleSlot;
if (forCurrentCellChange &&
this.CurrentColumnIndex == -1 &&
lastSlot != -1)
{
SetAndSelectCurrentCell(columnIndex, lastSlot, false /*forceCurrentCellSelection (unused here)*/);
}
// Interrupt operation because it has become invalid.
return false;
}
return true;
}
private bool CommitRowEdit(bool exitEditingMode)
{
if (this.EditingRow == null)
{
return true;
}
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Index >= -1, "Expected EditingRow.Index greater than or equal to -1.");
DiagnosticsDebug.Assert(this.EditingRow.Slot < this.SlotCount, "Expected EditingRow.Slot smaller than SlotCount.");
if (!ValidateEditingRow(true /*scrollIntoView*/, false /*wireEvents*/))
{
return false;
}
this.DataConnection.EndEdit(this.EditingRow.DataContext);
if (!exitEditingMode)
{
this.DataConnection.BeginEdit(this.EditingRow.DataContext);
}
return true;
}
private void CompleteCellsCollection(DataGridRow dataGridRow)
{
DiagnosticsDebug.Assert(dataGridRow != null, "Expected non-null dataGridRow.");
int cellsInCollection = dataGridRow.Cells.Count;
if (this.ColumnsItemsInternal.Count > cellsInCollection)
{
for (int columnIndex = cellsInCollection; columnIndex < this.ColumnsItemsInternal.Count; columnIndex++)
{
AddNewCellPrivate(dataGridRow, this.ColumnsItemsInternal[columnIndex]);
}
}
}
private void ComputeScrollBarsLayout()
{
if (_ignoreNextScrollBarsLayout)
{
_ignoreNextScrollBarsLayout = false;
// TODO: This optimization is causing problems with initial layout:
// Investigate why horizontal ScrollBar sometimes has incorrect thumb size when
// it first appears after adding a row when this perf improvement is turned on.
// return;
}
bool isHorizontalScrollBarOverCells = this.IsHorizontalScrollBarOverCells;
bool isVerticalScrollBarOverCells = this.IsVerticalScrollBarOverCells;
double cellsWidth = this.CellsWidth;
double cellsHeight = this.CellsHeight;
bool allowHorizScrollBar = false;
bool forceHorizScrollBar = false;
double horizScrollBarHeight = 0;
if (_hScrollBar != null)
{
forceHorizScrollBar = this.HorizontalScrollBarVisibility == ScrollBarVisibility.Visible;
allowHorizScrollBar = forceHorizScrollBar || (this.ColumnsInternal.VisibleColumnCount > 0 &&
this.HorizontalScrollBarVisibility != ScrollBarVisibility.Disabled &&
this.HorizontalScrollBarVisibility != ScrollBarVisibility.Hidden);
// Compensate if the horizontal scrollbar is already taking up space
if (!forceHorizScrollBar && _hScrollBar.Visibility == Visibility.Visible)
{
if (!isHorizontalScrollBarOverCells)
{
cellsHeight += _hScrollBar.DesiredSize.Height;
}
}
if (!isHorizontalScrollBarOverCells)
{
horizScrollBarHeight = _hScrollBar.Height + _hScrollBar.Margin.Top + _hScrollBar.Margin.Bottom;
}
}
bool allowVertScrollBar = false;
bool forceVertScrollBar = false;
double vertScrollBarWidth = 0;
if (_vScrollBar != null)
{
forceVertScrollBar = this.VerticalScrollBarVisibility == ScrollBarVisibility.Visible;
allowVertScrollBar = forceVertScrollBar || (this.ColumnsItemsInternal.Count > 0 &&
this.VerticalScrollBarVisibility != ScrollBarVisibility.Disabled &&
this.VerticalScrollBarVisibility != ScrollBarVisibility.Hidden);
// Compensate if the vertical scrollbar is already taking up space
if (!forceVertScrollBar && _vScrollBar.Visibility == Visibility.Visible)
{
if (!isVerticalScrollBarOverCells)
{
cellsWidth += _vScrollBar.DesiredSize.Width;
}
}
if (!isVerticalScrollBarOverCells)
{
vertScrollBarWidth = _vScrollBar.Width + _vScrollBar.Margin.Left + _vScrollBar.Margin.Right;
}
}
// Now cellsWidth is the width potentially available for displaying data cells.
// Now cellsHeight is the height potentially available for displaying data cells.
bool needHorizScrollBar = false;
bool needVertScrollBar = false;
double totalVisibleWidth = this.ColumnsInternal.VisibleEdgedColumnsWidth;
double totalVisibleFrozenWidth = this.ColumnsInternal.GetVisibleFrozenEdgedColumnsWidth();
UpdateDisplayedRows(this.DisplayData.FirstScrollingSlot, this.CellsHeight);
double totalVisibleHeight = this.EdgedRowsHeightCalculated;
if (!forceHorizScrollBar && !forceVertScrollBar)
{
bool needHorizScrollBarWithoutVertScrollBar = false;
if (allowHorizScrollBar &&
DoubleUtil.GreaterThan(totalVisibleWidth, cellsWidth) &&
DoubleUtil.LessThan(totalVisibleFrozenWidth, cellsWidth) &&
DoubleUtil.LessThanOrClose(horizScrollBarHeight, cellsHeight))
{
double oldDataHeight = cellsHeight;
cellsHeight -= horizScrollBarHeight;
DiagnosticsDebug.Assert(cellsHeight >= 0, "Expected positive cellsHeight.");
needHorizScrollBarWithoutVertScrollBar = needHorizScrollBar = true;
if (vertScrollBarWidth > 0 &&
allowVertScrollBar &&
(DoubleUtil.LessThanOrClose(totalVisibleWidth - cellsWidth, vertScrollBarWidth) || DoubleUtil.LessThanOrClose(cellsWidth - totalVisibleFrozenWidth, vertScrollBarWidth)))
{
// Would we still need a horizontal scrollbar without the vertical one?
UpdateDisplayedRows(this.DisplayData.FirstScrollingSlot, cellsHeight);
if (this.DisplayData.NumTotallyDisplayedScrollingElements != this.VisibleSlotCount)
{
needHorizScrollBar = DoubleUtil.LessThan(totalVisibleFrozenWidth, cellsWidth - vertScrollBarWidth);
}
if (!needHorizScrollBar)
{
// Restore old data height because turns out a horizontal scroll bar wouldn't make sense
cellsHeight = oldDataHeight;
}
}
}
// Store the current FirstScrollingSlot because removing the horizontal scrollbar could scroll
// the DataGrid up; however, if we realize later that we need to keep the horizontal scrollbar
// then we should use the first slot stored here which is not scrolled.
int firstScrollingSlot = this.DisplayData.FirstScrollingSlot;
UpdateDisplayedRows(firstScrollingSlot, cellsHeight);
if (allowVertScrollBar &&
DoubleUtil.GreaterThan(cellsHeight, 0) &&
DoubleUtil.LessThanOrClose(vertScrollBarWidth, cellsWidth) &&
this.DisplayData.NumTotallyDisplayedScrollingElements != this.VisibleSlotCount)
{
cellsWidth -= vertScrollBarWidth;
DiagnosticsDebug.Assert(cellsWidth >= 0, "Expected positive cellsWidth.");
needVertScrollBar = true;
}
this.DisplayData.FirstDisplayedScrollingCol = ComputeFirstVisibleScrollingColumn();
// We compute the number of visible columns only after we set up the vertical scroll bar.
ComputeDisplayedColumns();
if ((vertScrollBarWidth > 0 || horizScrollBarHeight > 0) &&
allowHorizScrollBar &&
needVertScrollBar && !needHorizScrollBar &&
DoubleUtil.GreaterThan(totalVisibleWidth, cellsWidth) &&
DoubleUtil.LessThan(totalVisibleFrozenWidth, cellsWidth) &&
DoubleUtil.LessThanOrClose(horizScrollBarHeight, cellsHeight))
{
cellsWidth += vertScrollBarWidth;
cellsHeight -= horizScrollBarHeight;
DiagnosticsDebug.Assert(cellsHeight >= 0, "Expected positive cellsHeight.");
needVertScrollBar = false;
UpdateDisplayedRows(firstScrollingSlot, cellsHeight);
if (cellsHeight > 0 &&
vertScrollBarWidth <= cellsWidth &&
this.DisplayData.NumTotallyDisplayedScrollingElements != this.VisibleSlotCount)
{
cellsWidth -= vertScrollBarWidth;
DiagnosticsDebug.Assert(cellsWidth >= 0, "Expected positive cellsWidth.");
needVertScrollBar = true;
}
if (needVertScrollBar)
{
needHorizScrollBar = true;
}
else
{
needHorizScrollBar = needHorizScrollBarWithoutVertScrollBar;
}
}
}
else if (forceHorizScrollBar && !forceVertScrollBar)
{
if (allowVertScrollBar)
{
if (cellsHeight > 0 &&
DoubleUtil.LessThanOrClose(vertScrollBarWidth, cellsWidth) &&
this.DisplayData.NumTotallyDisplayedScrollingElements != this.VisibleSlotCount)
{
cellsWidth -= vertScrollBarWidth;
DiagnosticsDebug.Assert(cellsWidth >= 0, "Expected positive cellsWidth.");
needVertScrollBar = true;
}
this.DisplayData.FirstDisplayedScrollingCol = ComputeFirstVisibleScrollingColumn();
ComputeDisplayedColumns();
}
needHorizScrollBar = totalVisibleWidth > cellsWidth && totalVisibleFrozenWidth < cellsWidth;
}
else if (!forceHorizScrollBar && forceVertScrollBar)
{
if (allowHorizScrollBar)
{
if (cellsWidth > 0 &&
DoubleUtil.LessThanOrClose(horizScrollBarHeight, cellsHeight) &&
DoubleUtil.GreaterThan(totalVisibleWidth, cellsWidth) &&
DoubleUtil.LessThan(totalVisibleFrozenWidth, cellsWidth))
{
cellsHeight -= horizScrollBarHeight;
DiagnosticsDebug.Assert(cellsHeight >= 0, "Expected positive cellsHeight.");
needHorizScrollBar = true;
UpdateDisplayedRows(this.DisplayData.FirstScrollingSlot, cellsHeight);
}
this.DisplayData.FirstDisplayedScrollingCol = ComputeFirstVisibleScrollingColumn();
ComputeDisplayedColumns();
}
needVertScrollBar = this.DisplayData.NumTotallyDisplayedScrollingElements != this.VisibleSlotCount;
}
else
{
DiagnosticsDebug.Assert(forceHorizScrollBar, "Expected forceHorizScrollBar is true.");
DiagnosticsDebug.Assert(forceVertScrollBar, "Expected forceVertScrollBar is true.");
DiagnosticsDebug.Assert(allowHorizScrollBar, "Expected allowHorizScrollBar is true.");
DiagnosticsDebug.Assert(allowVertScrollBar, "Expected allowVertScrollBar is true.");
this.DisplayData.FirstDisplayedScrollingCol = ComputeFirstVisibleScrollingColumn();
ComputeDisplayedColumns();
needVertScrollBar = this.DisplayData.NumTotallyDisplayedScrollingElements != this.VisibleSlotCount;
needHorizScrollBar = totalVisibleWidth > cellsWidth && totalVisibleFrozenWidth < cellsWidth;
}
UpdateHorizontalScrollBar(needHorizScrollBar, forceHorizScrollBar, totalVisibleWidth, totalVisibleFrozenWidth, cellsWidth);
UpdateVerticalScrollBar(needVertScrollBar, forceVertScrollBar, totalVisibleHeight, cellsHeight);
if (_topRightCornerHeader != null)
{
// Show the TopRightHeaderCell based on vertical ScrollBar visibility
if (this.AreColumnHeadersVisible &&
_vScrollBar != null && _vScrollBar.Visibility == Visibility.Visible)
{
_topRightCornerHeader.Visibility = Visibility.Visible;
}
else
{
_topRightCornerHeader.Visibility = Visibility.Collapsed;
}
}
if (_bottomRightCorner != null)
{
// Show the BottomRightCorner when both scrollbars are visible.
_bottomRightCorner.Visibility =
_hScrollBar != null && _hScrollBar.Visibility == Visibility.Visible &&
_vScrollBar != null && _vScrollBar.Visibility == Visibility.Visible ?
Visibility.Visible : Visibility.Collapsed;
}
this.DisplayData.FullyRecycleElements();
}
#if FEATURE_VALIDATION_SUMMARY
/// <summary>
/// Create an ValidationSummaryItem for a given ValidationResult, by finding all cells related to the
/// validation error and adding them as separate ValidationSummaryItemSources.
/// </summary>
/// <param name="validationResult">ValidationResult</param>
/// <returns>ValidationSummaryItem</returns>
private ValidationSummaryItem CreateValidationSummaryItem(ValidationResult validationResult)
{
DiagnosticsDebug.Assert(validationResult != null);
DiagnosticsDebug.Assert(_validationSummary != null);
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
ValidationSummaryItem validationSummaryItem = new ValidationSummaryItem(validationResult.ErrorMessage);
validationSummaryItem.Context = validationResult;
string messageHeader = null;
foreach (DataGridColumn column in this.ColumnsInternal.GetDisplayedColumns(c => c.IsVisible && !c.IsReadOnly))
{
foreach (string property in validationResult.MemberNames)
{
if (!string.IsNullOrEmpty(property) && column.BindingPaths.Contains(property))
{
validationSummaryItem.Sources.Add(new ValidationSummaryItemSource(property, this.EditingRow.Cells[column.Index]));
if (string.IsNullOrEmpty(messageHeader) && column.Header != null)
{
messageHeader = column.Header.ToString();
}
}
}
}
DiagnosticsDebug.Assert(validationSummaryItem.ItemType == ValidationSummaryItemType.ObjectError);
if (_propertyValidationResults.ContainsEqualValidationResult(validationResult))
{
validationSummaryItem.MessageHeader = messageHeader;
validationSummaryItem.ItemType = ValidationSummaryItemType.PropertyError;
}
return validationSummaryItem;
}
#endif
/// <summary>
/// Handles the current editing element's LostFocus event by performing any actions that
/// were cached by the WaitForLostFocus method.
/// </summary>
/// <param name="sender">Editing element</param>
/// <param name="e">RoutedEventArgs</param>
private void EditingElement_LostFocus(object sender, RoutedEventArgs e)
{
FrameworkElement editingElement = sender as FrameworkElement;
if (editingElement != null)
{
editingElement.LostFocus -= new RoutedEventHandler(EditingElement_LostFocus);
if (this.EditingRow != null && this.EditingColumnIndex != -1)
{
this.FocusEditingCell(true);
}
DiagnosticsDebug.Assert(_lostFocusActions != null, "Expected non-null _lostFocusActions.");
try
{
_executingLostFocusActions = true;
while (_lostFocusActions.Count > 0)
{
_lostFocusActions.Dequeue()();
}
}
finally
{
_executingLostFocusActions = false;
}
}
}
// Makes sure horizontal layout is updated to reflect any changes that affect it
private void EnsureHorizontalLayout()
{
this.ColumnsInternal.EnsureVisibleEdgedColumnsWidth();
InvalidateColumnHeadersMeasure();
InvalidateRowsMeasure(true);
InvalidateMeasure();
}
/// <summary>
/// Ensures that the RowHeader widths are properly sized and invalidates them if they are not
/// </summary>
/// <returns>True if a RowHeader or RowGroupHeader was invalidated</returns>
private bool EnsureRowHeaderWidth()
{
bool invalidated = false;
if (this.AreRowHeadersVisible)
{
if (this.AreColumnHeadersVisible)
{
EnsureTopLeftCornerHeader();
}
if (_rowsPresenter != null)
{
foreach (UIElement element in _rowsPresenter.Children)
{
DataGridRow row = element as DataGridRow;
if (row != null)
{
// If the RowHeader resulted in a different width the last time it was measured, we need
// to re-measure it
if (row.HeaderCell != null && row.HeaderCell.DesiredSize.Width != this.ActualRowHeaderWidth)
{
row.HeaderCell.InvalidateMeasure();
invalidated = true;
}
}
else
{
DataGridRowGroupHeader groupHeader = element as DataGridRowGroupHeader;
if (groupHeader != null && groupHeader.HeaderCell != null && groupHeader.HeaderCell.DesiredSize.Width != this.ActualRowHeaderWidth)
{
groupHeader.HeaderCell.InvalidateMeasure();
invalidated = true;
}
}
}
if (invalidated)
{
// We need to update the width of the horizontal scrollbar if the rowHeaders' width actually changed
if (this.ColumnsInternal.VisibleStarColumnCount > 0)
{
this.ColumnsInternal.EnsureVisibleEdgedColumnsWidth();
}
InvalidateMeasure();
}
}
}
return invalidated;
}
private void EnsureRowsPresenterVisibility()
{
if (_rowsPresenter != null)
{
// RowCount doesn't need to be considered, doing so might cause extra Visibility changes
_rowsPresenter.Visibility = this.ColumnsInternal.FirstVisibleNonFillerColumn == null ? Visibility.Collapsed : Visibility.Visible;
}
}
private void EnsureTopLeftCornerHeader()
{
if (_topLeftCornerHeader != null)
{
_topLeftCornerHeader.Visibility = this.HeadersVisibility == DataGridHeadersVisibility.All ? Visibility.Visible : Visibility.Collapsed;
if (_topLeftCornerHeader.Visibility == Visibility.Visible)
{
if (!double.IsNaN(this.RowHeaderWidth))
{
// RowHeaderWidth is set explicitly so we should use that
_topLeftCornerHeader.Width = this.RowHeaderWidth;
}
else if (this.VisibleSlotCount > 0)
{
// RowHeaders AutoSize and we have at least 1 row so take the desired width
_topLeftCornerHeader.Width = this.RowHeadersDesiredWidth;
}
}
}
}
#if FEATURE_VALIDATION_SUMMARY
/// <summary>
/// Handles the ValidationSummary's FocusingInvalidControl event and begins edit on the cells
/// that are associated with the selected error.
/// </summary>
/// <param name="sender">ValidationSummary</param>
/// <param name="e">FocusingInvalidControlEventArgs</param>
private void ValidationSummary_FocusingInvalidControl(object sender, FocusingInvalidControlEventArgs e)
{
DiagnosticsDebug.Assert(_validationSummary != null);
if (this.EditingRow == null || this.IsSlotOutOfBounds(this.EditingRow.Slot) || this.EditingRow.Slot == -1 || !ScrollSlotIntoView(this.EditingRow.Slot, false /*scrolledHorizontally*/))
{
return;
}
// We need to focus the DataGrid in case the focused element gets removed when we end edit.
if ((_editingColumnIndex == -1 || (this.Focus(FocusState.Programmatic) && EndCellEdit(DataGridEditAction.Commit, true, true, true)))
&& e.Item != null && e.Target != null && _validationSummary.Errors.Contains(e.Item))
{
DataGridCell cell = e.Target.Control as DataGridCell;
if (cell != null && cell.OwningGrid == this && cell.OwningColumn != null && cell.OwningColumn.IsVisible)
{
DiagnosticsDebug.Assert(cell.ColumnIndex >= 0 && cell.ColumnIndex < this.ColumnsInternal.Count);
// Begin editing the next relevant cell
UpdateSelectionAndCurrency(cell.ColumnIndex, this.EditingRow.Slot, DataGridSelectionAction.None, true /*scrollIntoView*/);
if (_successfullyUpdatedSelection)
{
BeginCellEdit(new RoutedEventArgs());
if (!IsColumnDisplayed(this.CurrentColumnIndex))
{
ScrollColumnIntoView(this.CurrentColumnIndex);
}
}
}
e.Handled = true;
}
}
/// <summary>
/// Handles the ValidationSummary's SelectionChanged event and changes which cells are displayed as invalid.
/// </summary>
/// <param name="sender">ValidationSummary</param>
/// <param name="e">SelectionChangedEventArgs</param>
private void ValidationSummary_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// ValidationSummary only supports single-selection mode.
if (e.AddedItems.Count == 1)
{
_selectedValidationSummaryItem = e.AddedItems[0] as ValidationSummaryItem;
}
this.UpdateValidationStatus();
}
#endif
// Recursively expands parent RowGroupHeaders from the top down
private void ExpandRowGroupParentChain(int level, int slot)
{
if (level < 0)
{
return;
}
int previousHeaderSlot = this.RowGroupHeadersTable.GetPreviousIndex(slot + 1);
while (previousHeaderSlot >= 0)
{
DataGridRowGroupInfo rowGroupInfo = this.RowGroupHeadersTable.GetValueAt(previousHeaderSlot);
DiagnosticsDebug.Assert(rowGroupInfo != null, "Expected non-null rowGroupInfo.");
if (level == rowGroupInfo.Level)
{
if (_collapsedSlotsTable.Contains(rowGroupInfo.Slot))
{
// Keep going up the chain
ExpandRowGroupParentChain(level - 1, rowGroupInfo.Slot - 1);
}
if (rowGroupInfo.Visibility != Visibility.Visible)
{
EnsureRowGroupVisibility(rowGroupInfo, Visibility.Visible, false);
}
return;
}
else
{
previousHeaderSlot = this.RowGroupHeadersTable.GetPreviousIndex(previousHeaderSlot);
}
}
}
#if FEATURE_VALIDATION_SUMMARY
/// <summary>
/// Searches through the DataGrid's ValidationSummary for any errors that use the given
/// ValidationResult as the ValidationSummaryItem's Context value.
/// </summary>
/// <param name="context">ValidationResult</param>
/// <returns>ValidationSummaryItem or null if not found</returns>
private ValidationSummaryItem FindValidationSummaryItem(ValidationResult context)
{
DiagnosticsDebug.Assert(context != null);
DiagnosticsDebug.Assert(_validationSummary != null);
foreach (ValidationSummaryItem ValidationSummaryItem in _validationSummary.Errors)
{
if (context.Equals(ValidationSummaryItem.Context))
{
return ValidationSummaryItem;
}
}
return null;
}
#endif
private void InvalidateCellsArrange()
{
foreach (DataGridRow row in GetAllRows())
{
row.InvalidateHorizontalArrange();
}
}
private void InvalidateColumnHeadersArrange()
{
if (_columnHeadersPresenter != null)
{
_columnHeadersPresenter.InvalidateArrange();
}
}
private void InvalidateColumnHeadersMeasure()
{
if (_columnHeadersPresenter != null)
{
EnsureColumnHeadersVisibility();
_columnHeadersPresenter.InvalidateMeasure();
}
}
private void InvalidateRowsArrange()
{
if (_rowsPresenter != null)
{
_rowsPresenter.InvalidateArrange();
}
}
private void InvalidateRowsMeasure(bool invalidateIndividualElements)
{
if (_rowsPresenter != null)
{
_rowsPresenter.InvalidateMeasure();
if (invalidateIndividualElements)
{
foreach (UIElement element in _rowsPresenter.Children)
{
element.InvalidateMeasure();
}
}
}
}
private void DataGrid_GettingFocus(UIElement sender, GettingFocusEventArgs e)
{
_focusInputDevice = e.InputDevice;
}
private void DataGrid_GotFocus(object sender, RoutedEventArgs e)
{
if (!this.ContainsFocus)
{
this.ContainsFocus = true;
ApplyDisplayedRowsState(this.DisplayData.FirstScrollingSlot, this.DisplayData.LastScrollingSlot);
if (this.CurrentColumnIndex != -1 && this.IsSlotVisible(this.CurrentSlot))
{
UpdateCurrentState(this.DisplayData.GetDisplayedElement(this.CurrentSlot), this.CurrentColumnIndex, true /*applyCellState*/);
}
}
DependencyObject focusedElement = e.OriginalSource as DependencyObject;
_focusedObject = focusedElement;
while (focusedElement != null)
{
// Keep track of which row contains the newly focused element
var focusedRow = focusedElement as DataGridRow;
if (focusedRow != null && focusedRow.OwningGrid == this && _focusedRow != focusedRow)
{
ResetFocusedRow();
_focusedRow = focusedRow.Visibility == Visibility.Visible ? focusedRow : null;
break;
}
focusedElement = VisualTreeHelper.GetParent(focusedElement);
}
_preferMouseIndicators = _focusInputDevice == FocusInputDeviceKind.Mouse || _focusInputDevice == FocusInputDeviceKind.Pen;
ShowScrollBars();
// If the DataGrid itself got focus, we actually want the automation focus to be on the current element
if (e.OriginalSource == this && AutomationPeer.ListenerExists(AutomationEvents.AutomationFocusChanged))
{
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationFocusChangedEvent(this.CurrentSlot, this.CurrentColumnIndex);
}
}
}
private void DataGrid_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
{
UpdateDisabledVisual();
if (!this.IsEnabled)
{
HideScrollBars(true /*useTransitions*/);
}
}
private void DataGrid_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (!e.Handled)
{
e.Handled = ProcessDataGridKey(e);
this.LastHandledKeyDown = e.Handled ? e.Key : VirtualKey.None;
}
}
private void DataGrid_KeyUp(object sender, KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.Tab && e.OriginalSource == this)
{
if (this.CurrentColumnIndex == -1)
{
if (this.ColumnHeaders != null && this.AreColumnHeadersVisible && !this.ColumnHeaderHasFocus)
{
this.ColumnHeaderHasFocus = true;
}
}
else
{
if (this.ColumnHeaders != null && this.AreColumnHeadersVisible)
{
KeyboardHelper.GetMetaKeyState(out _, out var shift);
if (shift && this.LastHandledKeyDown != VirtualKey.Tab)
{
DiagnosticsDebug.Assert(!this.ColumnHeaderHasFocus, "Expected ColumnHeaderHasFocus is false.");
// Show currency on the current column's header as focus is entering the DataGrid backwards.
this.ColumnHeaderHasFocus = true;
}
}
bool success = ScrollSlotIntoView(this.CurrentColumnIndex, this.CurrentSlot, false /*forCurrentCellChange*/, true /*forceHorizontalScroll*/);
DiagnosticsDebug.Assert(success, "Expected ScrollSlotIntoView returns true.");
if (this.CurrentColumnIndex != -1 && this.SelectedItem == null)
{
SetRowSelection(this.CurrentSlot, true /*isSelected*/, true /*setAnchorSlot*/);
}
}
}
}
private void DataGrid_LostFocus(object sender, RoutedEventArgs e)
{
_focusedObject = null;
if (this.ContainsFocus)
{
bool focusLeftDataGrid = true;
bool dataGridWillReceiveRoutedEvent = true;
DataGridColumn editingColumn = null;
// Walk up the visual tree of the newly focused element
// to determine if focus is still within DataGrid.
object focusedObject = GetFocusedElement();
DependencyObject focusedDependencyObject = focusedObject as DependencyObject;
while (focusedDependencyObject != null)
{
if (focusedDependencyObject == this)
{
focusLeftDataGrid = false;
break;
}
// Walk up the visual tree. Try using the framework element's
// parent. We do this because Popups behave differently with respect to the visual tree,
// and it could have a parent even if the VisualTreeHelper doesn't find it.
DependencyObject parent = null;
FrameworkElement element = focusedDependencyObject as FrameworkElement;
if (element == null)
{
parent = VisualTreeHelper.GetParent(focusedDependencyObject);
}
else
{
parent = element.Parent;
if (parent == null)
{
parent = VisualTreeHelper.GetParent(focusedDependencyObject);
}
else
{
dataGridWillReceiveRoutedEvent = false;
}
}
focusedDependencyObject = parent;
}
if (this.EditingRow != null && this.EditingColumnIndex != -1)
{
editingColumn = this.ColumnsItemsInternal[this.EditingColumnIndex];
if (focusLeftDataGrid && editingColumn is DataGridTemplateColumn)
{
dataGridWillReceiveRoutedEvent = false;
}
}
if (focusLeftDataGrid && !(editingColumn is DataGridTemplateColumn))
{
this.ContainsFocus = false;
if (this.EditingRow != null)
{
CommitEdit(DataGridEditingUnit.Row, true /*exitEditingMode*/);
}
ResetFocusedRow();
ApplyDisplayedRowsState(this.DisplayData.FirstScrollingSlot, this.DisplayData.LastScrollingSlot);
if (this.ColumnHeaderHasFocus)
{
this.ColumnHeaderHasFocus = false;
}
else if (this.CurrentColumnIndex != -1 && this.IsSlotVisible(this.CurrentSlot))
{
UpdateCurrentState(this.DisplayData.GetDisplayedElement(this.CurrentSlot), this.CurrentColumnIndex, true /*applyCellState*/);
}
}
else if (!dataGridWillReceiveRoutedEvent)
{
FrameworkElement focusedElement = focusedObject as FrameworkElement;
if (focusedElement != null)
{
focusedElement.LostFocus += new RoutedEventHandler(ExternalEditingElement_LostFocus);
}
}
}
}
private object GetFocusedElement()
{
if (TypeHelper.IsXamlRootAvailable && XamlRoot != null)
{
return FocusManager.GetFocusedElement(XamlRoot);
}
else
{
return FocusManager.GetFocusedElement();
}
}
private void DataGrid_PointerEntered(object sender, PointerRoutedEventArgs e)
{
if (e.Pointer.PointerDeviceType != PointerDeviceType.Touch)
{
// Mouse/Pen inputs dominate. If touch panning indicators are shown, switch to mouse indicators.
_preferMouseIndicators = true;
ShowScrollBars();
}
}
private void DataGrid_PointerExited(object sender, PointerRoutedEventArgs e)
{
if (e.Pointer.PointerDeviceType != PointerDeviceType.Touch)
{
// Mouse/Pen inputs dominate. If touch panning indicators are shown, switch to mouse indicators.
_isPointerOverHorizontalScrollBar = false;
_isPointerOverVerticalScrollBar = false;
_preferMouseIndicators = true;
ShowScrollBars();
HideScrollBarsAfterDelay();
}
}
private void DataGrid_PointerMoved(object sender, PointerRoutedEventArgs e)
{
// Don't process if this is a generated replay of the event.
if (e.IsGenerated)
{
return;
}
if (e.Pointer.PointerDeviceType != PointerDeviceType.Touch)
{
// Mouse/Pen inputs dominate. If touch panning indicators are shown, switch to mouse indicators.
_preferMouseIndicators = true;
ShowScrollBars();
if (!UISettingsHelper.AreSettingsEnablingAnimations &&
_hideScrollBarsTimer != null &&
(_isPointerOverHorizontalScrollBar || _isPointerOverVerticalScrollBar))
{
StopHideScrollBarsTimer();
}
}
}
private void DataGrid_PointerPressed(object sender, PointerRoutedEventArgs e)
{
if (e.Handled)
{
return;
}
// Show the scroll bars as soon as a pointer is pressed on the DataGrid.
ShowScrollBars();
}
private void DataGrid_PointerReleased(object sender, PointerRoutedEventArgs e)
{
if (this.CurrentColumnIndex != -1 && this.CurrentSlot != -1)
{
e.Handled = true;
}
}
private void DataGrid_Unloaded(object sender, RoutedEventArgs e)
{
_showingMouseIndicators = false;
_keepScrollBarsShowing = false;
}
#if FEATURE_VALIDATION
private void EditingElement_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added && e.Error.Exception != null && e.Error.ErrorContent != null)
{
ValidationResult validationResult = new ValidationResult(e.Error.ErrorContent.ToString(), new List<string>() { _updateSourcePath });
_bindingValidationResults.AddIfNew(validationResult);
}
}
#endif
private void EditingElement_Loaded(object sender, RoutedEventArgs e)
{
FrameworkElement element = sender as FrameworkElement;
if (element != null)
{
element.Loaded -= new RoutedEventHandler(EditingElement_Loaded);
}
PreparingCellForEditPrivate(element);
}
private bool EndCellEdit(DataGridEditAction editAction, bool exitEditingMode, bool keepFocus, bool raiseEvents)
{
if (_editingColumnIndex == -1)
{
return true;
}
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Slot == this.CurrentSlot, "Expected EditingRow.Slot equals CurrentSlot.");
DiagnosticsDebug.Assert(_editingColumnIndex >= 0, "Expected positive _editingColumnIndex.");
DiagnosticsDebug.Assert(_editingColumnIndex < this.ColumnsItemsInternal.Count, "Expected _editingColumnIndex smaller than this.ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(_editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals this.CurrentColumnIndex.");
// Cache these to see if they change later
int currentSlot = this.CurrentSlot;
int currentColumnIndex = this.CurrentColumnIndex;
// We're ready to start ending, so raise the event
DataGridCell editingCell = this.EditingRow.Cells[_editingColumnIndex];
FrameworkElement editingElement = editingCell.Content as FrameworkElement;
if (editingElement == null)
{
return false;
}
if (raiseEvents)
{
DataGridCellEditEndingEventArgs e = new DataGridCellEditEndingEventArgs(this.CurrentColumn, this.EditingRow, editingElement, editAction);
OnCellEditEnding(e);
if (e.Cancel)
{
// CellEditEnding has been canceled
return false;
}
// Ensure that the current cell wasn't changed in the user's CellEditEnding handler
if (_editingColumnIndex == -1 ||
currentSlot != this.CurrentSlot ||
currentColumnIndex != this.CurrentColumnIndex)
{
return true;
}
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Slot == currentSlot, "Expected EditingRow.Slot equals currentSlot.");
DiagnosticsDebug.Assert(_editingColumnIndex != -1, "Expected _editingColumnIndex other than -1.");
DiagnosticsDebug.Assert(_editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals CurrentColumnIndex.");
}
_bindingValidationResults.Clear();
// If we're canceling, let the editing column repopulate its old value if it wants
if (editAction == DataGridEditAction.Cancel)
{
this.CurrentColumn.CancelCellEditInternal(editingElement, _uneditedValue);
// Ensure that the current cell wasn't changed in the user column's CancelCellEdit
if (_editingColumnIndex == -1 ||
currentSlot != this.CurrentSlot ||
currentColumnIndex != this.CurrentColumnIndex)
{
return true;
}
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Slot == currentSlot, "Expected EditingRow.Slot equals currentSlot.");
DiagnosticsDebug.Assert(_editingColumnIndex != -1, "Expected _editingColumnIndex other than -1.");
DiagnosticsDebug.Assert(_editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals CurrentColumnIndex.");
// Re-validate
this.ValidateEditingRow(true /*scrollIntoView*/, false /*wireEvents*/);
}
// If we're committing, explicitly update the source but watch out for any validation errors
if (editAction == DataGridEditAction.Commit)
{
foreach (BindingInfo bindingData in this.CurrentColumn.GetInputBindings(editingElement, this.CurrentItem))
{
DiagnosticsDebug.Assert(bindingData.BindingExpression.ParentBinding != null, "Expected non-null bindingData.BindingExpression.ParentBinding.");
_updateSourcePath = bindingData.BindingExpression.ParentBinding.Path != null ? bindingData.BindingExpression.ParentBinding.Path.Path : null;
#if FEATURE_VALIDATION
bindingData.Element.BindingValidationError += new EventHandler<ValidationErrorEventArgs>(EditingElement_BindingValidationError);
#endif
try
{
bindingData.BindingExpression.UpdateSource();
}
finally
{
#if FEATURE_VALIDATION
bindingData.Element.BindingValidationError -= new EventHandler<ValidationErrorEventArgs>(EditingElement_BindingValidationError);
#endif
}
}
// Re-validate
this.ValidateEditingRow(true /*scrollIntoView*/, false /*wireEvents*/);
if (_bindingValidationResults.Count > 0)
{
ScrollSlotIntoView(this.CurrentColumnIndex, this.CurrentSlot, false /*forCurrentCellChange*/, true /*forceHorizontalScroll*/);
return false;
}
}
if (exitEditingMode)
{
_editingColumnIndex = -1;
editingCell.ApplyCellState(true /*animate*/);
// TODO: Figure out if we should restore a cached this.IsTabStop.
this.IsTabStop = true;
if (keepFocus && editingElement.ContainsFocusedElement(this))
{
this.Focus(FocusState.Programmatic);
}
PopulateCellContent(!exitEditingMode /*isCellEdited*/, this.CurrentColumn, this.EditingRow, editingCell);
}
// We're done, so raise the CellEditEnded event
if (raiseEvents)
{
OnCellEditEnded(new DataGridCellEditEndedEventArgs(this.CurrentColumn, this.EditingRow, editAction));
}
// There's a chance that somebody reopened this cell for edit within the CellEditEnded handler,
// so we should return false if we were supposed to exit editing mode, but we didn't
return !(exitEditingMode && currentColumnIndex == _editingColumnIndex);
}
private bool EndRowEdit(DataGridEditAction editAction, bool exitEditingMode, bool raiseEvents)
{
// Explicit row end edit has been triggered, so we can no longer be initializing a new item.
_initializingNewItem = false;
if (this.EditingRow == null || this.DataConnection.EndingEdit)
{
return true;
}
if (_editingColumnIndex != -1 || (editAction == DataGridEditAction.Cancel && raiseEvents &&
!(this.DataConnection.CanCancelEdit || this.EditingRow.DataContext is IEditableObject || this.DataConnection.IsAddingNew)))
{
// Ending the row edit will fail immediately under the following conditions:
// 1. We haven't ended the cell edit yet.
// 2. We're trying to cancel edit when the underlying DataType is not an IEditableObject,
// because we have no way to properly restore the old value. We will only allow this to occur if:
// a. raiseEvents == false, which means we're internally forcing a cancel or
// b. we're canceling a new item addition.
return false;
}
DataGridRow editingRow = this.EditingRow;
if (raiseEvents)
{
DataGridRowEditEndingEventArgs e = new DataGridRowEditEndingEventArgs(this.EditingRow, editAction);
OnRowEditEnding(e);
if (e.Cancel)
{
// RowEditEnding has been canceled
return false;
}
// Editing states might have been changed in the RowEditEnding handlers
if (_editingColumnIndex != -1)
{
return false;
}
if (editingRow != this.EditingRow)
{
return true;
}
}
// Call the appropriate commit or cancel methods
if (editAction == DataGridEditAction.Commit)
{
if (!CommitRowEdit(exitEditingMode))
{
return false;
}
}
else
{
if (!CancelRowEdit(exitEditingMode) && raiseEvents)
{
// We failed to cancel edit so we should abort unless we're forcing a cancel
return false;
}
}
ResetValidationStatus();
// Update the previously edited row's state
if (exitEditingMode && editingRow == this.EditingRow)
{
// Unwire the INDEI event handlers
foreach (INotifyDataErrorInfo indei in _validationItems.Keys)
{
indei.ErrorsChanged -= new EventHandler<DataErrorsChangedEventArgs>(ValidationItem_ErrorsChanged);
}
_validationItems.Clear();
this.RemoveEditingElements();
ResetEditingRow();
}
if (this.CurrentSlot == -1 && this.DataConnection.CollectionView != null && this.DataConnection.CollectionView.CurrentItem != null)
{
// Some EditableCollectionViews (ListCollectionView in particular) do not raise CurrentChanged when CommitEdit
// changes the position of the CurrentItem. Instead, they raise a PropertyChanged event for PositionChanged.
// We recognize that case here and setup the CurrentItem again if one exists but it was removed and re-added
// during Commit. This is better than reacting to PositionChanged which would double the work in most cases
// and likely introduce regressions.
UpdateStateOnCurrentChanged(this.DataConnection.CollectionView.CurrentItem, this.DataConnection.CollectionView.CurrentPosition);
}
// Raise the RowEditEnded event
if (raiseEvents)
{
OnRowEditEnded(new DataGridRowEditEndedEventArgs(editingRow, editAction));
}
return true;
}
private void EnsureColumnHeadersVisibility()
{
if (_columnHeadersPresenter != null)
{
_columnHeadersPresenter.Visibility = this.AreColumnHeadersVisible ? Visibility.Visible : Visibility.Collapsed;
}
}
private void EnsureVerticalGridLines()
{
if (this.AreColumnHeadersVisible)
{
double totalColumnsWidth = 0;
foreach (DataGridColumn column in this.ColumnsInternal)
{
totalColumnsWidth += column.ActualWidth;
column.HeaderCell.SeparatorVisibility = (column != this.ColumnsInternal.LastVisibleColumn || totalColumnsWidth < this.CellsWidth) ?
Visibility.Visible : Visibility.Collapsed;
}
}
foreach (DataGridRow row in GetAllRows())
{
row.EnsureGridLines();
}
}
/// <summary>
/// Exits editing mode without trying to commit or revert the editing, and
/// without repopulating the edited row's cell.
/// </summary>
private void ExitEdit(bool keepFocus)
{
// We're exiting editing mode, so we can no longer be initializing a new item.
_initializingNewItem = false;
if (this.EditingRow == null || this.DataConnection.EndingEdit)
{
DiagnosticsDebug.Assert(_editingColumnIndex == -1, "Expected _editingColumnIndex equal to -1.");
return;
}
if (_editingColumnIndex != -1)
{
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Slot == this.CurrentSlot, "Expected EditingRow.Slot equals CurrentSlot.");
DiagnosticsDebug.Assert(_editingColumnIndex >= 0, "Expected positive _editingColumnIndex.");
DiagnosticsDebug.Assert(_editingColumnIndex < this.ColumnsItemsInternal.Count, "Expected _editingColumnIndex smaller than this.ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(_editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals CurrentColumnIndex.");
_editingColumnIndex = -1;
this.EditingRow.Cells[this.CurrentColumnIndex].ApplyCellState(false /*animate*/);
}
// TODO: Figure out if we should restore a cached this.IsTabStop.
this.IsTabStop = true;
if (this.IsSlotVisible(this.EditingRow.Slot))
{
this.EditingRow.ApplyState(true /*animate*/);
}
ResetEditingRow();
if (keepFocus)
{
bool success = Focus(FocusState.Programmatic);
DiagnosticsDebug.Assert(success, "Expected successful Focus call.");
}
}
private void ExternalEditingElement_LostFocus(object sender, RoutedEventArgs e)
{
FrameworkElement element = sender as FrameworkElement;
if (element != null)
{
element.LostFocus -= new RoutedEventHandler(ExternalEditingElement_LostFocus);
DataGrid_LostFocus(sender, e);
}
}
private void FlushCurrentCellChanged()
{
if (_makeFirstDisplayedCellCurrentCellPending)
{
return;
}
if (this.SelectionHasChanged)
{
// selection is changing, don't raise CurrentCellChanged until it's done
_flushCurrentCellChanged = true;
FlushSelectionChanged();
return;
}
// We don't want to expand all intermediate currency positions, so we only expand
// the last current item before we flush the event
if (_collapsedSlotsTable.Contains(this.CurrentSlot) && this.CurrentSlot != this.SlotFromRowIndex(this.DataConnection.NewItemPlaceholderIndex))
{
DataGridRowGroupInfo rowGroupInfo = this.RowGroupHeadersTable.GetValueAt(this.RowGroupHeadersTable.GetPreviousIndex(this.CurrentSlot));
DiagnosticsDebug.Assert(rowGroupInfo != null, "Expected non-null rowGroupInfo.");
if (rowGroupInfo != null)
{
this.ExpandRowGroupParentChain(rowGroupInfo.Level, rowGroupInfo.Slot);
}
}
if (this.CurrentColumn != _previousCurrentColumn || this.CurrentItem != _previousCurrentItem)
{
this.CoerceSelectedItem();
_previousCurrentColumn = this.CurrentColumn;
_previousCurrentItem = this.CurrentItem;
OnCurrentCellChanged(EventArgs.Empty);
}
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null && this.CurrentCellCoordinates != _previousAutomationFocusCoordinates)
{
_previousAutomationFocusCoordinates = new DataGridCellCoordinates(this.CurrentCellCoordinates);
// If the DataGrid itself has focus, we want to move automation focus to the new current element
object focusedObject = GetFocusedElement();
if (focusedObject == this && AutomationPeer.ListenerExists(AutomationEvents.AutomationFocusChanged))
{
peer.RaiseAutomationFocusChangedEvent(this.CurrentSlot, this.CurrentColumnIndex);
}
}
_flushCurrentCellChanged = false;
}
private void FlushSelectionChanged()
{
if (this.SelectionHasChanged && _noSelectionChangeCount == 0 && !_makeFirstDisplayedCellCurrentCellPending)
{
this.CoerceSelectedItem();
if (this.NoCurrentCellChangeCount != 0)
{
// current cell is changing, don't raise SelectionChanged until it's done
return;
}
this.SelectionHasChanged = false;
if (_flushCurrentCellChanged)
{
FlushCurrentCellChanged();
}
SelectionChangedEventArgs e = _selectedItems.GetSelectionChangedEventArgs();
if (e.AddedItems.Count > 0 || e.RemovedItems.Count > 0)
{
OnSelectionChanged(e);
}
}
}
private bool FocusEditingCell(bool setFocus)
{
DiagnosticsDebug.Assert(this.CurrentColumnIndex >= 0, "Expected positive CurrentColumnIndex.");
DiagnosticsDebug.Assert(this.CurrentColumnIndex < this.ColumnsItemsInternal.Count, "Expected CurrentColumnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.CurrentSlot >= -1, "Expected CurrentSlot greater than or equal to -1.");
DiagnosticsDebug.Assert(this.CurrentSlot < this.SlotCount, "Expected CurrentSlot smaller than SlotCount.");
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Slot == this.CurrentSlot, "Expected EditingRow.Slot equals CurrentSlot.");
DiagnosticsDebug.Assert(_editingColumnIndex != -1, "Expected _editingColumnIndex other than -1.");
// TODO: Figure out if we should cache this.IsTabStop in order to restore
// it later instead of setting it back to true unconditionally.
this.IsTabStop = false;
_focusEditingControl = false;
bool success = false;
DataGridCell dataGridCell = this.EditingRow.Cells[_editingColumnIndex];
if (setFocus)
{
if (dataGridCell.ContainsFocusedElement(this))
{
success = true;
}
else
{
success = dataGridCell.Focus(FocusState.Programmatic);
}
_focusEditingControl = !success;
}
return success;
}
/// <summary>
/// This method formats a row (specified by a DataGridRowClipboardEventArgs) into
/// a single string to be added to the Clipboard when the DataGrid is copying its contents.
/// </summary>
/// <param name="e">DataGridRowClipboardEventArgs</param>
/// <returns>The formatted string.</returns>
private string FormatClipboardContent(DataGridRowClipboardEventArgs e)
{
StringBuilder text = new StringBuilder();
for (int cellIndex = 0; cellIndex < e.ClipboardRowContent.Count; cellIndex++)
{
DataGridClipboardCellContent cellContent = e.ClipboardRowContent[cellIndex];
if (cellContent != null)
{
text.Append(cellContent.Content);
}
if (cellIndex < e.ClipboardRowContent.Count - 1)
{
text.Append('\t');
}
else
{
text.Append('\r');
text.Append('\n');
}
}
return text.ToString();
}
// Calculates the amount to scroll for the ScrollLeft button
// This is a method rather than a property to emphasize a calculation
private double GetHorizontalSmallScrollDecrease()
{
// If the first column is covered up, scroll to the start of it when the user clicks the left button
if (_negHorizontalOffset > 0)
{
return _negHorizontalOffset;
}
else
{
// The entire first column is displayed, show the entire previous column when the user clicks
// the left button
DataGridColumn previousColumn = this.ColumnsInternal.GetPreviousVisibleScrollingColumn(
this.ColumnsItemsInternal[DisplayData.FirstDisplayedScrollingCol]);
if (previousColumn != null)
{
return GetEdgedColumnWidth(previousColumn);
}
else
{
// There's no previous column so don't move
return 0;
}
}
}
// Calculates the amount to scroll for the ScrollRight button
// This is a method rather than a property to emphasize a calculation
private double GetHorizontalSmallScrollIncrease()
{
if (this.DisplayData.FirstDisplayedScrollingCol >= 0)
{
return GetEdgedColumnWidth(this.ColumnsItemsInternal[DisplayData.FirstDisplayedScrollingCol]) - _negHorizontalOffset;
}
return 0;
}
// Calculates the amount the ScrollDown button should scroll
// This is a method rather than a property to emphasize that calculations are taking place
private double GetVerticalSmallScrollIncrease()
{
if (this.DisplayData.FirstScrollingSlot >= 0)
{
return GetExactSlotElementHeight(this.DisplayData.FirstScrollingSlot) - this.NegVerticalOffset;
}
return 0;
}
private void HideScrollBars(bool useTransitions)
{
if (!_keepScrollBarsShowing)
{
_proposedScrollBarsState = ScrollBarVisualState.NoIndicator;
_proposedScrollBarsSeparatorState = UISettingsHelper.AreSettingsEnablingAnimations ? ScrollBarsSeparatorVisualState.SeparatorCollapsed : ScrollBarsSeparatorVisualState.SeparatorCollapsedWithoutAnimation;
if (UISettingsHelper.AreSettingsAutoHidingScrollBars)
{
SwitchScrollBarsVisualStates(_proposedScrollBarsState, _proposedScrollBarsSeparatorState, useTransitions);
}
}
}
private void HideScrollBarsAfterDelay()
{
if (!_keepScrollBarsShowing)
{
DispatcherQueueTimer hideScrollBarsTimer = null;
if (_hideScrollBarsTimer != null)
{
hideScrollBarsTimer = _hideScrollBarsTimer;
if (hideScrollBarsTimer.IsRunning)
{
hideScrollBarsTimer.Stop();
}
}
else
{
hideScrollBarsTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
hideScrollBarsTimer.Interval = TimeSpan.FromMilliseconds(DATAGRID_noScrollBarCountdownMs);
hideScrollBarsTimer.Tick += HideScrollBarsTimerTick;
_hideScrollBarsTimer = hideScrollBarsTimer;
}
hideScrollBarsTimer.Start();
}
}
private void HideScrollBarsTimerTick(object sender, object e)
{
StopHideScrollBarsTimer();
HideScrollBars(true /*useTransitions*/);
}
private void HookDataGridEvents()
{
this.IsEnabledChanged += new DependencyPropertyChangedEventHandler(DataGrid_IsEnabledChanged);
this.KeyDown += new KeyEventHandler(DataGrid_KeyDown);
this.KeyUp += new KeyEventHandler(DataGrid_KeyUp);
this.GettingFocus += new TypedEventHandler<UIElement, GettingFocusEventArgs>(DataGrid_GettingFocus);
this.GotFocus += new RoutedEventHandler(DataGrid_GotFocus);
this.LostFocus += new RoutedEventHandler(DataGrid_LostFocus);
this.PointerEntered += new PointerEventHandler(DataGrid_PointerEntered);
this.PointerExited += new PointerEventHandler(DataGrid_PointerExited);
this.PointerMoved += new PointerEventHandler(DataGrid_PointerMoved);
this.PointerPressed += new PointerEventHandler(DataGrid_PointerPressed);
this.PointerReleased += new PointerEventHandler(DataGrid_PointerReleased);
this.Unloaded += new RoutedEventHandler(DataGrid_Unloaded);
}
private void HookHorizontalScrollBarEvents()
{
if (_hScrollBar != null)
{
_hScrollBar.Scroll += new ScrollEventHandler(HorizontalScrollBar_Scroll);
_hScrollBar.PointerEntered += new PointerEventHandler(HorizontalScrollBar_PointerEntered);
_hScrollBar.PointerExited += new PointerEventHandler(HorizontalScrollBar_PointerExited);
}
}
private void HookVerticalScrollBarEvents()
{
if (_vScrollBar != null)
{
_vScrollBar.Scroll += new ScrollEventHandler(VerticalScrollBar_Scroll);
_vScrollBar.PointerEntered += new PointerEventHandler(VerticalScrollBar_PointerEntered);
_vScrollBar.PointerExited += new PointerEventHandler(VerticalScrollBar_PointerExited);
}
}
private void HorizontalScrollBar_PointerEntered(object sender, PointerRoutedEventArgs e)
{
_isPointerOverHorizontalScrollBar = true;
if (!UISettingsHelper.AreSettingsEnablingAnimations)
{
HideScrollBarsAfterDelay();
}
}
private void HorizontalScrollBar_PointerExited(object sender, PointerRoutedEventArgs e)
{
_isPointerOverHorizontalScrollBar = false;
HideScrollBarsAfterDelay();
}
private void VerticalScrollBar_PointerEntered(object sender, PointerRoutedEventArgs e)
{
_isPointerOverVerticalScrollBar = true;
if (!UISettingsHelper.AreSettingsEnablingAnimations)
{
HideScrollBarsAfterDelay();
}
}
private void VerticalScrollBar_PointerExited(object sender, PointerRoutedEventArgs e)
{
_isPointerOverVerticalScrollBar = false;
HideScrollBarsAfterDelay();
}
private void HorizontalScrollBar_Scroll(object sender, ScrollEventArgs e)
{
ProcessHorizontalScroll(e.ScrollEventType);
}
private void IndicatorStateStoryboard_Completed(object sender, object e)
{
// If the cursor is currently directly over either scroll bar then do not automatically hide the indicators.
if (!_keepScrollBarsShowing &&
!_isPointerOverVerticalScrollBar &&
!_isPointerOverHorizontalScrollBar)
{
// Go to the NoIndicator state using transitions.
if (UISettingsHelper.AreSettingsEnablingAnimations)
{
// By default there is a delay before the NoIndicator state actually shows.
HideScrollBars(true /*useTransitions*/);
}
else
{
// Since OS animations are turned off, use a timer to delay the scroll bars' hiding.
HideScrollBarsAfterDelay();
}
}
}
private bool IsColumnOutOfBounds(int columnIndex)
{
return columnIndex >= this.ColumnsItemsInternal.Count || columnIndex < 0;
}
private bool IsInnerCellOutOfBounds(int columnIndex, int slot)
{
return IsColumnOutOfBounds(columnIndex) || IsSlotOutOfBounds(slot);
}
private bool IsInnerCellOutOfSelectionBounds(int columnIndex, int slot)
{
return IsColumnOutOfBounds(columnIndex) || IsSlotOutOfSelectionBounds(slot);
}
private bool IsSlotOutOfBounds(int slot)
{
return slot >= this.SlotCount || slot < -1 || _collapsedSlotsTable.Contains(slot);
}
private bool IsSlotOutOfSelectionBounds(int slot)
{
if (this.RowGroupHeadersTable.Contains(slot))
{
DiagnosticsDebug.Assert(slot >= 0, "Expected positive slot.");
DiagnosticsDebug.Assert(slot < this.SlotCount, "Expected slot smaller than this.SlotCount.");
return false;
}
else
{
int rowIndex = RowIndexFromSlot(slot);
return rowIndex < 0 || rowIndex >= this.DataConnection.Count;
}
}
private void LoadMoreDataFromIncrementalItemsSource(double totalVisibleHeight)
{
if (IncrementalLoadingTrigger == IncrementalLoadingTrigger.Edge && DataConnection.IsDataSourceIncremental && DataConnection.HasMoreItems && !DataConnection.IsLoadingMoreItems)
{
var bottomScrolledOffHeight = Math.Max(0, totalVisibleHeight - CellsHeight - VerticalOffset);
if ((IncrementalLoadingThreshold * CellsHeight) >= bottomScrolledOffHeight)
{
var numberOfRowsToLoad = Math.Max(1, (int)(DataFetchSize * CellsHeight / RowHeightEstimate));
DataConnection.LoadMoreItems((uint)numberOfRowsToLoad);
}
}
}
private void MakeFirstDisplayedCellCurrentCell()
{
if (this.CurrentColumnIndex != -1)
{
_makeFirstDisplayedCellCurrentCellPending = false;
_desiredCurrentColumnIndex = -1;
this.FlushCurrentCellChanged();
return;
}
if (this.SlotCount != SlotFromRowIndex(this.DataConnection.Count))
{
_makeFirstDisplayedCellCurrentCellPending = true;
return;
}
// No current cell, therefore no selection either - try to set the current cell to the
// ItemsSource's ICollectionView.CurrentItem if it exists, otherwise use the first displayed cell.
int slot;
if (this.DataConnection.CollectionView != null)
{
if (this.DataConnection.CollectionView.IsCurrentBeforeFirst ||
this.DataConnection.CollectionView.IsCurrentAfterLast)
{
slot = this.RowGroupHeadersTable.Contains(0) ? 0 : -1;
}
else
{
slot = SlotFromRowIndex(this.DataConnection.CollectionView.CurrentPosition);
}
}
else
{
if (this.SelectedIndex == -1)
{
// Try to default to the first row
slot = SlotFromRowIndex(0);
if (!this.IsSlotVisible(slot))
{
slot = -1;
}
}
else
{
slot = SlotFromRowIndex(this.SelectedIndex);
}
}
int columnIndex = this.FirstDisplayedNonFillerColumnIndex;
if (_desiredCurrentColumnIndex >= 0 && _desiredCurrentColumnIndex < this.ColumnsItemsInternal.Count)
{
columnIndex = _desiredCurrentColumnIndex;
}
SetAndSelectCurrentCell(
columnIndex,
slot,
false /*forceCurrentCellSelection*/);
this.AnchorSlot = slot;
_makeFirstDisplayedCellCurrentCellPending = false;
_desiredCurrentColumnIndex = -1;
FlushCurrentCellChanged();
}
private void NoIndicatorStateStoryboard_Completed(object sender, object e)
{
DiagnosticsDebug.Assert(_hasNoIndicatorStateStoryboardCompletedHandler, "Expected _hasNoIndicatorStateStoryboardCompletedHandler is true.");
_showingMouseIndicators = false;
}
private void PopulateCellContent(
bool isCellEdited,
DataGridColumn dataGridColumn,
DataGridRow dataGridRow,
DataGridCell dataGridCell)
{
DiagnosticsDebug.Assert(dataGridColumn != null, "Expected non-null dataGridColumn.");
DiagnosticsDebug.Assert(dataGridRow != null, "Expected non-null dataGridRow.");
DiagnosticsDebug.Assert(dataGridCell != null, "Expected non-null dataGridCell.");
FrameworkElement element = null;
DataGridBoundColumn dataGridBoundColumn = dataGridColumn as DataGridBoundColumn;
if (isCellEdited)
{
// Generate EditingElement and apply column style if available
element = dataGridColumn.GenerateEditingElementInternal(dataGridCell, dataGridRow.DataContext);
if (element != null)
{
if (dataGridBoundColumn != null && dataGridBoundColumn.EditingElementStyle != null)
{
element.SetStyleWithType(dataGridBoundColumn.EditingElementStyle);
}
// Subscribe to the new element's events
element.Loaded += new RoutedEventHandler(EditingElement_Loaded);
}
}
else
{
// Generate Element and apply column style if available
element = dataGridColumn.GenerateElementInternal(dataGridCell, dataGridRow.DataContext);
if (element != null)
{
if (dataGridBoundColumn != null && dataGridBoundColumn.ElementStyle != null)
{
element.SetStyleWithType(dataGridBoundColumn.ElementStyle);
}
}
#if FEATURE_VALIDATION
// If we are replacing the editingElement on the cell with the displayElement, and there
// were validation errors present on the editingElement, we need to manually force the
// control to go to the InvalidUnfocused state to support Implicit Styles. The reason
// is because the editingElement is being removed as part of a keystroke, and it will
// leave the visual tree before its state is updated. Since Implicit Styles are
// disabled when an element is removed from the visual tree, the subsequent GoToState fails
// and the editingElement cannot make it to the InvalidUnfocused state. As a result,
// any popups in the InvalidFocused state would stay around incorrectly.
if (this.EditingRow != null && dataGridCell.Content != null)
{
Control control = dataGridCell.Content as Control;
if (control != null && Validation.GetHasError(control))
{
VisualStateManager.GoToState(control, VisualStates.StateInvalidUnfocused, useTransitions: false);
}
}
#endif
}
dataGridCell.Content = element;
}
private void PreparingCellForEditPrivate(FrameworkElement editingElement)
{
if (_editingColumnIndex == -1 ||
this.CurrentColumnIndex == -1 ||
this.EditingRow.Cells[this.CurrentColumnIndex].Content != editingElement)
{
// The current cell has changed since the call to BeginCellEdit, so the fact
// that this element has loaded is no longer relevant
return;
}
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
DiagnosticsDebug.Assert(this.EditingRow.Slot == this.CurrentSlot, "Expected EditingRow.Slot equals CurrentSlot.");
DiagnosticsDebug.Assert(_editingColumnIndex >= 0, "Expected positive _editingColumnIndex.");
DiagnosticsDebug.Assert(_editingColumnIndex < this.ColumnsItemsInternal.Count, "Expected _editingColumnIndex smaller than this.ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(_editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals CurrentColumnIndex.");
FocusEditingCell(this.ContainsFocus || _focusEditingControl /*setFocus*/);
// Prepare the cell for editing and raise the PreparingCellForEdit event for all columns
DataGridColumn dataGridColumn = this.CurrentColumn;
_uneditedValue = dataGridColumn.PrepareCellForEditInternal(editingElement, _editingEventArgs);
OnPreparingCellForEdit(new DataGridPreparingCellForEditEventArgs(dataGridColumn, this.EditingRow, _editingEventArgs, editingElement));
}
private bool ProcessAKey()
{
bool ctrl, shift, alt;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift, out alt);
if (ctrl && !shift && !alt && this.SelectionMode == DataGridSelectionMode.Extended)
{
SelectAll();
return true;
}
return false;
}
/// <summary>
/// Handles the case where a 'Copy' key ('C' or 'Insert') has been pressed. If pressed in combination with
/// the control key, and the necessary prerequisites are met, the DataGrid will copy its contents
/// to the Clipboard as text.
/// </summary>
/// <returns>Whether or not the DataGrid handled the key press.</returns>
private bool ProcessCopyKey()
{
bool ctrl, shift, alt;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift, out alt);
if (ctrl &&
!shift &&
!alt &&
this.ClipboardCopyMode != DataGridClipboardCopyMode.None &&
this.SelectedItems.Count > 0 &&
_editingColumnIndex != this.CurrentColumnIndex)
{
StringBuilder textBuilder = new StringBuilder();
if (this.ClipboardCopyMode == DataGridClipboardCopyMode.IncludeHeader)
{
DataGridRowClipboardEventArgs headerArgs = new DataGridRowClipboardEventArgs(null, true);
foreach (DataGridColumn column in this.ColumnsInternal.GetVisibleColumns())
{
headerArgs.ClipboardRowContent.Add(new DataGridClipboardCellContent(null, column, column.Header));
}
this.OnCopyingRowClipboardContent(headerArgs);
textBuilder.Append(FormatClipboardContent(headerArgs));
}
for (int index = 0; index < this.SelectedItems.Count; index++)
{
object item = this.SelectedItems[index];
DataGridRowClipboardEventArgs itemArgs = new DataGridRowClipboardEventArgs(item, false);
foreach (DataGridColumn column in this.ColumnsInternal.GetVisibleColumns())
{
object content = column.GetCellValue(item, column.ClipboardContentBinding);
itemArgs.ClipboardRowContent.Add(new DataGridClipboardCellContent(item, column, content));
}
this.OnCopyingRowClipboardContent(itemArgs);
textBuilder.Append(FormatClipboardContent(itemArgs));
}
string text = textBuilder.ToString();
if (!string.IsNullOrEmpty(text))
{
try
{
DataPackage content = new DataPackage();
content.SetText(text);
Clipboard.SetContent(content);
}
catch (SecurityException)
{
// We will get a SecurityException if the user does not allow access to the clipboard.
}
return true;
}
}
return false;
}
private bool ProcessDataGridKey(KeyRoutedEventArgs e)
{
bool focusDataGrid = false;
switch (e.Key)
{
case VirtualKey.Tab:
return ProcessTabKey(e);
case VirtualKey.Up:
focusDataGrid = ProcessUpKey();
break;
case VirtualKey.Down:
focusDataGrid = ProcessDownKey();
break;
case VirtualKey.PageDown:
focusDataGrid = ProcessNextKey();
break;
case VirtualKey.PageUp:
focusDataGrid = ProcessPriorKey();
break;
case VirtualKey.Left:
focusDataGrid = this.FlowDirection == FlowDirection.LeftToRight ? ProcessLeftKey() : ProcessRightKey();
break;
case VirtualKey.Right:
focusDataGrid = this.FlowDirection == FlowDirection.LeftToRight ? ProcessRightKey() : ProcessLeftKey();
break;
case VirtualKey.F2:
return ProcessF2Key(e);
case VirtualKey.Home:
focusDataGrid = ProcessHomeKey();
break;
case VirtualKey.End:
focusDataGrid = ProcessEndKey();
break;
case VirtualKey.Enter:
focusDataGrid = ProcessEnterKey();
break;
case VirtualKey.Escape:
return ProcessEscapeKey();
case VirtualKey.A:
return ProcessAKey();
case VirtualKey.C:
return ProcessCopyKey();
case VirtualKey.Insert:
return ProcessCopyKey();
case VirtualKey.Space:
return ProcessSpaceKey();
}
if (focusDataGrid && this.IsTabStop)
{
this.Focus(FocusState.Programmatic);
}
return focusDataGrid;
}
private bool ProcessDownKeyInternal(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.FirstVisibleColumn;
int firstVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
int lastSlot = this.LastVisibleSlot;
if (firstVisibleColumnIndex == -1 || lastSlot == -1)
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessDownKeyInternal(shift, ctrl); }))
{
return true;
}
int nextSlot = -1;
if (this.CurrentSlot != -1)
{
nextSlot = this.GetNextVisibleSlot(this.CurrentSlot);
if (nextSlot >= this.SlotCount)
{
nextSlot = -1;
}
}
_noSelectionChangeCount++;
try
{
int desiredSlot;
int columnIndex;
DataGridSelectionAction action;
if (this.ColumnHeaderHasFocus)
{
if (ctrl || shift)
{
return false;
}
if (this.CurrentSlot == this.FirstVisibleSlot)
{
this.ColumnHeaderHasFocus = false;
return true;
}
DiagnosticsDebug.Assert(this.CurrentColumnIndex != -1, "Expected CurrentColumnIndex other than -1.");
desiredSlot = this.FirstVisibleSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
else if (this.CurrentColumnIndex == -1)
{
desiredSlot = this.FirstVisibleSlot;
columnIndex = firstVisibleColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
else if (ctrl)
{
if (shift)
{
// Both Ctrl and Shift
desiredSlot = lastSlot;
columnIndex = this.CurrentColumnIndex;
action = (this.SelectionMode == DataGridSelectionMode.Extended)
? DataGridSelectionAction.SelectFromAnchorToCurrent
: DataGridSelectionAction.SelectCurrent;
}
else
{
// Ctrl without Shift
desiredSlot = lastSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
}
else
{
if (nextSlot == -1)
{
return true;
}
if (shift)
{
// Shift without Ctrl
desiredSlot = nextSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectFromAnchorToCurrent;
}
else
{
// Neither Ctrl nor Shift
desiredSlot = nextSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
}
UpdateSelectionAndCurrency(columnIndex, desiredSlot, action, true /*scrollIntoView*/);
}
finally
{
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
private bool ProcessEndKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.LastVisibleColumn;
int lastVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
int firstVisibleSlot = this.FirstVisibleSlot;
int lastVisibleSlot = this.LastVisibleSlot;
if (lastVisibleColumnIndex == -1 || (firstVisibleSlot == -1 && !this.ColumnHeaderHasFocus))
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessEndKey(shift, ctrl); }))
{
return true;
}
_noSelectionChangeCount++;
try
{
if (!ctrl)
{
return ProcessRightMost(lastVisibleColumnIndex, firstVisibleSlot);
}
else if (firstVisibleSlot != -1)
{
DataGridSelectionAction action = (shift && this.SelectionMode == DataGridSelectionMode.Extended)
? DataGridSelectionAction.SelectFromAnchorToCurrent
: DataGridSelectionAction.SelectCurrent;
UpdateSelectionAndCurrency(lastVisibleColumnIndex, lastVisibleSlot, action, true /*scrollIntoView*/);
}
}
finally
{
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
private bool ProcessEnterKey(bool shift, bool ctrl)
{
int oldCurrentSlot = this.CurrentSlot;
if (!ctrl)
{
if (this.ColumnHeaderHasFocus)
{
this.CurrentColumn.HeaderCell.InvokeProcessSort();
return true;
}
else if (this.FirstVisibleSlot != -1 && this.RowGroupHeadersTable.Contains(this.CurrentSlot) && ToggleRowGroup())
{
return true;
}
// If Enter was used by a TextBox, we shouldn't handle the key
TextBox focusedTextBox = GetFocusedElement() as TextBox;
if (focusedTextBox != null && focusedTextBox.AcceptsReturn)
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessEnterKey(shift, ctrl); }))
{
return true;
}
// Enter behaves like down arrow - it commits the potential editing and goes down one cell.
if (!ProcessDownKeyInternal(false, ctrl))
{
return false;
}
}
else if (this.WaitForLostFocus(() => { this.ProcessEnterKey(shift, ctrl); }))
{
return true;
}
// Try to commit the potential editing
if (oldCurrentSlot == this.CurrentSlot && EndCellEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, true /*keepFocus*/, true /*raiseEvents*/) && this.EditingRow != null)
{
EndRowEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, true /*raiseEvents*/);
ScrollIntoView(this.CurrentItem, this.CurrentColumn);
}
return true;
}
private bool ProcessEscapeKey()
{
if (this.WaitForLostFocus(() => { this.ProcessEscapeKey(); }))
{
return true;
}
if (_editingColumnIndex != -1)
{
// Revert the potential cell editing and exit cell editing.
EndCellEdit(DataGridEditAction.Cancel, true /*exitEditingMode*/, true /*keepFocus*/, true /*raiseEvents*/);
return true;
}
else if (this.EditingRow != null)
{
// Revert the potential row editing and exit row editing.
EndRowEdit(DataGridEditAction.Cancel, true /*exitEditingMode*/, true /*raiseEvents*/);
return true;
}
return false;
}
private bool ProcessF2Key(KeyRoutedEventArgs e)
{
bool ctrl, shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
if (!shift && !ctrl &&
_editingColumnIndex == -1 && this.CurrentColumnIndex != -1 && GetRowSelection(this.CurrentSlot) &&
!GetColumnEffectiveReadOnlyState(this.CurrentColumn))
{
if (ScrollSlotIntoView(this.CurrentColumnIndex, this.CurrentSlot, false /*forCurrentCellChange*/, true /*forceHorizontalScroll*/))
{
BeginCellEdit(e);
}
return true;
}
return false;
}
private bool ProcessHomeKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.FirstVisibleNonFillerColumn;
int firstVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
int firstVisibleSlot = this.FirstVisibleSlot;
if (firstVisibleColumnIndex == -1 || (firstVisibleSlot == -1 && !this.ColumnHeaderHasFocus))
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessHomeKey(shift, ctrl); }))
{
return true;
}
_noSelectionChangeCount++;
try
{
if (!ctrl)
{
return ProcessLeftMost(firstVisibleColumnIndex, firstVisibleSlot);
}
else if (firstVisibleSlot != -1)
{
DataGridSelectionAction action = (shift && this.SelectionMode == DataGridSelectionMode.Extended)
? DataGridSelectionAction.SelectFromAnchorToCurrent
: DataGridSelectionAction.SelectCurrent;
UpdateSelectionAndCurrency(firstVisibleColumnIndex, firstVisibleSlot, action, true /*scrollIntoView*/);
}
}
finally
{
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
private bool ProcessLeftKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.FirstVisibleNonFillerColumn;
int firstVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
int firstVisibleSlot = this.FirstVisibleSlot;
if (firstVisibleColumnIndex == -1 || (firstVisibleSlot == -1 && !this.ColumnHeaderHasFocus))
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessLeftKey(shift, ctrl); }))
{
return true;
}
int previousVisibleColumnIndex = -1;
if (this.CurrentColumnIndex != -1)
{
dataGridColumn = this.ColumnsInternal.GetPreviousVisibleNonFillerColumn(this.ColumnsItemsInternal[this.CurrentColumnIndex]);
if (dataGridColumn != null)
{
previousVisibleColumnIndex = dataGridColumn.Index;
}
}
DataGridColumn oldFocusedColumn = this.FocusedColumn;
_noSelectionChangeCount++;
try
{
if (ctrl)
{
return ProcessLeftMost(firstVisibleColumnIndex, firstVisibleSlot);
}
else if (firstVisibleSlot != -1 && (!this.RowGroupHeadersTable.Contains(this.CurrentSlot) || this.ColumnHeaderHasFocus))
{
if (this.CurrentColumnIndex == -1)
{
UpdateSelectionAndCurrency(firstVisibleColumnIndex, firstVisibleSlot, DataGridSelectionAction.SelectCurrent, true /*scrollIntoView*/);
}
else
{
if (previousVisibleColumnIndex == -1)
{
return true;
}
_noFocusedColumnChangeCount++;
try
{
UpdateSelectionAndCurrency(previousVisibleColumnIndex, this.CurrentSlot, DataGridSelectionAction.None, true /*scrollIntoView*/);
}
finally
{
_noFocusedColumnChangeCount--;
}
}
}
}
finally
{
this.NoSelectionChangeCount--;
}
if (this.ColumnHeaderHasFocus)
{
if (this.CurrentColumn == null)
{
dataGridColumn = this.ColumnsInternal.GetPreviousVisibleNonFillerColumn(this.FocusedColumn);
if (dataGridColumn != null)
{
this.FocusedColumn = dataGridColumn;
}
}
else
{
this.FocusedColumn = this.CurrentColumn;
}
if (firstVisibleSlot == -1 && this.FocusedColumn != null)
{
ScrollColumnIntoView(this.FocusedColumn.Index);
}
}
bool focusedColumnChanged = this.ColumnHeaderHasFocus && oldFocusedColumn != this.FocusedColumn;
if (focusedColumnChanged)
{
if (oldFocusedColumn != null && oldFocusedColumn.HasHeaderCell)
{
oldFocusedColumn.HeaderCell.ApplyState(true);
}
if (this.FocusedColumn != null && this.FocusedColumn.HasHeaderCell)
{
this.FocusedColumn.HeaderCell.ApplyState(true);
}
}
return focusedColumnChanged || _successfullyUpdatedSelection;
}
// Ctrl Left <==> Home
private bool ProcessLeftMost(int firstVisibleColumnIndex, int firstVisibleSlot)
{
DataGridColumn oldFocusedColumn = this.FocusedColumn;
_noSelectionChangeCount++;
try
{
int desiredSlot;
DataGridSelectionAction action;
if (this.CurrentColumnIndex == -1)
{
desiredSlot = firstVisibleSlot;
action = DataGridSelectionAction.SelectCurrent;
DiagnosticsDebug.Assert(_selectedItems.Count == 0, "Expected _selectedItems.Count equals 0.");
}
else
{
desiredSlot = this.CurrentSlot;
action = DataGridSelectionAction.None;
}
_noFocusedColumnChangeCount++;
try
{
UpdateSelectionAndCurrency(firstVisibleColumnIndex, desiredSlot, action, true /*scrollIntoView*/);
}
finally
{
_noFocusedColumnChangeCount--;
}
}
finally
{
this.NoSelectionChangeCount--;
}
if (this.ColumnHeaderHasFocus)
{
if (this.CurrentColumn == null)
{
this.FocusedColumn = this.ColumnsInternal.FirstVisibleColumn;
}
else
{
this.FocusedColumn = this.CurrentColumn;
}
if (firstVisibleSlot == -1 && this.FocusedColumn != null)
{
ScrollColumnIntoView(this.FocusedColumn.Index);
}
}
bool focusedColumnChanged = this.ColumnHeaderHasFocus && oldFocusedColumn != this.FocusedColumn;
if (focusedColumnChanged)
{
if (oldFocusedColumn != null && oldFocusedColumn.HasHeaderCell)
{
oldFocusedColumn.HeaderCell.ApplyState(true);
}
if (this.FocusedColumn != null && this.FocusedColumn.HasHeaderCell)
{
this.FocusedColumn.HeaderCell.ApplyState(true);
}
}
return focusedColumnChanged || _successfullyUpdatedSelection;
}
private bool ProcessNextKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.FirstVisibleNonFillerColumn;
int firstVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
if (firstVisibleColumnIndex == -1 || this.DisplayData.FirstScrollingSlot == -1)
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessNextKey(shift, ctrl); }))
{
return true;
}
int nextPageSlot = this.CurrentSlot == -1 ? this.DisplayData.FirstScrollingSlot : this.CurrentSlot;
DiagnosticsDebug.Assert(nextPageSlot != -1, "Expected nextPageSlot other than -1.");
int slot = GetNextVisibleSlot(nextPageSlot);
int scrollCount = this.DisplayData.NumTotallyDisplayedScrollingElements;
while (scrollCount > 0 && slot < this.SlotCount)
{
nextPageSlot = slot;
scrollCount--;
slot = GetNextVisibleSlot(slot);
}
_noSelectionChangeCount++;
try
{
DataGridSelectionAction action;
int columnIndex;
if (this.CurrentColumnIndex == -1)
{
columnIndex = firstVisibleColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
else
{
columnIndex = this.CurrentColumnIndex;
action = (shift && this.SelectionMode == DataGridSelectionMode.Extended)
? action = DataGridSelectionAction.SelectFromAnchorToCurrent
: action = DataGridSelectionAction.SelectCurrent;
}
UpdateSelectionAndCurrency(columnIndex, nextPageSlot, action, true /*scrollIntoView*/);
}
finally
{
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
private bool ProcessPriorKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.FirstVisibleNonFillerColumn;
int firstVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
if (firstVisibleColumnIndex == -1 || this.DisplayData.FirstScrollingSlot == -1)
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessPriorKey(shift, ctrl); }))
{
return true;
}
int previousPageSlot = (this.CurrentSlot == -1) ? this.DisplayData.FirstScrollingSlot : this.CurrentSlot;
DiagnosticsDebug.Assert(previousPageSlot != -1, "Expected previousPageSlot other than -1.");
int scrollCount = this.DisplayData.NumTotallyDisplayedScrollingElements;
int slot = GetPreviousVisibleSlot(previousPageSlot);
while (scrollCount > 0 && slot != -1)
{
previousPageSlot = slot;
scrollCount--;
slot = GetPreviousVisibleSlot(slot);
}
DiagnosticsDebug.Assert(previousPageSlot != -1, "Expected previousPageSlot other than -1.");
_noSelectionChangeCount++;
try
{
int columnIndex;
DataGridSelectionAction action;
if (this.CurrentColumnIndex == -1)
{
columnIndex = firstVisibleColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
else
{
columnIndex = this.CurrentColumnIndex;
action = (shift && this.SelectionMode == DataGridSelectionMode.Extended)
? DataGridSelectionAction.SelectFromAnchorToCurrent
: DataGridSelectionAction.SelectCurrent;
}
UpdateSelectionAndCurrency(columnIndex, previousPageSlot, action, true /*scrollIntoView*/);
}
finally
{
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
private bool ProcessRightKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.LastVisibleColumn;
int lastVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
int firstVisibleSlot = this.FirstVisibleSlot;
if (lastVisibleColumnIndex == -1 || (firstVisibleSlot == -1 && !this.ColumnHeaderHasFocus))
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessRightKey(shift, ctrl); }))
{
return true;
}
int nextVisibleColumnIndex = -1;
if (this.CurrentColumnIndex != -1)
{
dataGridColumn = this.ColumnsInternal.GetNextVisibleColumn(this.ColumnsItemsInternal[this.CurrentColumnIndex]);
if (dataGridColumn != null)
{
nextVisibleColumnIndex = dataGridColumn.Index;
}
}
DataGridColumn oldFocusedColumn = this.FocusedColumn;
_noSelectionChangeCount++;
try
{
if (ctrl)
{
return ProcessRightMost(lastVisibleColumnIndex, firstVisibleSlot);
}
else if (firstVisibleSlot != -1 && (!this.RowGroupHeadersTable.Contains(this.CurrentSlot) || this.ColumnHeaderHasFocus))
{
if (this.CurrentColumnIndex == -1)
{
int firstVisibleColumnIndex = this.ColumnsInternal.FirstVisibleColumn == null ? -1 : this.ColumnsInternal.FirstVisibleColumn.Index;
UpdateSelectionAndCurrency(firstVisibleColumnIndex, firstVisibleSlot, DataGridSelectionAction.SelectCurrent, true /*scrollIntoView*/);
}
else
{
if (nextVisibleColumnIndex == -1)
{
return true;
}
_noFocusedColumnChangeCount++;
try
{
UpdateSelectionAndCurrency(nextVisibleColumnIndex, this.CurrentSlot, DataGridSelectionAction.None, true /*scrollIntoView*/);
}
finally
{
_noFocusedColumnChangeCount--;
}
}
}
}
finally
{
this.NoSelectionChangeCount--;
}
if (this.ColumnHeaderHasFocus)
{
if (this.CurrentColumn == null)
{
dataGridColumn = this.ColumnsInternal.GetNextVisibleColumn(this.FocusedColumn);
if (dataGridColumn != null)
{
this.FocusedColumn = dataGridColumn;
}
}
else
{
this.FocusedColumn = this.CurrentColumn;
}
if (firstVisibleSlot == -1 && this.FocusedColumn != null)
{
ScrollColumnIntoView(this.FocusedColumn.Index);
}
}
bool focusedColumnChanged = this.ColumnHeaderHasFocus && oldFocusedColumn != this.FocusedColumn;
if (focusedColumnChanged)
{
if (oldFocusedColumn != null && oldFocusedColumn.HasHeaderCell)
{
oldFocusedColumn.HeaderCell.ApplyState(true);
}
if (this.FocusedColumn != null && this.FocusedColumn.HasHeaderCell)
{
this.FocusedColumn.HeaderCell.ApplyState(true);
}
}
return focusedColumnChanged || _successfullyUpdatedSelection;
}
// Ctrl Right <==> End
private bool ProcessRightMost(int lastVisibleColumnIndex, int firstVisibleSlot)
{
DataGridColumn oldFocusedColumn = this.FocusedColumn;
_noSelectionChangeCount++;
try
{
int desiredSlot;
DataGridSelectionAction action;
if (this.CurrentColumnIndex == -1)
{
desiredSlot = firstVisibleSlot;
action = DataGridSelectionAction.SelectCurrent;
}
else
{
desiredSlot = this.CurrentSlot;
action = DataGridSelectionAction.None;
}
_noFocusedColumnChangeCount++;
try
{
UpdateSelectionAndCurrency(lastVisibleColumnIndex, desiredSlot, action, true /*scrollIntoView*/);
}
finally
{
_noFocusedColumnChangeCount--;
}
}
finally
{
this.NoSelectionChangeCount--;
}
if (this.ColumnHeaderHasFocus)
{
if (this.CurrentColumn == null)
{
this.FocusedColumn = this.ColumnsInternal.LastVisibleColumn;
}
else
{
this.FocusedColumn = this.CurrentColumn;
}
if (firstVisibleSlot == -1 && this.FocusedColumn != null)
{
ScrollColumnIntoView(this.FocusedColumn.Index);
}
}
bool focusedColumnChanged = this.ColumnHeaderHasFocus && oldFocusedColumn != this.FocusedColumn;
if (focusedColumnChanged)
{
if (oldFocusedColumn != null && oldFocusedColumn.HasHeaderCell)
{
oldFocusedColumn.HeaderCell.ApplyState(true);
}
if (this.FocusedColumn != null && this.FocusedColumn.HasHeaderCell)
{
this.FocusedColumn.HeaderCell.ApplyState(true);
}
}
return focusedColumnChanged || _successfullyUpdatedSelection;
}
private bool ProcessSpaceKey()
{
return ToggleRowGroup();
}
private bool ProcessTabKey(KeyRoutedEventArgs e)
{
bool ctrl, shift;
KeyboardHelper.GetMetaKeyState(out ctrl, out shift);
return this.ProcessTabKey(e, shift, ctrl);
}
private bool ProcessTabKey(KeyRoutedEventArgs e, bool shift, bool ctrl)
{
if (ctrl || _editingColumnIndex == -1 || this.IsReadOnly)
{
// Go to the next/previous control on the page or the column header when
// - Ctrl key is used
// - Potential current cell is not edited, or the datagrid is read-only.
if (!shift && this.ColumnHeaders != null && this.AreColumnHeadersVisible && !this.ColumnHeaderHasFocus)
{
// Show focus on the current column's header.
this.ColumnHeaderHasFocus = true;
return true;
}
else if (shift && this.ColumnHeaderHasFocus)
{
this.ColumnHeaderHasFocus = false;
return this.CurrentColumnIndex != -1;
}
this.ColumnHeaderHasFocus = false;
return false;
}
// Try to locate a writable cell before/after the current cell
DiagnosticsDebug.Assert(this.CurrentColumnIndex != -1, "Expected CurrentColumnIndex other than -1.");
DiagnosticsDebug.Assert(this.CurrentSlot != -1, "Expected CurrentSlot other than -1.");
int neighborVisibleWritableColumnIndex, neighborSlot;
DataGridColumn dataGridColumn;
if (shift)
{
dataGridColumn = this.ColumnsInternal.GetPreviousVisibleWritableColumn(this.ColumnsItemsInternal[this.CurrentColumnIndex]);
neighborSlot = GetPreviousVisibleSlot(this.CurrentSlot);
if (this.EditingRow != null)
{
while (neighborSlot != -1 && this.RowGroupHeadersTable.Contains(neighborSlot))
{
neighborSlot = GetPreviousVisibleSlot(neighborSlot);
}
}
}
else
{
dataGridColumn = this.ColumnsInternal.GetNextVisibleWritableColumn(this.ColumnsItemsInternal[this.CurrentColumnIndex]);
neighborSlot = GetNextVisibleSlot(this.CurrentSlot);
if (this.EditingRow != null)
{
while (neighborSlot < this.SlotCount && this.RowGroupHeadersTable.Contains(neighborSlot))
{
neighborSlot = GetNextVisibleSlot(neighborSlot);
}
}
}
neighborVisibleWritableColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
if (neighborVisibleWritableColumnIndex == -1 && (neighborSlot == -1 || neighborSlot >= this.SlotCount))
{
// There is no previous/next row and no previous/next writable cell on the current row
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessTabKey(e, shift, ctrl); }))
{
return true;
}
int targetSlot = -1, targetColumnIndex = -1;
_noSelectionChangeCount++;
try
{
if (neighborVisibleWritableColumnIndex == -1)
{
targetSlot = neighborSlot;
if (shift)
{
DiagnosticsDebug.Assert(this.ColumnsInternal.LastVisibleWritableColumn != null, "Expected non-null ColumnsInternal.LastVisibleWritableColumn.");
targetColumnIndex = this.ColumnsInternal.LastVisibleWritableColumn.Index;
}
else
{
DiagnosticsDebug.Assert(this.ColumnsInternal.FirstVisibleWritableColumn != null, "Expected non-null ColumnsInternal.FirstVisibleWritableColumn.");
targetColumnIndex = this.ColumnsInternal.FirstVisibleWritableColumn.Index;
}
}
else
{
targetSlot = this.CurrentSlot;
targetColumnIndex = neighborVisibleWritableColumnIndex;
}
DataGridSelectionAction action;
if (targetSlot != this.CurrentSlot || (this.SelectionMode == DataGridSelectionMode.Extended))
{
if (IsSlotOutOfBounds(targetSlot))
{
return true;
}
action = DataGridSelectionAction.SelectCurrent;
}
else
{
action = DataGridSelectionAction.None;
}
UpdateSelectionAndCurrency(targetColumnIndex, targetSlot, action, true /*scrollIntoView*/);
}
finally
{
this.NoSelectionChangeCount--;
}
if (_successfullyUpdatedSelection && !this.RowGroupHeadersTable.Contains(targetSlot))
{
BeginCellEdit(e);
}
// Return true to say we handled the key event even if the operation was unsuccessful. If we don't
// say we handled this event, the framework will continue to process the tab key and change focus.
return true;
}
private bool ProcessUpKey(bool shift, bool ctrl)
{
DataGridColumn dataGridColumn = this.ColumnsInternal.FirstVisibleNonFillerColumn;
int firstVisibleColumnIndex = (dataGridColumn == null) ? -1 : dataGridColumn.Index;
int firstVisibleSlot = this.FirstVisibleSlot;
if (firstVisibleColumnIndex == -1 || firstVisibleSlot == -1)
{
return false;
}
if (this.WaitForLostFocus(() => { this.ProcessUpKey(shift, ctrl); }))
{
return true;
}
int previousVisibleSlot = (this.CurrentSlot != -1) ? GetPreviousVisibleSlot(this.CurrentSlot) : -1;
_noSelectionChangeCount++;
try
{
int slot;
int columnIndex;
DataGridSelectionAction action;
if (this.CurrentColumnIndex == -1)
{
slot = firstVisibleSlot;
columnIndex = firstVisibleColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
else if (ctrl)
{
if (shift)
{
// Both Ctrl and Shift
slot = firstVisibleSlot;
columnIndex = this.CurrentColumnIndex;
action = (this.SelectionMode == DataGridSelectionMode.Extended)
? DataGridSelectionAction.SelectFromAnchorToCurrent
: DataGridSelectionAction.SelectCurrent;
}
else
{
// Ctrl without Shift
slot = firstVisibleSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
}
else
{
if (previousVisibleSlot == -1)
{
return true;
}
if (shift)
{
// Shift without Ctrl
slot = previousVisibleSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectFromAnchorToCurrent;
}
else
{
// Neither Shift nor Ctrl
slot = previousVisibleSlot;
columnIndex = this.CurrentColumnIndex;
action = DataGridSelectionAction.SelectCurrent;
}
}
UpdateSelectionAndCurrency(columnIndex, slot, action, true /*scrollIntoView*/);
}
finally
{
this.NoSelectionChangeCount--;
}
return _successfullyUpdatedSelection;
}
private void RemoveDisplayedColumnHeader(DataGridColumn dataGridColumn)
{
if (_columnHeadersPresenter != null)
{
_columnHeadersPresenter.Children.Remove(dataGridColumn.HeaderCell);
}
}
private void RemoveDisplayedColumnHeaders()
{
if (_columnHeadersPresenter != null)
{
_columnHeadersPresenter.Children.Clear();
}
this.ColumnsInternal.FillerColumn.IsRepresented = false;
}
private bool ResetCurrentCellCore()
{
return this.CurrentColumnIndex == -1 || SetCurrentCellCore(-1, -1);
}
private void ResetEditingRow()
{
DataGridRow oldEditingRow = this.EditingRow;
if (oldEditingRow != null &&
oldEditingRow != _focusedRow &&
!IsSlotVisible(oldEditingRow.Slot))
{
// Unload the old editing row if it's off screen
oldEditingRow.Clip = null;
UnloadRow(oldEditingRow);
this.DisplayData.FullyRecycleElements();
}
this.EditingRow = null;
if (oldEditingRow != null && IsSlotVisible(oldEditingRow.Slot))
{
// If the row is no longer editing, then its visuals need to change.
oldEditingRow.ApplyState(true /*animate*/);
}
}
private void ResetFocusedRow()
{
if (_focusedRow != null &&
_focusedRow != this.EditingRow &&
!IsSlotVisible(_focusedRow.Slot))
{
// Unload the old focused row if it's off screen
_focusedRow.Clip = null;
UnloadRow(_focusedRow);
this.DisplayData.FullyRecycleElements();
}
_focusedRow = null;
}
private void ResetValidationStatus()
{
// Clear the invalid status of the Cell, Row and DataGrid
if (this.EditingRow != null)
{
this.EditingRow.IsValid = true;
if (this.EditingRow.Index != -1)
{
foreach (DataGridCell cell in this.EditingRow.Cells)
{
if (!cell.IsValid)
{
cell.IsValid = true;
cell.ApplyCellState(true);
}
}
this.EditingRow.ApplyState(true);
}
}
this.IsValid = true;
// Clear the previous validation results
_validationResults.Clear();
#if FEATURE_VALIDATION_SUMMARY
// Hide the error list if validation succeeded
if (_validationSummary != null && _validationSummary.Errors.Count > 0)
{
_validationSummary.Errors.Clear();
if (this.EditingRow != null)
{
int editingRowSlot = this.EditingRow.Slot;
InvalidateMeasure();
// TODO: Move to DispatcherQueue when FEATURE_VALIDATION_SUMMARY is enabled
this.Dispatcher.BeginInvoke(() =>
{
// It's possible that the DataContext or ItemsSource has changed by the time we reach this code,
// so we need to ensure that the editing row still exists before scrolling it into view
if (!IsSlotOutOfBounds(editingRowSlot) && editingRowSlot != -1)
{
ScrollSlotIntoView(editingRowSlot, false /*scrolledHorizontally*/);
}
});
}
}
#endif
}
private void RowGroupHeaderStyles_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (_rowsPresenter != null)
{
Style oldLastStyle = _rowGroupHeaderStylesOld.Count > 0 ? _rowGroupHeaderStylesOld[_rowGroupHeaderStylesOld.Count - 1] : null;
while (_rowGroupHeaderStylesOld.Count < _rowGroupHeaderStyles.Count)
{
_rowGroupHeaderStylesOld.Add(oldLastStyle);
}
Style lastStyle = _rowGroupHeaderStyles.Count > 0 ? _rowGroupHeaderStyles[_rowGroupHeaderStyles.Count - 1] : null;
foreach (UIElement element in _rowsPresenter.Children)
{
DataGridRowGroupHeader groupHeader = element as DataGridRowGroupHeader;
if (groupHeader != null)
{
Style oldStyle = groupHeader.Level < _rowGroupHeaderStylesOld.Count ? _rowGroupHeaderStylesOld[groupHeader.Level] : oldLastStyle;
Style newStyle = groupHeader.Level < _rowGroupHeaderStyles.Count ? _rowGroupHeaderStyles[groupHeader.Level] : lastStyle;
EnsureElementStyle(groupHeader, oldStyle, newStyle);
}
}
}
_rowGroupHeaderStylesOld.Clear();
foreach (Style style in _rowGroupHeaderStyles)
{
_rowGroupHeaderStylesOld.Add(style);
}
}
private void SelectAll()
{
SetRowsSelection(0, this.SlotCount - 1);
}
private void SetAndSelectCurrentCell(
int columnIndex,
int slot,
bool forceCurrentCellSelection)
{
DataGridSelectionAction action = forceCurrentCellSelection ? DataGridSelectionAction.SelectCurrent : DataGridSelectionAction.None;
UpdateSelectionAndCurrency(columnIndex, slot, action, false /*scrollIntoView*/);
}
// columnIndex = 2, rowIndex = -1 --> current cell belongs to the 'new row'.
// columnIndex = 2, rowIndex = 2 --> current cell is an inner cell
// columnIndex = -1, rowIndex = -1 --> current cell is reset
// columnIndex = -1, rowIndex = 2 --> Unexpected
private bool SetCurrentCellCore(int columnIndex, int slot, bool commitEdit, bool endRowEdit)
{
DiagnosticsDebug.Assert(columnIndex < this.ColumnsItemsInternal.Count, "Expected columnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(slot < this.SlotCount, "Expected slot smaller than this.SlotCount.");
DiagnosticsDebug.Assert(columnIndex == -1 || this.ColumnsItemsInternal[columnIndex].IsVisible, "Expected columnIndex equals -1 or ColumnsItemsInternal[columnIndex].IsVisible is true.");
DiagnosticsDebug.Assert(columnIndex <= -1 || slot != -1, "Expected columnIndex smaller than or equal to -1 or slot other than -1.");
if (columnIndex == this.CurrentColumnIndex &&
slot == this.CurrentSlot)
{
DiagnosticsDebug.Assert(this.DataConnection != null, "Expected non-null DataConnection.");
DiagnosticsDebug.Assert(_editingColumnIndex == -1 || _editingColumnIndex == this.CurrentColumnIndex, "Expected _editingColumnIndex equals -1 or _editingColumnIndex equals CurrentColumnIndex.");
DiagnosticsDebug.Assert(this.EditingRow == null || this.EditingRow.Slot == this.CurrentSlot || this.DataConnection.EndingEdit, "Expected EditingRow is null or EditingRow.Slot equals CurrentSlot or DataConnection.EndingEdit is true.");
return true;
}
UIElement oldDisplayedElement = null;
DataGridCellCoordinates oldCurrentCell = new DataGridCellCoordinates(this.CurrentCellCoordinates);
object newCurrentItem = null;
if (!this.RowGroupHeadersTable.Contains(slot))
{
int rowIndex = this.RowIndexFromSlot(slot);
if (rowIndex >= 0 && rowIndex < this.DataConnection.Count)
{
newCurrentItem = this.DataConnection.GetDataItem(rowIndex);
}
}
if (this.CurrentColumnIndex > -1)
{
DiagnosticsDebug.Assert(this.CurrentColumnIndex < this.ColumnsItemsInternal.Count, "Expected CurrentColumnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.CurrentSlot < this.SlotCount, "Expected CurrentSlot smaller than SlotCount.");
if (!IsInnerCellOutOfBounds(oldCurrentCell.ColumnIndex, oldCurrentCell.Slot) &&
this.IsSlotVisible(oldCurrentCell.Slot))
{
oldDisplayedElement = this.DisplayData.GetDisplayedElement(oldCurrentCell.Slot);
}
if (!this.RowGroupHeadersTable.Contains(oldCurrentCell.Slot) && !_temporarilyResetCurrentCell)
{
bool keepFocus = this.ContainsFocus;
if (commitEdit)
{
if (!EndCellEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, keepFocus, true /*raiseEvents*/))
{
return false;
}
// Resetting the current cell: setting it to (-1, -1) is not considered setting it out of bounds
if ((columnIndex != -1 && slot != -1 && IsInnerCellOutOfSelectionBounds(columnIndex, slot)) ||
IsInnerCellOutOfSelectionBounds(oldCurrentCell.ColumnIndex, oldCurrentCell.Slot))
{
return false;
}
if (endRowEdit && !EndRowEdit(DataGridEditAction.Commit, true /*exitEditingMode*/, true /*raiseEvents*/))
{
return false;
}
}
else
{
this.CancelEdit(DataGridEditingUnit.Row, false);
ExitEdit(keepFocus);
}
}
}
if (newCurrentItem != null)
{
slot = this.SlotFromRowIndex(this.DataConnection.IndexOf(newCurrentItem));
}
if (slot == -1 && columnIndex != -1)
{
return false;
}
if (_noFocusedColumnChangeCount == 0)
{
this.ColumnHeaderHasFocus = false;
}
this.CurrentColumnIndex = columnIndex;
this.CurrentSlot = slot;
if (_temporarilyResetCurrentCell)
{
if (columnIndex != -1)
{
_temporarilyResetCurrentCell = false;
}
}
if (!_temporarilyResetCurrentCell && _editingColumnIndex != -1)
{
_editingColumnIndex = columnIndex;
}
if (oldDisplayedElement != null)
{
DataGridRow row = oldDisplayedElement as DataGridRow;
if (row != null)
{
// Don't reset the state of the current cell if we're editing it because that would put it in an invalid state
UpdateCurrentState(oldDisplayedElement, oldCurrentCell.ColumnIndex, !(_temporarilyResetCurrentCell && row.IsEditing && _editingColumnIndex == oldCurrentCell.ColumnIndex));
}
else
{
UpdateCurrentState(oldDisplayedElement, oldCurrentCell.ColumnIndex, false /*applyCellState*/);
}
}
if (this.CurrentColumnIndex > -1)
{
DiagnosticsDebug.Assert(this.CurrentSlot > -1, "Expected CurrentSlot greater than -1.");
DiagnosticsDebug.Assert(this.CurrentColumnIndex < this.ColumnsItemsInternal.Count, "Expected CurrentColumnIndex smaller than ColumnsItemsInternal.Count.");
DiagnosticsDebug.Assert(this.CurrentSlot < this.SlotCount, "Expected CurrentSlot smaller than SlotCount.");
if (this.IsSlotVisible(this.CurrentSlot))
{
UpdateCurrentState(this.DisplayData.GetDisplayedElement(this.CurrentSlot), this.CurrentColumnIndex, true /*applyCellState*/);
}
}
return true;
}
private void SetHorizontalOffset(double newHorizontalOffset)
{
if (_hScrollBar != null && _hScrollBar.Value != newHorizontalOffset)
{
_hScrollBar.Value = newHorizontalOffset;
// Unless the control is still loading, show the scroll bars when an offset changes. Keep the existing indicator type.
if (VisualTreeHelper.GetParent(this) != null)
{
ShowScrollBars();
}
}
}
private void SetVerticalOffset(double newVerticalOffset)
{
VerticalOffset = newVerticalOffset;
if (_vScrollBar != null && !DoubleUtil.AreClose(newVerticalOffset, _vScrollBar.Value))
{
_vScrollBar.Value = _verticalOffset;
// Unless the control is still loading, show the scroll bars when an offset changes. Keep the existing indicator type.
if (VisualTreeHelper.GetParent(this) != null)
{
ShowScrollBars();
}
}
}
#if FEATURE_VALIDATION_SUMMARY
/// <summary>
/// Determines whether or not a specific validation result should be displayed in the ValidationSummary.
/// </summary>
/// <param name="validationResult">Validation result to display.</param>
/// <returns>True if it should be added to the ValidationSummary, false otherwise.</returns>
private bool ShouldDisplayValidationResult(ValidationResult validationResult)
{
if (this.EditingRow != null)
{
return !_bindingValidationResults.ContainsEqualValidationResult(validationResult) ||
this.EditingRow.DataContext is IDataErrorInfo || this.EditingRow.DataContext is INotifyDataErrorInfo;
}
return false;
}
#endif
private void ShowScrollBars()
{
if (this.AreAllScrollBarsCollapsed)
{
_proposedScrollBarsState = ScrollBarVisualState.NoIndicator;
_proposedScrollBarsSeparatorState = ScrollBarsSeparatorVisualState.SeparatorCollapsedWithoutAnimation;
SwitchScrollBarsVisualStates(_proposedScrollBarsState, _proposedScrollBarsSeparatorState, false /*useTransitions*/);
}
else
{
if (_hideScrollBarsTimer != null && _hideScrollBarsTimer.IsRunning)
{
_hideScrollBarsTimer.Stop();
_hideScrollBarsTimer.Start();
}
// Mouse indicators dominate if they are already showing or if we have set the flag to prefer them.
if (_preferMouseIndicators || _showingMouseIndicators)
{
if (this.AreBothScrollBarsVisible && (_isPointerOverHorizontalScrollBar || _isPointerOverVerticalScrollBar))
{
_proposedScrollBarsState = ScrollBarVisualState.MouseIndicatorFull;
}
else
{
_proposedScrollBarsState = ScrollBarVisualState.MouseIndicator;
}
_showingMouseIndicators = true;
}
else
{
_proposedScrollBarsState = ScrollBarVisualState.TouchIndicator;
}
// Select the proper state for the scroll bars separator square within the GroupScrollBarsSeparator group:
if (UISettingsHelper.AreSettingsEnablingAnimations)
{
// When OS animations are turned on, show the square when a scroll bar is shown unless the DataGrid is disabled, using an animation.
_proposedScrollBarsSeparatorState =
this.IsEnabled &&
_proposedScrollBarsState == ScrollBarVisualState.MouseIndicatorFull ?
ScrollBarsSeparatorVisualState.SeparatorExpanded : ScrollBarsSeparatorVisualState.SeparatorCollapsed;
}
else
{
// OS animations are turned off. Show or hide the square depending on the presence of a scroll bars, without an animation.
// When the DataGrid is disabled, hide the square in sync with the scroll bar(s).
if (_proposedScrollBarsState == ScrollBarVisualState.MouseIndicatorFull)
{
_proposedScrollBarsSeparatorState = this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorExpandedWithoutAnimation : ScrollBarsSeparatorVisualState.SeparatorCollapsed;
}
else
{
_proposedScrollBarsSeparatorState = this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorCollapsedWithoutAnimation : ScrollBarsSeparatorVisualState.SeparatorCollapsed;
}
}
if (!UISettingsHelper.AreSettingsAutoHidingScrollBars)
{
if (this.AreBothScrollBarsVisible)
{
if (UISettingsHelper.AreSettingsEnablingAnimations)
{
SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicatorFull, this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorExpanded : ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
}
else
{
SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicatorFull, this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorExpandedWithoutAnimation : ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
}
}
else
{
if (UISettingsHelper.AreSettingsEnablingAnimations)
{
SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicator, ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
}
else
{
SwitchScrollBarsVisualStates(ScrollBarVisualState.MouseIndicator, this.IsEnabled ? ScrollBarsSeparatorVisualState.SeparatorCollapsedWithoutAnimation : ScrollBarsSeparatorVisualState.SeparatorCollapsed, true /*useTransitions*/);
}
}
}
else
{
SwitchScrollBarsVisualStates(_proposedScrollBarsState, _proposedScrollBarsSeparatorState, true /*useTransitions*/);
}
}
}
private void StopHideScrollBarsTimer()
{
if (_hideScrollBarsTimer != null && _hideScrollBarsTimer.IsRunning)
{
_hideScrollBarsTimer.Stop();
}
}
private void SwitchScrollBarsVisualStates(ScrollBarVisualState scrollBarsState, ScrollBarsSeparatorVisualState separatorState, bool useTransitions)
{
switch (scrollBarsState)
{
case ScrollBarVisualState.NoIndicator:
VisualStates.GoToState(this, useTransitions, VisualStates.StateNoIndicator);
if (!_hasNoIndicatorStateStoryboardCompletedHandler)
{
_showingMouseIndicators = false;
}
break;
case ScrollBarVisualState.TouchIndicator:
VisualStates.GoToState(this, useTransitions, VisualStates.StateTouchIndicator);
break;
case ScrollBarVisualState.MouseIndicator:
VisualStates.GoToState(this, useTransitions, VisualStates.StateMouseIndicator);
break;
case ScrollBarVisualState.MouseIndicatorFull:
VisualStates.GoToState(this, useTransitions, VisualStates.StateMouseIndicatorFull);
break;
}
switch (separatorState)
{
case ScrollBarsSeparatorVisualState.SeparatorCollapsed:
VisualStates.GoToState(this, useTransitions, VisualStates.StateSeparatorCollapsed);
break;
case ScrollBarsSeparatorVisualState.SeparatorExpanded:
VisualStates.GoToState(this, useTransitions, VisualStates.StateSeparatorExpanded);
break;
case ScrollBarsSeparatorVisualState.SeparatorExpandedWithoutAnimation:
VisualStates.GoToState(this, useTransitions, VisualStates.StateSeparatorExpandedWithoutAnimation);
break;
case ScrollBarsSeparatorVisualState.SeparatorCollapsedWithoutAnimation:
VisualStates.GoToState(this, useTransitions, VisualStates.StateSeparatorCollapsedWithoutAnimation);
break;
}
}
private void UnhookHorizontalScrollBarEvents()
{
if (_hScrollBar != null)
{
_hScrollBar.Scroll -= new ScrollEventHandler(HorizontalScrollBar_Scroll);
_hScrollBar.PointerEntered -= new PointerEventHandler(HorizontalScrollBar_PointerEntered);
_hScrollBar.PointerExited -= new PointerEventHandler(HorizontalScrollBar_PointerExited);
}
}
private void UnhookVerticalScrollBarEvents()
{
if (_vScrollBar != null)
{
_vScrollBar.Scroll -= new ScrollEventHandler(VerticalScrollBar_Scroll);
_vScrollBar.PointerEntered -= new PointerEventHandler(VerticalScrollBar_PointerEntered);
_vScrollBar.PointerExited -= new PointerEventHandler(VerticalScrollBar_PointerExited);
}
}
private void UpdateCurrentState(UIElement displayedElement, int columnIndex, bool applyCellState)
{
DataGridRow row = displayedElement as DataGridRow;
if (row != null)
{
if (this.AreRowHeadersVisible)
{
row.ApplyHeaderState(true /*animate*/);
}
DataGridCell cell = row.Cells[columnIndex];
if (applyCellState)
{
cell.ApplyCellState(true /*animate*/);
}
}
else
{
DataGridRowGroupHeader groupHeader = displayedElement as DataGridRowGroupHeader;
if (groupHeader != null)
{
groupHeader.ApplyState(true /*useTransitions*/);
if (this.AreRowHeadersVisible)
{
groupHeader.ApplyHeaderState(true /*animate*/);
}
}
}
}
private void UpdateDisabledVisual()
{
if (this.IsEnabled)
{
VisualStates.GoToState(this, true, VisualStates.StateNormal);
}
else
{
VisualStates.GoToState(this, true, VisualStates.StateDisabled, VisualStates.StateNormal);
}
}
private void UpdateHorizontalScrollBar(bool needHorizScrollBar, bool forceHorizScrollBar, double totalVisibleWidth, double totalVisibleFrozenWidth, double cellsWidth)
{
if (_hScrollBar != null)
{
if (needHorizScrollBar || forceHorizScrollBar)
{
// ..........viewportSize
// v---v
// |<|_____|###|>|
// ^ ^
// min max
// we want to make the relative size of the thumb reflect the relative size of the viewing area
// viewportSize / (max + viewportSize) = cellsWidth / max
// -> viewportSize = max * cellsWidth / (max - cellsWidth)
// always zero
_hScrollBar.Minimum = 0;
if (needHorizScrollBar)
{
// maximum travel distance -- not the total width
_hScrollBar.Maximum = totalVisibleWidth - cellsWidth;
DiagnosticsDebug.Assert(totalVisibleFrozenWidth >= 0, "Expected positive totalVisibleFrozenWidth.");
if (_frozenColumnScrollBarSpacer != null)
{
_frozenColumnScrollBarSpacer.Width = totalVisibleFrozenWidth;
}
DiagnosticsDebug.Assert(_hScrollBar.Maximum >= 0, "Expected positive _hScrollBar.Maximum.");
// width of the scrollable viewing area
double viewPortSize = Math.Max(0, cellsWidth - totalVisibleFrozenWidth);
_hScrollBar.ViewportSize = viewPortSize;
_hScrollBar.LargeChange = viewPortSize;
// The ScrollBar should be in sync with HorizontalOffset at this point. There's a resize case
// where the ScrollBar will coerce an old value here, but we don't want that.
SetHorizontalOffset(_horizontalOffset);
_hScrollBar.IsEnabled = true;
}
else
{
_hScrollBar.Maximum = 0;
_hScrollBar.ViewportSize = 0;
_hScrollBar.IsEnabled = false;
}
if (_hScrollBar.Visibility != Visibility.Visible)
{
// This will trigger a call to this method via Cells_SizeChanged for which no processing is needed.
_hScrollBar.Visibility = Visibility.Visible;
_ignoreNextScrollBarsLayout = true;
if (!this.IsHorizontalScrollBarOverCells && _hScrollBar.DesiredSize.Height == 0)
{
// We need to know the height for the rest of layout to work correctly so measure it now
_hScrollBar.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
}
}
}
else
{
_hScrollBar.Maximum = 0;
if (_hScrollBar.Visibility != Visibility.Collapsed)
{
// This will trigger a call to this method via Cells_SizeChanged for which no processing is needed.
_hScrollBar.Visibility = Visibility.Collapsed;
_ignoreNextScrollBarsLayout = true;
}
}
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationScrollEvents();
}
}
}
#if FEATURE_IEDITABLECOLLECTIONVIEW
private void UpdateNewItemPlaceholder()
{
int placeholderSlot = SlotFromRowIndex(this.DataConnection.NewItemPlaceholderIndex);
if (this.DataConnection.NewItemPlaceholderPosition == NewItemPlaceholderPosition.AtEnd &&
_collapsedSlotsTable.Contains(placeholderSlot) != this.IsReadOnly)
{
if (this.IsReadOnly)
{
if (this.SelectedIndex == this.DataConnection.NewItemPlaceholderIndex)
{
this.SelectedIndex = Math.Max(-1, this.DataConnection.Count - 2);
}
if (this.IsSlotVisible(SlotFromRowIndex(this.DataConnection.NewItemPlaceholderIndex)))
{
this.RemoveDisplayedElement(placeholderSlot, false, true);
this.InvalidateRowsArrange();
}
_collapsedSlotsTable.AddValue(placeholderSlot, Visibility.Collapsed);
}
else
{
_collapsedSlotsTable.RemoveValue(placeholderSlot);
}
this.VisibleSlotCount = this.SlotCount - _collapsedSlotsTable.GetIndexCount(0, this.SlotCount - 1);
this.ComputeScrollBarsLayout();
}
}
#endif
private void UpdateRowDetailsVisibilityMode(DataGridRowDetailsVisibilityMode newDetailsMode)
{
if (_rowsPresenter != null && this.DataConnection.Count > 0)
{
Visibility newDetailsVisibility = Visibility.Collapsed;
switch (newDetailsMode)
{
case DataGridRowDetailsVisibilityMode.Visible:
newDetailsVisibility = Visibility.Visible;
break;
case DataGridRowDetailsVisibilityMode.Collapsed:
newDetailsVisibility = Visibility.Collapsed;
break;
case DataGridRowDetailsVisibilityMode.VisibleWhenSelected:
break;
}
this.ClearShowDetailsTable();
bool updated = false;
foreach (DataGridRow row in this.GetAllRows())
{
if (row.Visibility == Visibility.Visible)
{
if (newDetailsMode == DataGridRowDetailsVisibilityMode.VisibleWhenSelected)
{
// For VisibleWhenSelected, we need to calculate the value for each individual row
newDetailsVisibility = _selectedItems.ContainsSlot(row.Slot) && row.Index != this.DataConnection.NewItemPlaceholderIndex ? Visibility.Visible : Visibility.Collapsed;
}
if (row.DetailsVisibility != newDetailsVisibility)
{
updated = true;
row.SetDetailsVisibilityInternal(
newDetailsVisibility,
true /*raiseNotification*/);
}
}
}
if (updated)
{
UpdateDisplayedRows(this.DisplayData.FirstScrollingSlot, this.CellsHeight);
InvalidateRowsMeasure(false /*invalidateIndividualElements*/);
}
}
}
private void UpdateRowsPresenterManipulationMode(bool horizontalMode, bool verticalMode)
{
if (_rowsPresenter != null)
{
ManipulationModes manipulationMode = _rowsPresenter.ManipulationMode;
if (horizontalMode)
{
if (this.HorizontalScrollBarVisibility != ScrollBarVisibility.Disabled)
{
manipulationMode |= ManipulationModes.TranslateX | ManipulationModes.TranslateInertia;
}
else
{
manipulationMode &= ~(ManipulationModes.TranslateX | ManipulationModes.TranslateRailsX);
}
}
if (verticalMode)
{
if (this.VerticalScrollBarVisibility != ScrollBarVisibility.Disabled)
{
manipulationMode |= ManipulationModes.TranslateY | ManipulationModes.TranslateInertia;
}
else
{
manipulationMode &= ~(ManipulationModes.TranslateY | ManipulationModes.TranslateRailsY);
}
}
if ((manipulationMode & (ManipulationModes.TranslateX | ManipulationModes.TranslateY)) == (ManipulationModes.TranslateX | ManipulationModes.TranslateY))
{
manipulationMode |= ManipulationModes.TranslateRailsX | ManipulationModes.TranslateRailsY;
}
if ((manipulationMode & (ManipulationModes.TranslateX | ManipulationModes.TranslateRailsX | ManipulationModes.TranslateY | ManipulationModes.TranslateRailsY)) ==
ManipulationModes.None)
{
manipulationMode &= ~ManipulationModes.TranslateInertia;
}
_rowsPresenter.ManipulationMode = manipulationMode;
}
}
private bool UpdateStateOnTapped(TappedRoutedEventArgs args, int columnIndex, int slot, bool allowEdit, bool shift, bool ctrl)
{
bool beginEdit;
DiagnosticsDebug.Assert(slot >= 0, "Expected positive slot.");
// Before changing selection, check if the current cell needs to be committed, and
// check if the current row needs to be committed. If any of those two operations are required and fail,
// do not change selection, and do not change current cell.
bool wasInEdit = this.EditingColumnIndex != -1;
if (IsSlotOutOfBounds(slot))
{
return true;
}
if (wasInEdit && (columnIndex != this.EditingColumnIndex || slot != this.CurrentSlot) &&
this.WaitForLostFocus(() => { this.UpdateStateOnTapped(args, columnIndex, slot, allowEdit, shift, ctrl); }))
{
return true;
}
try
{
_noSelectionChangeCount++;
beginEdit = allowEdit &&
this.CurrentSlot == slot &&
columnIndex != -1 &&
(wasInEdit || this.CurrentColumnIndex == columnIndex) &&
!GetColumnEffectiveReadOnlyState(this.ColumnsItemsInternal[columnIndex]);
DataGridSelectionAction action;
if (this.SelectionMode == DataGridSelectionMode.Extended && shift)
{
// Shift select multiple rows.
action = DataGridSelectionAction.SelectFromAnchorToCurrent;
}
else if (GetRowSelection(slot))
{
// Unselecting single row or Selecting a previously multi-selected row.
if (!ctrl && this.SelectionMode == DataGridSelectionMode.Extended && _selectedItems.Count != 0)
{
// Unselect everything except the row that was clicked on.
action = DataGridSelectionAction.SelectCurrent;
}
else if (ctrl && this.EditingRow == null)
{
action = DataGridSelectionAction.RemoveCurrentFromSelection;
}
else
{
action = DataGridSelectionAction.None;
}
}
else
{
// Selecting a single row or multi-selecting with Ctrl.
if (this.SelectionMode == DataGridSelectionMode.Single || !ctrl)
{
// Unselect the correctly selected rows except the new selected row.
action = DataGridSelectionAction.SelectCurrent;
}
else
{
action = DataGridSelectionAction.AddCurrentToSelection;
}
}
UpdateSelectionAndCurrency(columnIndex, slot, action, false /*scrollIntoView*/);
}
finally
{
this.NoSelectionChangeCount--;
}
if (_successfullyUpdatedSelection && beginEdit && BeginCellEdit(args))
{
FocusEditingCell(true /*setFocus*/);
}
return true;
}
/// <summary>
/// Updates the DataGrid's validation results, modifies the ValidationSummary's items,
/// and sets the IsValid states of the UIElements.
/// </summary>
/// <param name="newValidationResults">New validation results.</param>
/// <param name="scrollIntoView">If the validation results have changed, scrolls the editing row into view.</param>
private void UpdateValidationResults(List<ValidationResult> newValidationResults, bool scrollIntoView)
{
bool validationResultsChanged = false;
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
// Remove the validation results that have been fixed
List<ValidationResult> removedValidationResults = new List<ValidationResult>();
foreach (ValidationResult oldValidationResult in _validationResults)
{
if (oldValidationResult != null && !newValidationResults.ContainsEqualValidationResult(oldValidationResult))
{
removedValidationResults.Add(oldValidationResult);
validationResultsChanged = true;
}
}
foreach (ValidationResult removedValidationResult in removedValidationResults)
{
_validationResults.Remove(removedValidationResult);
#if FEATURE_VALIDATION_SUMMARY
if (_validationSummary != null)
{
ValidationSummaryItem removedValidationSummaryItem = this.FindValidationSummaryItem(removedValidationResult);
if (removedValidationSummaryItem != null)
{
_validationSummary.Errors.Remove(removedValidationSummaryItem);
}
}
#endif
}
// Add any validation results that were just introduced
foreach (ValidationResult newValidationResult in newValidationResults)
{
if (newValidationResult != null && !_validationResults.ContainsEqualValidationResult(newValidationResult))
{
_validationResults.Add(newValidationResult);
#if FEATURE_VALIDATION_SUMMARY
if (_validationSummary != null && ShouldDisplayValidationResult(newValidationResult))
{
ValidationSummaryItem newValidationSummaryItem = this.CreateValidationSummaryItem(newValidationResult);
if (newValidationSummaryItem != null)
{
_validationSummary.Errors.Add(newValidationSummaryItem);
}
}
#endif
validationResultsChanged = true;
}
}
if (validationResultsChanged)
{
this.UpdateValidationStatus();
}
if (!this.IsValid && scrollIntoView)
{
// Scroll the row with the error into view.
int editingRowSlot = this.EditingRow.Slot;
#if FEATURE_VALIDATION_SUMMARY
if (_validationSummary != null)
{
// If the number of errors has changed, then the ValidationSummary will be a different size,
// and we need to delay our call to ScrollSlotIntoView
this.InvalidateMeasure();
// TODO: Move to DispatcherQueue when FEATURE_VALIDATION_SUMMARY is enabled
this.Dispatcher.BeginInvoke(() =>
{
// It's possible that the DataContext or ItemsSource has changed by the time we reach this code,
// so we need to ensure that the editing row still exists before scrolling it into view
if (!this.IsSlotOutOfBounds(editingRowSlot) && editingRowSlot != -1)
{
this.ScrollSlotIntoView(editingRowSlot, false /*scrolledHorizontally*/);
}
});
}
else
#endif
{
this.ScrollSlotIntoView(editingRowSlot, false /*scrolledHorizontally*/);
}
}
}
/// <summary>
/// Updates the IsValid states of the DataGrid, the EditingRow and its cells. All cells related to
/// property-level errors are set to Invalid. If there is an object-level error selected in the
/// ValidationSummary, then its associated cells will also be flagged (if there are any).
/// </summary>
private void UpdateValidationStatus()
{
if (this.EditingRow != null)
{
foreach (DataGridCell cell in this.EditingRow.Cells)
{
bool isCellValid = true;
DiagnosticsDebug.Assert(cell.OwningColumn != null, "Expected cell has owning column.");
if (!cell.OwningColumn.IsReadOnly)
{
foreach (ValidationResult validationResult in _validationResults)
{
bool validationResultIsSelectedValidationSummaryItemContext = false;
#if FEATURE_VALIDATION_SUMMARY
validationResultIsSelectedValidationSummaryItemContext = _selectedValidationSummaryItem != null && _selectedValidationSummaryItem.Context == validationResult;
#endif
if (_propertyValidationResults.ContainsEqualValidationResult(validationResult) ||
validationResultIsSelectedValidationSummaryItemContext)
{
foreach (string bindingPath in validationResult.MemberNames)
{
if (cell.OwningColumn.BindingPaths.Contains(bindingPath))
{
isCellValid = false;
break;
}
}
}
}
}
if (cell.IsValid != isCellValid)
{
cell.IsValid = isCellValid;
cell.ApplyCellState(true /*animate*/);
}
}
bool isRowValid = _validationResults.Count == 0;
if (this.EditingRow.IsValid != isRowValid)
{
this.EditingRow.IsValid = isRowValid;
this.EditingRow.ApplyState(true /*animate*/);
}
this.IsValid = isRowValid;
}
else
{
this.IsValid = true;
}
}
private void UpdateVerticalScrollBar(bool needVertScrollBar, bool forceVertScrollBar, double totalVisibleHeight, double cellsHeight)
{
if (_vScrollBar != null)
{
if (needVertScrollBar || forceVertScrollBar)
{
// ..........viewportSize
// v---v
// |<|_____|###|>|
// ^ ^
// min max
// we want to make the relative size of the thumb reflect the relative size of the viewing area
// viewportSize / (max + viewportSize) = cellsWidth / max
// -> viewportSize = max * cellsHeight / (totalVisibleHeight - cellsHeight)
// -> = max * cellsHeight / (totalVisibleHeight - cellsHeight)
// -> = max * cellsHeight / max
// -> = cellsHeight
// always zero
_vScrollBar.Minimum = 0;
if (needVertScrollBar && !double.IsInfinity(cellsHeight))
{
// maximum travel distance -- not the total height
_vScrollBar.Maximum = totalVisibleHeight - cellsHeight;
DiagnosticsDebug.Assert(_vScrollBar.Maximum >= 0, "Expected positive _vScrollBar.Maximum.");
// total height of the display area
_vScrollBar.ViewportSize = cellsHeight;
_vScrollBar.LargeChange = cellsHeight;
_vScrollBar.IsEnabled = true;
}
else
{
_vScrollBar.Maximum = 0;
_vScrollBar.ViewportSize = 0;
_vScrollBar.IsEnabled = false;
}
if (_vScrollBar.Visibility != Visibility.Visible)
{
// This will trigger a call to this method via Cells_SizeChanged for which no processing is needed.
_vScrollBar.Visibility = Visibility.Visible;
_ignoreNextScrollBarsLayout = true;
if (!this.IsVerticalScrollBarOverCells && _vScrollBar.DesiredSize.Width == 0)
{
// We need to know the width for the rest of layout to work correctly so measure it now.
_vScrollBar.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
}
}
}
else
{
_vScrollBar.Maximum = 0;
if (_vScrollBar.Visibility != Visibility.Collapsed)
{
// This will trigger a call to this method via Cells_SizeChanged for which no processing is needed.
_vScrollBar.Visibility = Visibility.Collapsed;
_ignoreNextScrollBarsLayout = true;
}
}
DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
if (peer != null)
{
peer.RaiseAutomationScrollEvents();
}
}
}
/// <summary>
/// Validates the current editing row and updates the visual states.
/// </summary>
/// <param name="scrollIntoView">If true, will scroll the editing row into view when a new error is introduced.</param>
/// <param name="wireEvents">If true, subscribes to the asynchronous INDEI ErrorsChanged events.</param>
/// <returns>True if the editing row is valid, false otherwise.</returns>
private bool ValidateEditingRow(bool scrollIntoView, bool wireEvents)
{
List<ValidationResult> validationResults;
if (_initializingNewItem)
{
// We only want to run property validation if we're initializing a new item. Instead of
// clearing all the errors, we will only remove those associated with the current column.
validationResults = new List<ValidationResult>(_validationResults);
}
else
{
// We're going to run full entity-level validation, so throw away the
// old errors since they will be recreated if they're still active.
_propertyValidationResults.Clear();
_indeiValidationResults.Clear();
validationResults = new List<ValidationResult>();
}
if (this.EditingRow != null)
{
object dataItem = this.EditingRow.DataContext;
DiagnosticsDebug.Assert(dataItem != null, "Expected non-null dataItem.");
if (!_initializingNewItem)
{
// Validate using the Validator.
ValidationContext context = new ValidationContext(dataItem, null, null);
Validator.TryValidateObject(dataItem, context, validationResults, true);
#if FEATURE_IDATAERRORINFO
// IDEI entity validation.
this.ValidateIdei(dataItem as IDataErrorInfo, null, null, validationResults);
#endif
// INDEI entity validation.
this.ValidateIndei(dataItem as INotifyDataErrorInfo, null, null, null, validationResults, wireEvents);
}
// IDEI and INDEI property validation.
foreach (DataGridColumn column in this.ColumnsInternal.GetDisplayedColumns(c => c.IsVisible && !c.IsReadOnly))
{
if (!_initializingNewItem || column == this.CurrentColumn)
{
foreach (string bindingPath in column.BindingPaths)
{
string declaringPath = null;
object declaringItem = dataItem;
string bindingProperty = bindingPath;
// Check for nested paths.
int lastIndexOfSeparator = bindingPath.LastIndexOfAny(new char[] { TypeHelper.PropertyNameSeparator, TypeHelper.LeftIndexerToken });
if (lastIndexOfSeparator >= 0)
{
declaringPath = bindingPath.Substring(0, lastIndexOfSeparator);
declaringItem = TypeHelper.GetNestedPropertyValue(dataItem, declaringPath);
if (bindingProperty[lastIndexOfSeparator] == TypeHelper.LeftIndexerToken)
{
bindingProperty = TypeHelper.PrependDefaultMemberName(declaringItem, bindingPath.Substring(lastIndexOfSeparator));
}
else
{
bindingProperty = bindingPath.Substring(lastIndexOfSeparator + 1);
}
}
if (_initializingNewItem)
{
// We're only re-validating the current column, so remove its old errors
// because we're about to check if they're still relevant.
foreach (ValidationResult oldValidationResult in _validationResults)
{
if (oldValidationResult != null && oldValidationResult.ContainsMemberName(bindingPath))
{
validationResults.Remove(oldValidationResult);
_indeiValidationResults.Remove(oldValidationResult);
_propertyValidationResults.Remove(oldValidationResult);
}
}
}
#if FEATURE_IDATAERRORINFO
// IDEI property validation.
this.ValidateIdei(declaringItem as IDataErrorInfo, bindingProperty, bindingPath, validationResults);
#endif
// INDEI property validation.
this.ValidateIndei(declaringItem as INotifyDataErrorInfo, bindingProperty, bindingPath, declaringPath, validationResults, wireEvents);
}
}
}
// Add any existing exception errors (in case we're editing a cell).
// Note: these errors will only be displayed in the ValidationSummary if the
// editing data item implements IDEI or INDEI.
foreach (ValidationResult validationResult in _bindingValidationResults)
{
validationResults.AddIfNew(validationResult);
_propertyValidationResults.AddIfNew(validationResult);
}
// Merge the new validation results with the existing ones.
this.UpdateValidationResults(validationResults, scrollIntoView);
// Return false if there are validation errors.
if (!this.IsValid)
{
return false;
}
}
// Return true if there are no errors or there is no editing row.
this.ResetValidationStatus();
return true;
}
#if FEATURE_IDATAERRORINFO
/// <summary>
/// Checks an IDEI data object for errors for the specified property. New errors are added to the
/// list of validation results.
/// </summary>
/// <param name="idei">IDEI object to validate.</param>
/// <param name="bindingProperty">Name of the property to validate.</param>
/// <param name="bindingPath">Path of the binding.</param>
/// <param name="validationResults">List of results to add to.</param>
private void ValidateIdei(IDataErrorInfo idei, string bindingProperty, string bindingPath, List<ValidationResult> validationResults)
{
if (idei != null)
{
string errorString = null;
if (string.IsNullOrEmpty(bindingProperty))
{
DiagnosticsDebug.Assert(string.IsNullOrEmpty(bindingPath));
ValidationUtil.CatchNonCriticalExceptions(() => { errorString = idei.Error; });
if (!string.IsNullOrEmpty(errorString))
{
validationResults.AddIfNew(new ValidationResult(errorString));
}
}
else
{
ValidationUtil.CatchNonCriticalExceptions(() => { errorString = idei[bindingProperty]; });
if (!string.IsNullOrEmpty(errorString))
{
ValidationResult validationResult = new ValidationResult(errorString, new List<string>() { bindingPath });
validationResults.AddIfNew(validationResult);
_propertyValidationResults.Add(validationResult);
}
}
}
}
#endif
/// <summary>
/// Checks an INDEI data object for errors on the specified path. New errors are added to the
/// list of validation results.
/// </summary>
/// <param name="indei">INDEI object to validate.</param>
/// <param name="bindingProperty">Name of the property to validate.</param>
/// <param name="bindingPath">Path of the binding.</param>
/// <param name="declaringPath">Path of the INDEI object.</param>
/// <param name="validationResults">List of results to add to.</param>
/// <param name="wireEvents">True if the ErrorsChanged event should be subscribed to.</param>
private void ValidateIndei(INotifyDataErrorInfo indei, string bindingProperty, string bindingPath, string declaringPath, List<ValidationResult> validationResults, bool wireEvents)
{
if (indei != null)
{
if (indei.HasErrors)
{
IEnumerable errors = null;
ValidationUtil.CatchNonCriticalExceptions(() => { errors = indei.GetErrors(bindingProperty); });
if (errors != null)
{
foreach (object errorItem in errors)
{
if (errorItem != null)
{
string errorString = null;
ValidationUtil.CatchNonCriticalExceptions(() => { errorString = errorItem.ToString(); });
if (!string.IsNullOrEmpty(errorString))
{
ValidationResult validationResult;
if (!string.IsNullOrEmpty(bindingProperty))
{
validationResult = new ValidationResult(errorString, new List<string>() { bindingPath });
_propertyValidationResults.Add(validationResult);
}
else
{
DiagnosticsDebug.Assert(string.IsNullOrEmpty(bindingPath), "Expected bindingPath is null or empty.");
validationResult = new ValidationResult(errorString);
}
validationResults.AddIfNew(validationResult);
_indeiValidationResults.AddIfNew(validationResult);
}
}
}
}
}
if (wireEvents && !_validationItems.ContainsKey(indei))
{
_validationItems.Add(indei, declaringPath);
indei.ErrorsChanged += new EventHandler<DataErrorsChangedEventArgs>(ValidationItem_ErrorsChanged);
}
}
}
/// <summary>
/// Handles the asynchronous INDEI errors that occur while the DataGrid is in editing mode.
/// </summary>
/// <param name="sender">INDEI item whose errors changed.</param>
/// <param name="e">Error event arguments.</param>
private void ValidationItem_ErrorsChanged(object sender, DataErrorsChangedEventArgs e)
{
INotifyDataErrorInfo indei = sender as INotifyDataErrorInfo;
if (_validationItems.ContainsKey(indei))
{
DiagnosticsDebug.Assert(this.EditingRow != null, "Expected non-null EditingRow.");
// Determine the binding path.
string bindingPath = _validationItems[indei];
if (string.IsNullOrEmpty(bindingPath))
{
bindingPath = e.PropertyName;
}
else if (!string.IsNullOrEmpty(e.PropertyName) && e.PropertyName.IndexOf(TypeHelper.LeftIndexerToken) >= 0)
{
bindingPath += TypeHelper.RemoveDefaultMemberName(e.PropertyName);
}
else
{
bindingPath += TypeHelper.PropertyNameSeparator + e.PropertyName;
}
// Remove the old errors.
List<ValidationResult> validationResults = new List<ValidationResult>();
foreach (ValidationResult validationResult in _validationResults)
{
ValidationResult oldValidationResult = _indeiValidationResults.FindEqualValidationResult(validationResult);
if (oldValidationResult != null && oldValidationResult.ContainsMemberName(bindingPath))
{
_indeiValidationResults.Remove(oldValidationResult);
}
else
{
validationResults.Add(validationResult);
}
}
// Find any new errors and update the visuals.
this.ValidateIndei(indei, e.PropertyName, bindingPath, null, validationResults, false /*wireEvents*/);
this.UpdateValidationResults(validationResults, false /*scrollIntoView*/);
// If we're valid now then reset our status.
if (this.IsValid)
{
this.ResetValidationStatus();
}
}
else if (indei != null)
{
indei.ErrorsChanged -= new EventHandler<DataErrorsChangedEventArgs>(ValidationItem_ErrorsChanged);
}
}
private void VerticalScrollBar_Scroll(object sender, ScrollEventArgs e)
{
ProcessVerticalScroll(e.ScrollEventType);
}
}
}
``` |
Peter Roe is a rugby league footballer who played in the 1970s and 1980s, and coached in the 1980s, 1990s and 2000s. He played at club level for Keighley, Bradford Northern, York and Hunslet, as a , and coached at club level for Keighley (three spells), Halifax, Barrow (two spells), Swinton (two spells), Featherstone Rovers and Wakefield Trinity.
Early life
At an early age, Roe played football and was given a trial at Manchester United. Roe had also received interest from Sheffield United, but he suffered a back injury in an accident which prevented him from playing sport for 12 months. Once Roe had recovered, he had turned his attention to playing rugby league instead.
Playing career
Keighley
Roe started his professional career at Keighley and was promoted to the first team in 1974. Whilst at Keighley he represented Yorkshire at the age of 18.
Bradford Northern
In December 1975, Roe was transferred to Bradford Northern for a fee of £7,500. He played 99 games under Roy Francis and Peter Fox, who coached the team to back-to-back championships. His playing position was at . Roe was selected to play for Great Britain in France but had to pull out due to a serious knee injury and subsequently had to retire prematurely from the game when Bradford Northern cashed in their insurance policy (£30,000) on Roe in 1981. Roe proved the medical people wrong and fought his way back to fitness but was not allowed to play again for Bradford Northern due to the legalities of the payout. He finished his playing career with York and Hunslet.
Coaching career
He began his coaching career at Keighley, taking over from the late Geoff Peggs who 'died in office' in 1985. He left the following year.
Peter Roe was appointed as head coach at Halifax for season 1990-91 when they achieved promotion along with Salford who were their opponents in the Divisional Final at Old Trafford. Roe was removed from office 24-hours later when he refused to re-apply for his own job. The Halifax board stated that he did not have the required experience for a club in the top division. He returned to Keighley in September 1991 and coached the club to the division three title in 1992-93 and stayed at his home town club until 1994.
He was coach of Barrow for a 15-month period, ending in January 1996.
Peter Roe led Swinton to promotion from Division Two in 1996.
Peter Roe was in charge of Featherstone Rovers from 1999 to October 2001 on a part-time contract, before leaving to take charge of Wakefield Trinity. He was replaced at Featherstone Rovers by his assistant Ian Fairhurst.
In October 2001, Roe left his part-time role as Featherstone Rovers coach and his job as a benefit fraud investigator to take up a full-time head coach post with Wakefield Trinity. He was sacked in July 2002 and was replaced by his assistant Shane McNally.
Peter Roe quit as coach of Swinton in September 2003, after less than a year in charge.
In Peter Roe's second spell with Barrow, they were National League Two champions in 2004, their first trophy for 20 years with 14 wins from their 18 games. Roe won Coach of the Year in the process. They were promoted to National League One but were relegated back to National League Two at the end of the 2005 season after winning just one of their 18 matches. The financial situation at the club forced a review of the coaching structure and the position of head coach was made part-time and the club parted company with Peter Roe.
Peter Roe returned for his second spell in charge of Keighley at the end of 2005, succeeding Gary Moorby and starting the rebuilding process of a club still ravaged by relegation from National League One. The majority of players had left and money was in short supply. player-coach Barry Eaton was the only major signing and promising youngsters were blooded; the side struggled to compete and they finished joint-bottom. Roe gave Eaton full control as player-coach in 2007.
References
External links
Player statistics at rugbyleagueproject.org
Coach statistics at rugbyleagueproject.org
Living people
Barrow Raiders coaches
Bradford Bulls players
Bramley Buffaloes coaches
English rugby league coaches
English rugby league players
Featherstone Rovers coaches
Halifax R.L.F.C. coaches
Hunslet R.L.F.C. players
Keighley Cougars coaches
Keighley Cougars players
Rugby league centres
Rugby league players from Keighley
Swinton Lions coaches
Wakefield Trinity coaches
York Wasps players
Yorkshire rugby league team players
Year of birth missing (living people)
Place of birth missing (living people)
Rugby articles needing expert attention |
Marthana is a genus of harvestmen in the family Sclerosomatidae found in Southeast Asia.
Species
Marthana affinis Banks, 1930
Marthana aurata (Roewer, 1955)
Marthana bakeri Roewer, 1955
Marthana balabacana Suzuki, 1977
Marthana beharensis (Roewer, 1955)
Marthana birmanica (Roewer, 1955)
Marthana cerata (Roewer, 1912)
Marthana columnaris Thorell, 1891
Marthana columnaris Roewer, 1955
Marthana cornifer Loman, 1906
Marthana cuspidata Loman, in Weber 1892
Marthana ferruginea (Roewer, 1911)
Marthana furcata Banks, 1930
Marthana fusca (Roewer, 1912)
Marthana idjena (Roewer, 1955)
Marthana moluccana (Roewer, 1955)
Marthana negrosensis (Roewer, 1955)
Marthana nigerrima (Müller, 1916)
Marthana niveata (Roewer, 1955)
Marthana perspicillata (Roewer, 1911)
Marthana sarasinorum Roewer, 1913
Marthana scripta (Roewer, 1955)
Marthana siamensis (Roewer, 1955)
Marthana turrita Thorell, 1891
Marthana turrita (Roewer, 1910)
Marthana vestita With, 1905
References
Harvestmen
Harvestman genera |
A laundy basket is a basket used for storing clean or dirty clothes, for storage before washing and drying, or for transporting clothes. They are used to keep clean and dirty laundry collected and organised, and can prevent clothes from getting lost or mixed up. Laundry baskets are often placed in a bathroom or laundry room as a piece of furniture in a home, while laundry bags are sometimes used to keep dirty laundry separate during travel.
Different boxes can be used for sorting the laundry according to their intended washing programs, and when a basket is full this can indicate that it is time for doing laundry. It is recommended to separate dirty laundry used by ill people from dirty laundry to be used by healthy people, especially if the clothes will be washed at less than 60 Celsius.
Historically, dirty laundry has sometimes been a thing which people have tried to hide under stairs, counters, et cetera.
Construction
Most clothes baskets are designed in such a way that air can circulate so that any moisture in the laundry can escape.
Materials
Clothes baskets can be made of various materials such as wood, plastic, metal, rope, ratten, braided willow or textile.
Form
The shape can vary, and baskets can be obtained, among other things, with a base surface that is circular, square or rectangular. Clothes baskets often have carrying handles or edges on two of the short sides so that they can be easily carried by one person. In addition to baskets, there are also laundry bags, boxes and crates. Some clothes baskets have a seat on top, which makes them a multifunctional furniture. Laundry baskets can vary greatly in shape and size from around 25 liters to 100 litres. In 2010, a concept was shown where the laundry basket also functioned as a washing machine.
See also
Euro box, standardised type of box for storage and transport
References
Furniture |
Alexander Bublik was the defending champion but chose not to defend his title.
Dennis Novikov won the title after defeating Cristian Garín 6–4, 6–3 in the final.
Seeds
Draw
Finals
Top half
Bottom half
References
Main draw
Qualifying draw
2018 ATP Challenger Tour
2018 Singles |
Justin William Goodwin (born 15 July 1976) is a New Zealand international lawn bowler.
Bowls career
Goodwin has represented New Zealand at the Commonwealth Games, in the triples event at the 2006 Commonwealth Games.
He won a gold medal in the triples with Gary Lawson and Richard Girvan, at the 2005 Asia Pacific Bowls Championships in Melbourne.
References
External links
New Zealand male bowls players
1976 births
Living people
Bowls players at the 2006 Commonwealth Games
20th-century New Zealand people
21st-century New Zealand people |
```c
/**
******************************************************************************
* @file system_stm32h7xx.c
* @author MCD Application Team
* @brief CMSIS Cortex-Mx Device Peripheral Access Layer System Source File.
*
* This file provides two functions and one global variable to be called from
* user application:
* - SystemInit(): This function is called at startup just after reset and
* before branch to main program. This call is made inside
* the "startup_stm32h7xx.s" file.
*
* - SystemCoreClock variable: Contains the core clock, it can be used
* by the user application to setup the SysTick
* timer or configure other parameters.
*
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
* be called whenever the core clock is changed
* during program execution.
*
*
******************************************************************************
* @attention
*
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/** @addtogroup CMSIS
* @{
*/
/** @addtogroup stm32h7xx_system
* @{
*/
/** @addtogroup STM32H7xx_System_Private_Includes
* @{
*/
#include "stm32h7xx.h"
#include <math.h>
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
#if !defined (CSI_VALUE)
#define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
#endif /* CSI_VALUE */
#if !defined (HSI_VALUE)
#define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI_VALUE */
/**
* @}
*/
/** @addtogroup STM32H7xx_System_Private_TypesDefinitions
* @{
*/
/**
* @}
*/
/** @addtogroup STM32H7xx_System_Private_Defines
* @{
*/
/************************* Miscellaneous Configuration ************************/
/*!< Uncomment the following line if you need to use initialized data in D2 domain SRAM (AHB SRAM) */
/* #define DATA_IN_D2_SRAM */
/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x00000000UL /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
/******************************************************************************/
/**
* @}
*/
/** @addtogroup STM32H7xx_System_Private_Macros
* @{
*/
/**
* @}
*/
/** @addtogroup STM32H7xx_System_Private_Variables
* @{
*/
/* This variable is updated in three ways:
1) by calling CMSIS function SystemCoreClockUpdate()
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
Note: If you use this function to configure the system clock; then there
is no need to call the 2 first functions listed above, since SystemCoreClock
variable is updated automatically.
*/
uint32_t SystemCoreClock = 64000000;
uint32_t SystemD2Clock = 64000000;
const uint8_t D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
/**
* @}
*/
/** @addtogroup STM32H7xx_System_Private_FunctionPrototypes
* @{
*/
/**
* @}
*/
/** @addtogroup STM32H7xx_System_Private_Functions
* @{
*/
/**
* @brief Setup the microcontroller system
* Initialize the FPU setting and vector table location
* configuration.
* @param None
* @retval None
*/
void SystemInit (void)
{
#if defined (DATA_IN_D2_SRAM)
__IO uint32_t tmpreg;
#endif /* DATA_IN_D2_SRAM */
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << (10*2))|(3UL << (11*2))); /* set CP10 and CP11 Full Access */
#endif
/* Reset the RCC clock configuration to the default reset state ------------*/
/* Increasing the CPU frequency */
if(FLASH_LATENCY_DEFAULT > (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY)))
{
/* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (uint32_t)(FLASH_LATENCY_DEFAULT));
}
/* Set HSION bit */
RCC->CR |= RCC_CR_HSION;
/* Reset CFGR register */
RCC->CFGR = 0x00000000;
/* Reset HSEON, HSECSSON, CSION, HSI48ON, CSIKERON, PLL1ON, PLL2ON and PLL3ON bits */
RCC->CR &= 0xEAF6ED7FU;
/* Decreasing the number of wait states because of lower CPU frequency */
if(FLASH_LATENCY_DEFAULT < (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY)))
{
/* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (uint32_t)(FLASH_LATENCY_DEFAULT));
}
#if defined(D3_SRAM_BASE)
/* Reset D1CFGR register */
RCC->D1CFGR = 0x00000000;
/* Reset D2CFGR register */
RCC->D2CFGR = 0x00000000;
/* Reset D3CFGR register */
RCC->D3CFGR = 0x00000000;
#else
/* Reset CDCFGR1 register */
RCC->CDCFGR1 = 0x00000000;
/* Reset CDCFGR2 register */
RCC->CDCFGR2 = 0x00000000;
/* Reset SRDCFGR register */
RCC->SRDCFGR = 0x00000000;
#endif
/* Reset PLLCKSELR register */
RCC->PLLCKSELR = 0x02020200;
/* Reset PLLCFGR register */
RCC->PLLCFGR = 0x01FF0000;
/* Reset PLL1DIVR register */
RCC->PLL1DIVR = 0x01010280;
/* Reset PLL1FRACR register */
RCC->PLL1FRACR = 0x00000000;
/* Reset PLL2DIVR register */
RCC->PLL2DIVR = 0x01010280;
/* Reset PLL2FRACR register */
RCC->PLL2FRACR = 0x00000000;
/* Reset PLL3DIVR register */
RCC->PLL3DIVR = 0x01010280;
/* Reset PLL3FRACR register */
RCC->PLL3FRACR = 0x00000000;
/* Reset HSEBYP bit */
RCC->CR &= 0xFFFBFFFFU;
/* Disable all interrupts */
RCC->CIER = 0x00000000;
#if (STM32H7_DEV_ID == 0x450UL)
/* dual core CM7 or single core line */
if((DBGMCU->IDCODE & 0xFFFF0000U) < 0x20000000U)
{
/* if stm32h7 revY*/
/* Change the switch matrix read issuing capability to 1 for the AXI SRAM target (Target 7) */
*((__IO uint32_t*)0x51008108) = 0x000000001U;
}
#endif
#if defined (DATA_IN_D2_SRAM)
/* in case of initialized data in D2 SRAM (AHB SRAM) , enable the D2 SRAM clock (AHB SRAM clock) */
#if defined(RCC_AHB2ENR_D2SRAM3EN)
RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN | RCC_AHB2ENR_D2SRAM3EN);
#elif defined(RCC_AHB2ENR_D2SRAM2EN)
RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN);
#else
RCC->AHB2ENR |= (RCC_AHB2ENR_AHBSRAM1EN | RCC_AHB2ENR_AHBSRAM2EN);
#endif /* RCC_AHB2ENR_D2SRAM3EN */
tmpreg = RCC->AHB2ENR;
(void) tmpreg;
#endif /* DATA_IN_D2_SRAM */
#if defined(DUAL_CORE) && defined(CORE_CM4)
/* Configure the Vector Table location add offset address for cortex-M4 ------------------*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = D2_AXISRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
SCB->VTOR = FLASH_BANK2_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#endif /* VECT_TAB_SRAM */
#else
/*
* Disable the FMC bank1 (enabled after reset).
* This, prevents CPU speculation access on this bank which blocks the use of FMC during
* 24us. During this time the others FMC master (such as LTDC) cannot use it!
*/
FMC_Bank1_R->BTCR[0] = 0x000030D2;
/* Configure the Vector Table location add offset address for cortex-M7 ------------------*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = D1_AXISRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal AXI-RAM */
#else
SCB->VTOR = FLASH_BANK1_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#endif
#endif /*DUAL_CORE && CORE_CM4*/
}
/**
* @brief Update SystemCoreClock variable according to Clock Register Values.
* The SystemCoreClock variable contains the core clock , it can
* be used by the user application to setup the SysTick timer or configure
* other parameters.
*
* @note Each time the core clock changes, this function must be called
* to update SystemCoreClock variable value. Otherwise, any configuration
* based on this variable will be incorrect.
*
* @note - The system frequency computed by this function is not the real
* frequency in the chip. It is calculated based on the predefined
* constant and the selected clock source:
*
* - If SYSCLK source is CSI, SystemCoreClock will contain the CSI_VALUE(*)
* - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
* - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
* - If SYSCLK source is PLL, SystemCoreClock will contain the CSI_VALUE(*),
* HSI_VALUE(**) or HSE_VALUE(***) multiplied/divided by the PLL factors.
*
* (*) CSI_VALUE is a constant defined in stm32h7xx_hal.h file (default value
* 4 MHz) but the real value may vary depending on the variations
* in voltage and temperature.
* (**) HSI_VALUE is a constant defined in stm32h7xx_hal.h file (default value
* 64 MHz) but the real value may vary depending on the variations
* in voltage and temperature.
*
* (***)HSE_VALUE is a constant defined in stm32h7xx_hal.h file (default value
* 25 MHz), user has to ensure that HSE_VALUE is same as the real
* frequency of the crystal used. Otherwise, this function may
* have wrong result.
*
* - The result of this function could be not correct when using fractional
* value for HSE crystal.
* @param None
* @retval None
*/
void SystemCoreClockUpdate (void)
{
uint32_t pllp, pllsource, pllm, pllfracen, hsivalue, tmp;
uint32_t common_system_clock;
float_t fracn1, pllvco;
/* Get SYSCLK source -------------------------------------------------------*/
switch (RCC->CFGR & RCC_CFGR_SWS)
{
case RCC_CFGR_SWS_HSI: /* HSI used as system clock source */
common_system_clock = (uint32_t) (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3));
break;
case RCC_CFGR_SWS_CSI: /* CSI used as system clock source */
common_system_clock = CSI_VALUE;
break;
case RCC_CFGR_SWS_HSE: /* HSE used as system clock source */
common_system_clock = HSE_VALUE;
break;
case RCC_CFGR_SWS_PLL1: /* PLL1 used as system clock source */
/* PLL_VCO = (HSE_VALUE or HSI_VALUE or CSI_VALUE/ PLLM) * PLLN
SYSCLK = PLL_VCO / PLLR
*/
pllsource = (RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC);
pllm = ((RCC->PLLCKSELR & RCC_PLLCKSELR_DIVM1)>> 4) ;
pllfracen = ((RCC->PLLCFGR & RCC_PLLCFGR_PLL1FRACEN)>>RCC_PLLCFGR_PLL1FRACEN_Pos);
fracn1 = (float_t)(uint32_t)(pllfracen* ((RCC->PLL1FRACR & RCC_PLL1FRACR_FRACN1)>> 3));
if (pllm != 0U)
{
switch (pllsource)
{
case RCC_PLLCKSELR_PLLSRC_HSI: /* HSI used as PLL clock source */
hsivalue = (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3)) ;
pllvco = ( (float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
break;
case RCC_PLLCKSELR_PLLSRC_CSI: /* CSI used as PLL clock source */
pllvco = ((float_t)CSI_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
break;
case RCC_PLLCKSELR_PLLSRC_HSE: /* HSE used as PLL clock source */
pllvco = ((float_t)HSE_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
break;
default:
hsivalue = (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3)) ;
pllvco = ((float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 );
break;
}
pllp = (((RCC->PLL1DIVR & RCC_PLL1DIVR_P1) >>9) + 1U ) ;
common_system_clock = (uint32_t)(float_t)(pllvco/(float_t)pllp);
}
else
{
common_system_clock = 0U;
}
break;
default:
common_system_clock = (uint32_t) (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3));
break;
}
/* Compute SystemClock frequency --------------------------------------------------*/
#if defined (RCC_D1CFGR_D1CPRE)
tmp = D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_D1CPRE)>> RCC_D1CFGR_D1CPRE_Pos];
/* common_system_clock frequency : CM7 CPU frequency */
common_system_clock >>= tmp;
/* SystemD2Clock frequency : CM4 CPU, AXI and AHBs Clock frequency */
SystemD2Clock = (common_system_clock >> ((D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_HPRE)>> RCC_D1CFGR_HPRE_Pos]) & 0x1FU));
#else
tmp = D1CorePrescTable[(RCC->CDCFGR1 & RCC_CDCFGR1_CDCPRE)>> RCC_CDCFGR1_CDCPRE_Pos];
/* common_system_clock frequency : CM7 CPU frequency */
common_system_clock >>= tmp;
/* SystemD2Clock frequency : AXI and AHBs Clock frequency */
SystemD2Clock = (common_system_clock >> ((D1CorePrescTable[(RCC->CDCFGR1 & RCC_CDCFGR1_HPRE)>> RCC_CDCFGR1_HPRE_Pos]) & 0x1FU));
#endif
#if defined(DUAL_CORE) && defined(CORE_CM4)
SystemCoreClock = SystemD2Clock;
#else
SystemCoreClock = common_system_clock;
#endif /* DUAL_CORE && CORE_CM4 */
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
``` |
Petra Kronberger (born 21 February 1969) is an Austrian former alpine skier, who participated in all disciplines. She was the first female alpine skier to win in all five World Cup events.
Career
Kronberger entered the World Cup circuit in the 1987/88 season. She gained several podiums and was expected to be a strong competitor at the 1988 Winter Olympic Games in Calgary. She did not win any medals there, but she did give a good performance for an athlete still in her teen years: she finished sixth in the downhill and eleventh in the combined.
Kronberger only won her first World Cup events, two downhill races, in December 1989, but by the end of that season, she had captured the World Cup overall title. This made her an instant hero in Austria: ever since that country's skiing star of the 1970s, Annemarie Pröll (later Moser-Pröll) had retired, the Swiss team had almost completely dominated the alpine world, which had long rankled the Austrian fans.
She successfully defended her World Cup overall champion title twice. Over the course of thirty-eight days in December 1990 and January 1991, Kronberger became the first skier in the modern era to win one race in each of the five alpine events in one season. Four of those wins in all but the combined came in the month of December alone, another notable feat.
At the 1991 World Championships she won a gold medal in her first event, the downhill, and was suspected to be able to win four more medals. However, she fell in her second event, the Super-G, and injured her right knee, forcing her to miss the rest of the races. (Despite her fall, she still finished sixth in that event.)
Her performances at the 1992 Winter Olympic Games in Albertville, France, were even better. She won two gold medals, one in the slalom and one in the combined, and finished a respectable fourth (with only 0.01 sec. behind the podium) the Super-G, and fifth in the downhill.
It was a great surprise when she retired as alpine skier on December 28, 1992. She said, that she had lost her motivation.
After career
Kronberger did catch up on her matriculation, did start studies in German philology and history of art at the university in the borough of Salzburg, did act as an assistant at a university. In later time she lived in Berlin and Hamburg. After dissolution she returned to the borough of Salzburg. She did work in adult vocational training and was an art guide in the "Salzburg Museum" (museum in Salzburg) and "Festung Hohensalzburg" ("Hohensalzburg Castle"), and she was a member of the Organizing Committee of the FIS Alpine Skiing World Championships 2013 at Schladming. She also is a singer in the "Salzburger Domchor" (cathedral choir at Salzburg) and the "KlangsCala" (a famous chamber choir in Salzburg). - Since November 2015, she is employed at the Austrian Skiing Federation, and since January 16, 2016, she is a "Frauenbeauftragte" (maybe translated as commissioner for women's affairs) there (cit. the German Wikipedia).
World Cup victories
Overall
Individual races
References
External links
1969 births
Living people
Austrian female alpine skiers
Olympic alpine skiers for Austria
Alpine skiers at the 1988 Winter Olympics
Alpine skiers at the 1992 Winter Olympics
Olympic gold medalists for Austria
Olympic medalists in alpine skiing
FIS Alpine Ski World Cup champions
Medalists at the 1992 Winter Olympics
20th-century Austrian women
21st-century Austrian women |
```c++
// filesys.cpp -- <experimental/filesystem> implementation
// (see filesystem.cpp for C++17 <filesystem> implementation)
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <yvals.h>
#include "awint.h"
#include <direct.h>
#include <experimental/filesystem>
#include <io.h>
#include <string.h>
#include <Windows.h>
_FS_BEGIN
static file_type _Map_mode(int _Mode) { // map Windows file attributes to file_status
constexpr int _File_attribute_regular =
FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_COMPRESSED | FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_HIDDEN
| FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_READONLY
| FILE_ATTRIBUTE_SPARSE_FILE | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_TEMPORARY;
if ((_Mode & FILE_ATTRIBUTE_DIRECTORY) != 0) {
return file_type::directory;
} else if ((_Mode & _File_attribute_regular) != 0) {
return file_type::regular;
} else {
return file_type::unknown;
}
}
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Close_dir(void* _Handle) { // close a directory
FindClose((HANDLE) _Handle);
}
// DIRECTORY FUNCTIONS
static wchar_t* _Strcpy(wchar_t (&_Dest)[_MAX_FILESYS_NAME], const wchar_t* _Src) { // copy an NTCTS
::wcscpy_s(_Dest, _MAX_FILESYS_NAME, _Src);
return _Dest;
}
static HANDLE _FilesysOpenFile(const wchar_t* _Fname, DWORD _Desired_access, DWORD _Flags) {
#if defined(_CRT_APP)
CREATEFILE2_EXTENDED_PARAMETERS _Create_file_parameters = {};
_Create_file_parameters.dwSize = sizeof(_Create_file_parameters);
_Create_file_parameters.dwFileFlags = _Flags;
return CreateFile2(_Fname, _Desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, OPEN_EXISTING,
&_Create_file_parameters);
#else // defined(_CRT_APP)
return CreateFileW(
_Fname, _Desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, _Flags, 0);
#endif // defined(_CRT_APP)
}
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir(
wchar_t (&_Dest)[_MAX_FILESYS_NAME], void* _Handle, file_type& _Ftype) { // read a directory entry
WIN32_FIND_DATAW _Dentry;
for (;;) {
if (FindNextFileW((HANDLE) _Handle, &_Dentry) == 0) { // fail
_Ftype = file_type::unknown;
return _Strcpy(_Dest, L"");
}
if (_Dentry.cFileName[0] != L'.'
|| (_Dentry.cFileName[1] != L'\0'
&& (_Dentry.cFileName[1] != L'.'
|| _Dentry.cFileName[2] != L'\0'))) { // not "." or "..", get file type and return name
_Ftype = _Map_mode(_Dentry.dwFileAttributes);
return _Strcpy(_Dest, &_Dentry.cFileName[0]);
}
}
}
static unsigned int _Filesys_code_page() { // determine appropriate code page
#if defined(_ONECORE)
return CP_ACP;
#else // defined(_ONECORE)
if (AreFileApisANSI()) {
return CP_ACP;
} else {
return CP_OEMCP;
}
#endif // defined(_ONECORE)
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _To_wide(const char* _Bsrc, wchar_t* _Wdest) {
// return nonzero on success
return MultiByteToWideChar(_Filesys_code_page(), 0, _Bsrc, -1, _Wdest, _MAX_FILESYS_NAME);
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _To_byte(const wchar_t* _Wsrc, char* _Bdest) {
// return nonzero on success
return WideCharToMultiByte(_Filesys_code_page(), 0, _Wsrc, -1, _Bdest, _MAX_FILESYS_NAME, nullptr, nullptr);
}
_FS_DLL void* __CLRCALL_PURE_OR_CDECL _Open_dir(
wchar_t (&_Dest)[_MAX_FILESYS_NAME], const wchar_t* _Dirname, int& _Errno, file_type& _Ftype) {
// open a directory for reading
WIN32_FIND_DATAW _Dentry;
wstring _Wildname(_Dirname);
if (!_Wildname.empty()) {
_Wildname.append(L"\\*");
}
void* _Handle =
FindFirstFileExW(_Wildname.c_str(), FindExInfoStandard, &_Dentry, FindExSearchNameMatch, nullptr, 0);
if (_Handle == INVALID_HANDLE_VALUE) { // report failure
_Errno = ERROR_BAD_PATHNAME;
*_Dest = L'\0';
return 0;
}
// success, get first directory entry
_Errno = 0;
if (_Dentry.cFileName[0] == L'.'
&& (_Dentry.cFileName[1] == L'\0'
|| _Dentry.cFileName[1] == L'.' && _Dentry.cFileName[2] == L'\0')) { // skip "." and ".."
_Read_dir(_Dest, _Handle, _Ftype);
if (_Dest[0] != L'\0') {
return _Handle;
}
// no entries, release handle
_Close_dir(_Handle);
return 0;
}
// get file type and return handle
_Strcpy(_Dest, &_Dentry.cFileName[0]);
_Ftype = _Map_mode(_Dentry.dwFileAttributes);
return _Handle;
}
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_get(wchar_t (&_Dest)[_MAX_FILESYS_NAME]) {
// get current working directory
_Strcpy(_Dest, L"");
#if defined(_CRT_APP)
return false; // no support
#else // defined(_CRT_APP)
return _wgetcwd(_Dest, _MAX_FILESYS_NAME) != 0;
#endif // defined(_CRT_APP)
}
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set(const wchar_t* _Dirname) {
// set current working directory
#if defined(_CRT_APP)
(void) _Dirname;
return false; // no support
#else // defined(_CRT_APP)
return _wchdir(_Dirname) == 0;
#endif // defined(_CRT_APP)
}
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Symlink_get(wchar_t (&_Dest)[_MAX_FILESYS_NAME], const wchar_t*) {
// get symlink -- DUMMY
_Dest[0] = wchar_t(0);
return &_Dest[0];
}
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Temp_get(wchar_t (&_Dest)[_MAX_FILESYS_NAME]) {
// get temp directory
wchar_t _Dentry[MAX_PATH];
return _Strcpy(_Dest, GetTempPathW(MAX_PATH, &_Dentry[0]) == 0 ? L"." : &_Dentry[0]);
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Make_dir(const wchar_t* _Fname, const wchar_t*) {
// make a new directory (ignore attributes)
int _Ans = CreateDirectoryW(_Fname, 0);
if (_Ans != 0) {
return 1;
} else if (GetLastError() == ERROR_ALREADY_EXISTS) {
return 0;
} else {
return -1;
}
}
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Remove_dir(const wchar_t* _Fname) { // remove a directory
return _wrmdir(_Fname) != -1;
}
// FILE STATUS FUNCTIONS
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t* _Fname, perms* _Pmode) { // get file status
WIN32_FILE_ATTRIBUTE_DATA _Data;
if (GetFileAttributesExW(_Fname, GetFileExInfoStandard, &_Data)) {
// get file type and return permissions
if (_Pmode != 0) {
constexpr perms _Write_perms = perms::owner_write | perms::group_write | perms::others_write;
constexpr perms _Readonly_perms = perms::all & ~_Write_perms;
*_Pmode = _Data.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? _Readonly_perms : perms::all;
}
return _Map_mode(_Data.dwFileAttributes);
}
// invalid, get error code
int _Errno = GetLastError();
if (_Errno == ERROR_BAD_NETPATH || _Errno == ERROR_BAD_PATHNAME || _Errno == ERROR_FILE_NOT_FOUND
|| _Errno == ERROR_INVALID_DRIVE || _Errno == ERROR_INVALID_NAME || _Errno == ERROR_INVALID_PARAMETER
|| _Errno == ERROR_PATH_NOT_FOUND) {
return file_type::not_found;
} else {
return file_type::unknown;
}
}
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat(const wchar_t* _Fname, perms* _Pmode) {
// get symlink file status
return _Stat(_Fname, _Pmode); // symlink not supported
}
_FS_DLL unsigned long long __CLRCALL_PURE_OR_CDECL _Hard_links(const wchar_t* _Fname) {
// get hard link count
HANDLE _Handle = _FilesysOpenFile(_Fname, FILE_READ_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS);
#if defined(_CRT_APP)
FILE_STANDARD_INFO _Info = {0};
bool _Ok = false;
if (_Handle != INVALID_HANDLE_VALUE) { // get file info
_Ok = GetFileInformationByHandleEx(_Handle, FileStandardInfo, &_Info, sizeof(_Info)) != 0;
CloseHandle(_Handle);
}
return _Ok ? _Info.NumberOfLinks : static_cast<unsigned long long>(-1);
#else // defined(_CRT_APP)
BY_HANDLE_FILE_INFORMATION _Info = {0};
bool _Ok = false;
if (_Handle != INVALID_HANDLE_VALUE) { // get file info
_Ok = GetFileInformationByHandle(_Handle, &_Info) != 0;
CloseHandle(_Handle);
}
return _Ok ? _Info.nNumberOfLinks : static_cast<unsigned long long>(-1);
#endif // defined(_CRT_APP)
}
_FS_DLL unsigned long long __CLRCALL_PURE_OR_CDECL _File_size(const wchar_t* _Fname) { // get file size
WIN32_FILE_ATTRIBUTE_DATA _Data;
if (!GetFileAttributesExW(_Fname, GetFileExInfoStandard, &_Data)) {
return static_cast<unsigned long long>(-1);
} else {
return static_cast<unsigned long long>(_Data.nFileSizeHigh) << 32 | _Data.nFileSizeLow;
}
}
// 3 centuries with 24 leap years each:
// 1600 is excluded, 1700/1800 are not leap years
// 1 partial century with 17 leap years:
// 1900 is not a leap year
// 1904 is leap year #1
// 1908 is leap year #2
// 1968 is leap year #17
constexpr uint64_t _Win_ticks_per_second = 10000000ULL;
constexpr uint64_t _Win_ticks_from_epoch = ((1970 - 1601) * 365 + 3 * 24 + 17) * 86400ULL * _Win_ticks_per_second;
_FS_DLL int64_t __CLRCALL_PURE_OR_CDECL _Last_write_time(const wchar_t* _Fname) { // get last write time
WIN32_FILE_ATTRIBUTE_DATA _Data;
if (!GetFileAttributesExW(_Fname, GetFileExInfoStandard, &_Data)) {
return -1;
}
// success, convert time
unsigned long long _Wtime = static_cast<unsigned long long>(_Data.ftLastWriteTime.dwHighDateTime) << 32
| _Data.ftLastWriteTime.dwLowDateTime;
return static_cast<int64_t>(_Wtime - _Win_ticks_from_epoch);
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Set_last_write_time(const wchar_t* _Fname, int64_t _When) {
// set last write time
HANDLE _Handle = _FilesysOpenFile(_Fname, FILE_WRITE_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS);
if (_Handle == INVALID_HANDLE_VALUE) {
return 0;
}
// convert to FILETIME and set
unsigned long long _Wtime = static_cast<unsigned long long>(_When) + _Win_ticks_from_epoch;
FILETIME _Ft;
_Ft.dwLowDateTime = static_cast<DWORD>(_Wtime); // intentionally discard upper bits
_Ft.dwHighDateTime = static_cast<DWORD>(_Wtime >> 32);
int _Result = SetFileTime(_Handle, nullptr, nullptr, &_Ft);
CloseHandle(_Handle);
return _Result;
}
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs(const wchar_t* _Fname) {
// get space information for volume
space_info _Ans = {static_cast<uintmax_t>(-1), static_cast<uintmax_t>(-1), static_cast<uintmax_t>(-1)};
wstring _Devname = _Fname;
if (_Devname.empty() || _Devname.back() != L'/' && _Devname.back() != L'\\') {
_Devname.push_back(L'/');
}
_ULARGE_INTEGER _Available, _Capacity, _Free;
if (GetDiskFreeSpaceExW(_Devname.c_str(), &_Available, &_Capacity, &_Free)) { // convert values
_Ans.capacity = _Capacity.QuadPart;
_Ans.free = _Free.QuadPart;
_Ans.available = _Available.QuadPart;
}
return _Ans;
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent(
const wchar_t* _Fname1, const wchar_t* _Fname2) { // test for equivalent file names
#if defined(_CRT_APP)
_FILE_ID_INFO _Info1 = {0};
_FILE_ID_INFO _Info2 = {0};
bool _Ok1 = false;
bool _Ok2 = false;
HANDLE _Handle = _FilesysOpenFile(_Fname1, FILE_READ_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS);
if (_Handle != INVALID_HANDLE_VALUE) { // get file1 info
_Ok1 = GetFileInformationByHandleEx(_Handle, FileIdInfo, &_Info1, sizeof(_Info1)) != 0;
CloseHandle(_Handle);
}
_Handle = _FilesysOpenFile(_Fname2, FILE_READ_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS);
if (_Handle != INVALID_HANDLE_VALUE) { // get file2 info
_Ok2 = GetFileInformationByHandleEx(_Handle, FileIdInfo, &_Info2, sizeof(_Info2)) != 0;
CloseHandle(_Handle);
}
if (!_Ok1 && !_Ok2) {
return -1;
} else if (!_Ok1 || !_Ok2) {
return 0;
} else { // test existing files for equivalence
return _Info1.VolumeSerialNumber != _Info2.VolumeSerialNumber
|| memcmp(&_Info1.FileId, &_Info2.FileId, sizeof(_Info1.FileId)) != 0
? 0
: 1;
}
#else // defined(_CRT_APP)
BY_HANDLE_FILE_INFORMATION _Info1 = {0};
BY_HANDLE_FILE_INFORMATION _Info2 = {0};
bool _Ok1 = false;
bool _Ok2 = false;
HANDLE _Handle = _FilesysOpenFile(_Fname1, FILE_READ_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS);
if (_Handle != INVALID_HANDLE_VALUE) { // get file1 info
_Ok1 = GetFileInformationByHandle(_Handle, &_Info1) != 0;
CloseHandle(_Handle);
}
_Handle = _FilesysOpenFile(_Fname2, FILE_READ_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS);
if (_Handle != INVALID_HANDLE_VALUE) { // get file2 info
_Ok2 = GetFileInformationByHandle(_Handle, &_Info2) != 0;
CloseHandle(_Handle);
}
if (!_Ok1 && !_Ok2) {
return -1;
} else if (!_Ok1 || !_Ok2) {
return 0;
} else { // test existing files for equivalence
return _Info1.dwVolumeSerialNumber != _Info2.dwVolumeSerialNumber
|| _Info1.nFileIndexHigh != _Info2.nFileIndexHigh || _Info1.nFileIndexLow != _Info2.nFileIndexLow
? 0
: 1;
}
#endif // defined(_CRT_APP)
}
// FILE LINKAGE FUNCTIONS
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t* _Fname1, const wchar_t* _Fname2) {
// link _Fname2 to _Fname1
#if defined(_CRT_APP)
(void) _Fname1;
(void) _Fname2;
return errno = EDOM; // hardlinks not supported
#else // defined(_CRT_APP)
return CreateHardLinkW(_Fname2, _Fname1, 0) != 0 ? 0 : GetLastError();
#endif // defined(_CRT_APP)
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t* _Fname1, const wchar_t* _Fname2) {
// link _Fname2 to _Fname1
#if defined(_CRT_APP)
(void) _Fname1;
(void) _Fname2;
return errno = EDOM; // symlinks not supported
#else // defined(_CRT_APP)
return __crtCreateSymbolicLinkW(_Fname2, _Fname1, 0) != 0 ? 0 : GetLastError();
#endif // defined(_CRT_APP)
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename(const wchar_t* _Fname1, const wchar_t* _Fname2) {
// rename _Fname1 as _Fname2
return _wrename(_Fname1, _Fname2) == 0 ? 0 : GetLastError();
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Resize(const wchar_t* _Fname, uintmax_t _Newsize) { // change file size
bool _Ok = false;
HANDLE _Handle = _FilesysOpenFile(_Fname, FILE_GENERIC_WRITE, 0);
if (_Handle != INVALID_HANDLE_VALUE) { // set file pointer to new size and trim
LARGE_INTEGER _Large;
_Large.QuadPart = _Newsize;
_Ok = SetFilePointerEx(_Handle, _Large, 0, FILE_BEGIN) != 0 && SetEndOfFile(_Handle) != 0;
CloseHandle(_Handle);
}
return _Ok ? 0 : GetLastError();
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink(const wchar_t* _Fname) { // unlink _Fname
return _wremove(_Fname) == 0 ? 0 : GetLastError();
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t* _Fname1, const wchar_t* _Fname2) {
// copy _Fname1 to _Fname2
#if defined(_ONECORE)
COPYFILE2_EXTENDED_PARAMETERS _Params = {0};
_Params.dwSize = sizeof(COPYFILE2_EXTENDED_PARAMETERS);
_Params.dwCopyFlags = 0;
const HRESULT _Copy_result = CopyFile2(_Fname1, _Fname2, &_Params);
if (SUCCEEDED(_Copy_result)) {
return 0;
}
// take lower bits to undo HRESULT_FROM_WIN32
return _Copy_result & 0x0000FFFFU;
#else // defined(_ONECORE)
return CopyFileW(_Fname1, _Fname2, 0) != 0 ? 0 : GetLastError();
#endif // defined(_ONECORE)
}
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Chmod(const wchar_t* _Fname, perms _Newmode) {
// change file mode to _Newmode
WIN32_FILE_ATTRIBUTE_DATA _Data;
if (!GetFileAttributesExW(_Fname, GetFileExInfoStandard, &_Data)) {
return -1;
}
// got mode, alter readonly bit
DWORD _Oldmode = _Data.dwFileAttributes;
DWORD _Mode = _Oldmode & ~FILE_ATTRIBUTE_READONLY;
constexpr perms _Write_perms = perms::owner_write | perms::group_write | perms::others_write;
if ((_Newmode & _Write_perms) == perms::none) {
_Mode |= FILE_ATTRIBUTE_READONLY;
}
return _Mode == _Oldmode ? 0 : SetFileAttributesW(_Fname, _Mode) != 0 ? 0 : -1;
}
_FS_END
``` |
The Padua–Treviso–Venice metropolitan area (PaTreVe) or Venice city–region is the urban agglomeration centred on the cities of Padova, Treviso, and Venice in the Veneto region of northeast Italy. It is defined statistically and does not correspond to a single area of local government. Administratively it comprises the communes (municipalities) of the three cities plus another 240 communes (104 in the province of Padua, 95 in the province of Treviso and 44 in the province of Venice).
The metropolitan area has a total population of 2,600,000.
References
Geography of Veneto |
```python
#
#
#
# path_to_url
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
import torch
import time
import argparse
from ipex_llm.transformers import AutoModelForCausalLM
from transformers import AutoTokenizer
# prompt format referred from path_to_url
# and path_to_url#L7-L49
# For English prompt, you are recommended to change the prompt format.
BAICHUAN_PROMPT_FORMAT = "<reserved_106> {prompt} <reserved_107>"
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Predict Tokens using `generate()` API for Baichuan model')
parser.add_argument('--repo-id-or-model-path', type=str, default="baichuan-inc/Baichuan2-7B-Chat",
help='The huggingface repo id for the Baichuan model to be downloaded'
', or the path to the huggingface checkpoint folder')
parser.add_argument('--prompt', type=str, default="AI",
help='Prompt to infer')
parser.add_argument('--n-predict', type=int, default=32,
help='Max tokens to predict')
args = parser.parse_args()
model_path = args.repo_id_or_model_path
# Load model in 4 bit,
# which convert the relevant layers in the model into INT4 format
# if your selected model is capable of utilizing previous key/value attentions
# to enhance decoding speed, but has `"use_cache": false` in its model config,
# it is important to set `use_cache=True` explicitly in the `generate` function
# to obtain optimal performance with IPEX-LLM INT4 optimizations
# When running LLMs on Intel iGPUs for Windows users, we recommend setting `cpu_embedding=True` in the from_pretrained function.
# This will allow the memory-intensive embedding layer to utilize the CPU instead of iGPU.
model = AutoModelForCausalLM.from_pretrained(model_path,
load_in_4bit=True,
trust_remote_code=True,
use_cache=True)
model = model.half().to('xpu')
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_path,
trust_remote_code=True)
# Generate predicted tokens
with torch.inference_mode():
prompt = BAICHUAN_PROMPT_FORMAT.format(prompt=args.prompt)
input_ids = tokenizer.encode(prompt, return_tensors="pt").to('xpu')
# ipex_llm model needs a warmup, then inference time can be accurate
output = model.generate(input_ids,
max_new_tokens=args.n_predict)
# start inference
st = time.time()
output = model.generate(input_ids,
max_new_tokens=args.n_predict)
torch.xpu.synchronize()
end = time.time()
output = output.cpu()
output_str = tokenizer.decode(output[0], skip_special_tokens=True)
print(f'Inference time: {end-st} s')
print('-'*20, 'Prompt', '-'*20)
print(prompt)
print('-'*20, 'Output', '-'*20)
print(output_str)
``` |
Leonard Ray Dawson (June 20, 1935 – August 24, 2022) was an American professional football quarterback who played in the National Football League (NFL) and American Football League (AFL) for 19 seasons, primarily with the Kansas City Chiefs franchise. After playing college football at Purdue, Dawson began his professional career with the NFL in 1957, spending three seasons with the Pittsburgh Steelers and two with the Cleveland Browns. He left the NFL in 1962 to sign with the AFL's Chiefs (then known as the Dallas Texans), where he spent the last 14 seasons of his career, and rejoined the NFL after the AFL–NFL merger.
In the AFL, Dawson led the league in completion percentage seven times, passer rating six times, and passing touchdowns four times. He was named Most Valuable Player in 1962 and selected to six AFL All-Star games. Dawson also guided the Chiefs to three AFL championships and the franchise's first Super Bowl title in Super Bowl IV, of which he was named MVP. He retired from professional football after the 1975 season and later served as the sports director at KMBC-TV in Kansas City and color analyst for the Chiefs Radio Network. His demeanor and style earned him the nickname "Lenny the Cool" from his teammates.
Early life
Dawson was the 9th of 11 children of Ohio native James and England-born Annie Dawson. He attended Alliance High School in Alliance, Ohio. He was MVP of the football team and was named outstanding Ohio back of the year by the International News Service. A three-sport athlete, Dawson set school records in football and basketball, and was the first athlete in 13 years to be named first-team all-state in both sports during the same year.
College career
During the recruiting process, Dawson had to choose between the Ohio State University in Columbus and Purdue University in Indiana. While he was reluctant to take over Woody Hayes' split-T offense with the Buckeyes, the true reason he selected Purdue stemmed from the rapport he had established with assistant coach Hank Stram, beginning a friendship that would last for more than a half-century.
As a sophomore in 1954, Dawson's first as the Boilermakers' quarterback, he was the NCAA's leader in pass efficiency, while also playing defense and serving as the team's kicker. Behind a strong offensive line, he threw four touchdown passes in a 31–0 victory over Missouri, then later engineered a huge upset of Notre Dame, which had entered the contest on a 13-game winning streak.
During three seasons (1954–1956) with the Boilermakers, Dawson threw for 3,325 yards and 29 touchdowns, leading the Big Ten Conference in that category during each year. He was named All-American (3rd Team) during the 1956 season. He was an All-Big Ten Quarterback during the 1955 and 1956 seasons.
While at Purdue, Dawson was initiated into the Alpha Tau Omega fraternity.
Professional career
Pittsburgh Steelers
Dawson was the fifth overall selection in the 1957 NFL Draft, taken by the Pittsburgh Steelers, but he was unable to make an impact. Following his rookie season in 1957, his status became more tenuous when the Steelers acquired future Hall of Famer Bobby Layne early in the 1958 season.
Cleveland Browns
Dawson was traded to the Cleveland Browns on December 31, 1959. However, after encountering similar problems in battling Browns quarterback Milt Plum, Dawson was released after the 1961 season, having completed only 21 passes for 204 yards and two touchdowns in his five seasons of NFL play.
Dallas Texans/Kansas City Chiefs
Dawson signed with the American Football League's Dallas Texans on June 30, 1962. The move reunited him with Stram, who was beginning his third year as the Texans' head coach.
In 1962, Dawson led the league in touchdowns and yards per attempt, and was the Sporting News selection as the AFL MVP. He also led Dallas to the first of three league titles in a thrilling double-overtime victory over the two-time defending champion Oilers in Houston. Dawson ran a ball-control offense in the 20–17 win, and tossed a 28-yard touchdown pass to halfback Abner Haynes.
The team moved north to Kansas City and was renamed to the Chiefs in 1963.
A pinpoint passer, Dawson's mobility helped him flourish in Stram's "moving pocket" offense. He would win four AFL passing titles and was selected as a league All-Star six times, ending the 10-year run of the league as its highest-rated career passer. From 1962 to 1969, Dawson threw more touchdown passes (182) than any other professional football quarterback. In 1966, Dawson led the Chiefs to an 11–2–1 record and a 31–7 win over the Buffalo Bills in the AFL Championship Game, earning his team the honor of representing the AFL in Super Bowl I, the first championship game between the AFL and their NFL rivals. The NFL champion Green Bay Packers won easily, 35–10, but Dawson performed fairly well, completing 16 of 27 passes for 210 yards and one touchdown, with one interception. Dawson was selected by his peers as a Sporting News 1966 AFL All-League player.
Though he threw for more than 2,000 yards in each of the previous seven campaigns, Dawson's 1969 season with Kansas City would be his most memorable because of his dramatic comeback from a knee injury suffered in the season's second game. The injury was at first feared to be season-ending, but after missing five games, Dawson went on to lead the Chiefs to road playoff victories over both the defending Super Bowl champion New York Jets and the Oakland Raiders. He then capped his year with MVP accolades in Super Bowl IV, the last game ever played by an American Football League team. In the game, Dawson paced the Chiefs to a win over the NFL's heavily favored Minnesota Vikings by completing 12 of 17 passes for 142 yards and a touchdown, with one interception, and rushing for 11 yards. The performance was especially notable given that Dawson had been mistakenly linked to a gambling scandal (by an unrelated gentleman who was named Donald Dawson) in the days leading up to the game.
On November 1, 1970, the Chiefs led the Oakland Raiders 17–14 late in the fourth quarter. Facing third and long, a run by Dawson apparently sealed victory for the Chiefs, but as Dawson lay on the ground, he was speared by Raiders' defensive end Ben Davidson, who dove into Dawson with his helmet, provoking Chiefs' receiver Otis Taylor to attack Davidson. After a bench-clearing brawl, offsetting penalties were called, nullifying the first down under the rules in effect at that time. The Chiefs were obliged to punt, and the Raiders tied the game on a George Blanda field goal with eight seconds to play. Taylor's retaliation against Davidson not only cost the Chiefs a win, but Oakland won the AFC West with a season record of 8–4–2, while Kansas City finished 7–5–2 and out of the playoffs.
Retirement and legacy
Dawson announced his retirement in May 1976, shortly before turning 41. Dawson ended his career in 1975, having completed 2,136 of 3,741 passes for 28,711 yards and 239 touchdowns, with 181 interceptions. He also gained 1,293 rushing yards and nine rushing touchdowns in his career.
Dawson owned the Chiefs' single-season passing touchdown record, which he set in 1964 with 30 touchdowns, a record that stood until 2018, when Patrick Mahomes broke it. He still owns the Chiefs career passing yards, touchdowns, and wins records despite last playing in 1975, the NFL expanding to 16 game seasons, and the evolution into the NFL being a pass-dominated league. He was inducted into the Chiefs Hall of Fame in 1979 and the Pro Football Hall of Fame in 1987. His number 16 was retired by the Chiefs. He was also named to the American Football League All-Time Team in 1970.
After professional football
In 1966, while still playing for the Chiefs, Dawson became sports director at KMBC-TV in Kansas City. On March 16, 2009, Dawson announced he would step down from anchoring on a nightly basis but would still report for KMBC during the Chiefs football season and would fill in when other anchors were on leave.
From 1977 to 2001, Dawson hosted HBO's Inside the NFL. He also worked as an analyst for NBC's AFC coverage from 1977 to 1982. From 1985 to 2017, Dawson was the color analyst for the Chiefs' radio broadcast team. In 2012, Dawson was honored with the Pete Rozelle Radio-Television Award presented by the Pro Football Hall of Fame for his longtime contributions as a sports broadcaster. At the beginning of his final season as the Chiefs radio analyst, the Chiefs named their broadcast booth at Arrowhead Stadium after Dawson.
In 1979, Dawson was enshrined in the Kansas City Chiefs Hall of Fame, followed by induction into the Pro Football Hall of Fame in 1987 and Purdue's Intercollegiate Athletics Hall of Fame in 1996. In 2008, he was awarded the Walter Camp Distinguished American Award.
In 2006, Dawson was interviewed for the NFL Network documentary America's Game: The Super Bowl Champions chronicling the 1969 Kansas City Chiefs season.
Dawson teamed with Depend in 1998 to encourage men to visit their doctors and to be screened for prostate cancer.
Personal life and death
Dawson was the seventh son of a seventh son, born the ninth of 11 children overall. He was married to his high school sweetheart from 1954 until her death in 1978. He had two children. He later remarried and remained married until his death.
In 1991, Dawson was diagnosed with prostate cancer.
On August 12, 2022, Dawson's family announced that he had entered hospice care at the University of Kansas Medical Center in Kansas City, Kansas. He died on August 24, at the age of 87.
The Chiefs wore a decal with the number 16 on their helmets for the entire 2022 season in honor of Dawson. Before the Chiefs first offensive play of the preseason game the day after his death, the Chiefs lined in huddle popularized by Dawson where the quarterback stands in front of all other 10 offensive players instead of the quarterback standing in the middle with the players making a circle around him.
Career statistics
See also
List of NCAA major college football yearly passing leaders
List of American Football League players
List of Super Bowl MVPs
List of Super Bowl starting quarterbacks
References
External links
1935 births
2022 deaths
American Conference Pro Bowl players
American Football League All-League players
American Football League All-Star players
American Football League All-Time Team
American Football League Most Valuable Players
American Football League players
American football quarterbacks
American people of English descent
American television sports announcers
Cleveland Browns players
College football announcers
Dallas Texans (AFL) players
Kansas City Chiefs announcers
Kansas City Chiefs players
National Football League announcers
National Football League players with retired numbers
People from Alliance, Ohio
Players of American football from Stark County, Ohio
Pete Rozelle Radio-Television Award recipients
Pittsburgh Steelers players
Pro Football Hall of Fame inductees
Purdue Boilermakers football players
Sportspeople from the Kansas City metropolitan area
Super Bowl MVPs |
Netflix is a subscription streaming service owned by the American company Netflix, Inc. Launched on August 29, 1997, it initially offered DVD rental and sale by mail, but the sales were eliminated within a year to focus on the DVD rental business. In 2007, the company began transitioning to its current subscription streaming model. Since its launch, the company has been subject to numerous criticisms, the basis of which range from its business practices and workplace culture to issues with the service it provides, including content issues, lack of close captioning and pricing. This article provides an overview of key criticisms the company has faced.
Artistic concerns
Film creator concern with allowing users to change playback speed
In October 2019, Netflix began to experiment with allowing users to change the speed at which content is being played, ranging from half the original speed, to up to one-and-a-half times faster the original speed. The feature was deployed to selected users of the service's Android app. The feature was criticized by various members of the film industry, who argued that it harmed the artistic integrity of their work. Netflix vice president Keela Robison stated that the feature "generated a fair amount of feedback – both for and against", and noted use cases for slowing down playback, such as helping viewers locate details in scenes, or making it easier to understand dialogue in foreign languages if they are still learning the language. Robison also noted that they had deliberately limited the rollout of the feature due to "creator concerns", and that such functions had already been available on DVD players.
Showing copyrighted subtitles of Bicycle Thieves
In 2015, Netflix and Cinedigm were sued by Corinth Films over its streaming of the 1948 Italian film Bicycle Thieves; although the film itself was considered public domain in the United States, distinct subtitling or dubbing of the film can still be considered a separate and copyrightable work. Corinth alleged that the specific version of the film, registered by Richard Feiner & Co. and owned by Corinth, was being licensed by Cinedigm to Netflix without permission. The parties later settled.
Eligibility for Academy Awards
Steven Spielberg, governor of the directive branch of the Academy of Motion Picture Arts and Sciences (AMPAS), has questioned about the eligibility of Netflix's feature films for Academy Award nominations. since films are released simultaneously in cinemas and via video on demand, in defiance of the standard three-month release window. While Netflix had previously given its theatrical acquisitions a simultaneous release in theaters and streaming, Roma was the first under a new policy to provide at least a three-week theatrical run before streaming release. According to the official rules of the Academy, a film only needs to be screened in the city of Los Angeles for seven days, with a minimum of three public showings per-day, to qualify for an Oscar nomination. However, the eligibility criteria do allow for simultaneous releases on non-theatrical platforms.
Spielberg complained that films "that are just given token qualifications in a couple of theaters for less than a week" shouldn't qualify. Following the 91st Academy Awards (where Roma became the first film distributed by a streaming service to be nominated for Best Picture, and won Best Foreign Language Film and two other awards), a spokesperson for Spielberg's studio Amblin Partners stated that he "feels strongly about the difference between the streaming and theatrical situation", and would address the issue at the Academy's next board of governors meeting in April 2019.
Critics argued that Roma had an unfair advantage, singling out the service's wide availability, refusal to report box office numbers, disrespect of the industry's standard release windows with only three weeks of exclusive theatrical play (although it is not uncommon for some nominees to only receive the week-long minimum run), and excessive marketing spend (with reports ranging between $25 and $50 million, although its Oscars marketing was rolled into Netflix's overall marketing budget, which should not be). Due to its contravention of the standard three-month windows used by all major distributors, national cinema chains have refused to carry Netflix's theatrical releases. Netflix defended its distribution model, arguing that it was devoted to "[providing] access for people who can't always afford, or live in towns without, theaters. Letting everyone, everywhere enjoy releases at the same time. Giving filmmakers more ways to share art. These things are not mutually exclusive."
The U.S. Department of Justice warned the Academy that attempts to change its rules to discriminate against Netflix and other streaming platforms could violate antitrust law, as the parent companies of the traditional major studios (in particular, AT&T and Disney) have been making investments into streaming services that directly compete with Netflix.
In April 2019, the Academy voted against making any changes to its eligibility criteria, but AMPAS president John Bailey stated that the organization would study changes to the industry.
Spielberg missed the meeting due to his ongoing work on a remake of West Side Story. In a remark to The New York Times, Spielberg stated that while people should still have access to theatrical releases due to the communal experience that they provide, they should, at the same time, be able to "find their entertainment in any form or fashion that suits them", and that "what really matters to me is a great story and everyone should have access to great stories."
Beginning at the 2019 Toronto International Film Festival, films may now be restricted from screening at Scotiabank Theatre Toronto—one of the festival's main venues—and screened elsewhere (such as TIFF Bell Lightbox and other local cinemas) if distributed by a service such as Netflix. Organizers stated that the restriction was due to a policy enforced by the facility's owner and operator, Cineplex Entertainment, requiring adherence to three-month theatrical windows.
Quantity over quality
Netflix has increasingly offered large quantities of original content as part of its lineup. However, the outlet has been criticized by viewers and critics for the overall low quality of most of the output. One such critic, Hayley Campbell, commented on BBC Sounds' Must Watch podcast that one possible reason for Netflix's loss of subscribers in the 2020s is due to a lack of high-quality content on Netflix. She contrasted this with the Apple TV+ strategy of investing in a small number of high-quality projects, and with the focus of Amazon Prime Video on third-party content.
Netflix originals
Its distribution model for films labeled "Netflix originals" has led to conflicts with the legacy of the film industry. Some cinema chains have refused to screen films distributed theatrically by Netflix as the company's release method reduces or extinguishes standard release windows. After COVID-19 mandates forced theaters around the country to close for several months in 2020, the next year WarnerMedia, Disney and Universal each released films on their respective streaming services, HBO Max, Disney+, and Peacock, on the same day they were released in theaters.
Controversial content
Use of censored version of Back to the Future Part II
In May 2020, a scene from Back to the Future Part II involving the Oh LàLà adult magazine cover that Marty McFly discovers and mistakes for a stolen sports almanac that he traveled back in time to collect, and two lines from McFly, were censored, which led to criticism from film preservationists and fans. Netflix quickly restored the original scene after hearing the issue from co-writer Bob Gale, mentioning that it was apparently "a foreign version which he or Robert Zemeckis didn't even know existed, for some country that had a problem with the magazine cover". Netflix does not edit films and used a version that it received.
Use of footage from Lac-Mégantic rail disaster
In late 2018, Netflix faced criticism for its use of stock footage from the 2013 Lac-Mégantic rail disaster in multiple original productions, including the series Travelers, and the film Bird Box. In March 2019, the footage was replaced in both works.
Content critical of the Saudi Arabian government
In January 2019, Netflix censored an episode of Patriot Act with Hasan Minhaj in Saudi Arabia after requests by the Communications and Information Technology Commission, citing material critical of the Saudi government (such as Mohammed bin Salman and the Saudi-led intervention in Yemen).
Partnership with Liu Cixin
Netflix's partnership with Liu Cixin, including inviting Liu to join as a consulting producer for a show based on his The Three-Body Problem, raised questions from U.S. politicians. Citing an interview by The New Yorker in which Liu expressed support for Chinese government policies such as the one-child policy and the Xinjiang re-education camps, five U.S. senators wrote a letter to Netflix asking whether it was aware of Liu's remarks and demanding a justification for proceeding with the adaptation of Liu's work. Netflix responded that Liu was not the creator of the show, and that Liu's comments "are not reflective of the views of Netflix or of the show's creators, nor are they part of the plot or themes of the show". The letter points to the challenge of whether the U.S. entertainment industry can work with creators in China and tell their stories without accidentally promoting China's propaganda or becoming complicit in human rights abuses.
Depictions of suicide in 13 Reasons Why
The 2017 Netflix original series 13 Reasons Why about a teenager who commits suicide and leaves behind tapes explaining her action was criticized for romanticizing, sensationalizing, and increasing interest in suicide, and "glorified and glamorized" issues such as depression and post-traumatic stress disorder. The program was criticized by mental health professionals. The company was criticized for not abiding by its moral responsibility.
In the months after the show was released, suicide rates among young people spiked, although it was not clear if that was a result of the show.
In March 2018, Netflix added additional viewer advisories and provided links to suicide prevention resources.
On July 16, 2019, Netflix announced that it had edited the first-season finale of the series to remove the graphic scene that depicted the main character's suicide, acknowledging that many young people were encouraged by the show to start conversations about depression and suicide and get help.
New Zealand's Classification Office created a new "RP18" rating (recommending parental guidance for viewers under 18) in response to 13 Reasons Why, arguing that although it contained graphic and objectionable portrayals of the act, "these issues need to be talked about in a way that is informed and safe – parents, guardians and other adults need to have open conversations with teens about the issues raised by the show."
Depiction of death camps in Poland
The makers of the 2019 documentary The Devil Next Door included a map made in 1985 which attempted to show where Nazi death camps stood relative to modern Polish borders. In response to complaints by Prime Minister Mateusz Morawiecki, Netflix agreed to insert additional text emphasizing that such camps were in occupied territory. This move was criticized for potentially legitimizing the Act on the Institute of National Remembrance, a 2018 Polish law that restricts how one may refer to the Holocaust.
Depictions of Jesus in The First Temptation of Christ and The Last Hangover
In December 2019, Netflix announced a special titled The First Temptation of Christ, which depicts Jesus as a homosexual figure who has a relationship with an atheist named Orlando. The series is a work of Porta dos Fundos, a Brazilian comedy group who became prominent through online media. The depiction of a homosexual Jesus and the scenes in which Mary is seen smoking marijuana caused outrage by many Netflix users in Brazil and resulted in requests by the Christian community in Brazil to suspend the series from the platform. Jesus' drunken depiction in The Last Hangover, also a work by Porta dos Fundos, in which Jesus's disciples wake up after a Last Supper raging party, has also caused controversy and was removed from the platform in Singapore.
Depictions of smoking
A July 2019 report by the anti-tobacco group Truth Initiative highlighted the amount of smoking portrayed in House of Cards and Orange Is the New Black as higher than on broadcast television, and noted nearly double the number of references to smoking between season 1 and season 2 of Stranger Things. In response to the report, Netflix stated it will make efforts to cut back on the depiction of smoking in its original series.
Content that promotes pseudoscience
In February 2019, Gwyneth Paltrow's lifestyle brand Goop, which has been criticized for making unsubstantiated claims about the effectiveness of the health treatments and products it promotes, signed a deal to produce a wellness-themed documentary series for Netflix. Critics argued that Netflix's move was "a win for pseudoscience." Once The Goop Lab was available for review, numerous media outlets published harsh criticism of Netflix's decision to promote Goop. Wired UK wrote several reviews critical of both The Goop Lab, and of Netflix for creating it, saying "Think Goop is bad? It's only the tip of Netflix's pseudoscience iceberg".
The accusations resurfaced later in 2020 with the addition of another Netflix Original, Down to Earth with Zac Efron. Writing for McGill University's Office for Science and Society, Jonathan Jarry argued the show is basically an advertisement for Darin Olien and the pseudoscience he espouses, from cancer-preventing superfoods to self-pasteurized raw goat milk. Jarry states that "the show consistently uses genuine ecological concerns to make us accept claims that do not hold water."
Previously, Netflix had been criticized for offering content by independent producers that presents wellness pseudoscience and conspiracy theories as true. Health professionals have quickly corrected several arguments made by the 2017 documentary What the Health, arguing the movie exaggerates the negative effects of eating eggs and downplays the risks of a diet rich in sugar.
The Australian Medical Association (AMA) called on Netflix to remove The Magic Pill from its catalog, a documentary narrated by celebrity chef Pete Evans claiming a ketogenic diet helps cure a variety of diseases, such as asthma and cancer. While some studies hint that some benefits can be gained from the diet, they did not support the claims made in the movie and the AMA insisted that promoting the diet without the supervision of qualified health professionals posed grave risks of developing nutritional deficiencies.
Sexualization of children in Cuties
Cuties, a 2020 French film distributed internationally by Netflix, drew controversy after its release due to claims it sexualized children, particularly in response to the poster originally displayed on the streaming platform, which displayed actors, some of whom were as young as 12 and were using pacifiers, in booty shorts and midriff-exposing tops, striking provocative dance poses.
Netflix tried to minimize public backlash by suppressing the film in search results prior to its release.
Politicians and government officials in Turkey and the United States made various complaints, including calling for the investigation of "possible violations of child exploitation and child pornography laws" and asking for the film to be voluntarily removed by Netflix. U.S. Senator Josh Hawley (R) of Missouri informally invited Netflix to discuss the film "before Congress" in a tweet. U.S. Senator Mike Lee (R) of Utah sent a letter directly to Netflix CEO Reed Hastings, and requested "an explanation on [Hasting's] views as to whether or not the potential exploitation of minors in this film constitutes criminal behavior". U.S. House Representative and former Democratic primary contender Tulsi Gabbard of Hawaii explicitly called the film "child porn" and that it would "whet the appetite of pedophiles [and] help fuel the child sex trafficking trade." U.S. Senator Ted Cruz of Texas sent a letter to the Department of Justice to "investigate whether Netflix, its executives, or the filmmakers violated any federal laws against the production and distribution of child pornography."
Christine Pelosi, daughter of U.S. House Speaker Nancy Pelosi, stated that Cuties "hypersexualizes girls my daughter's age no doubt to the delight of pedophiles like the ones I prosecuted." Senator Tom Cotton (R) of Arkansas and Representative Jim Banks (R) of Indiana also both criticised the film in separate statements calling for the DOJ to take legal action against Netflix, with Cotton saying "There's no excuse for the sexualization of children, and Netflix's decision to promote the film 'Cuties' is disgusting at best and a serious crime at worst". Representatives Ken Buck (R) of Colorado and Andy Biggs (R) of Arizona also called for the Department of Justice to investigate. The state attorneys general of Ohio, Florida, Louisiana, and Texas also asked for removal of the film.
The director of the film, Maïmouna Doucouré, stated in defense of the film that it "tries to show that our children should have the time to be children, and we as adults should protect their innocence and keep them innocent as long as possible." She also stated, "The problem, of course, is that they [preteens] are not women, and they don't realize what they are doing.... The girls [portrayed in the film performing in the local dance contest] don't have the maturity, however, to realize what their gestures and dance moves look like to the audience."
On September 23, 2020, Netflix was indicted by a Texas grand jury for "promotion of lewd visual material depicting a child".
Jokes about the transgender community in Dave Chapelle's The Closer
Netflix was criticized for purchasing the rights to The Closer, a special by Dave Chappelle.
Two transgender Netflix employees filed a complaint against Netflix with the National Labor Relations Board, alleging the company retaliated against them for speaking out against the comedian's most recent special.
Politically sensitive content
Netflix has encountered political controversy after its global expansion and for some of its international productions, including The Mechanism, which depicted a political kickbacks scandal in Brazil, Fauda, for its sympathetic depiction of Israeli commandos as well as for its sympathetic depiction of Palestinian terrorists and Amo, which portrays Rodrigo Duterte's hugely controversial drug war.
Netflix has been accused of pushing liberal or woke political ideology through their original movies and series. One highlighted example has been their series Dahmer – Monster: The Jeffrey Dahmer Story. While branded as historically accurate, the series modifies the story by characterizing non-black victims as black and portraying police distrust and abuse of black characters which did not exist or were not black.
Obeyed content takedown requests by governments
In February 2020, the company released its first report of compliance with government-requested content takedowns in countries, a total of 9 times since its launch:
In Singapore, requests to take down Cooking on High, The Legend of 420, and Disjointed in 2018, The Last Temptation of Christ in 2019, and The Last Hangover in 2020.
In Germany, a request to take down the 1990 remake of Night of the Living Dead in 2017.
In Vietnam, a request to take down Full Metal Jacket in 2017.
In New Zealand, a request to take down the film The Bridge in 2015. The film is deemed objectionable by the country's Office of Film and Literature Classification.
In Saudi Arabia, a request to take down an episode criticizing the country's government from the series Patriot Act with Hasan Minhaj in 2019, which drew criticism in the media.
Censorship laws in India
In India, Netflix along with Disney's Hotstar announced plans in early 2019 to adopt self-regulation guidelines for content streamed on its platforms within the country in an effort to prevent potential implementation of government censorship laws.
Showing females without hijabs in Jordan in Jinn
The Jordanian series Jinn was condemned by members of the country's government for alleged "immoral scenes", including showing females without hijabs and young people kissing. The country's highest prosecutor has sought to have the series banned from streaming.
Depiction of LGBT characters in Turkey
Netflix was ordered by the television watchdog of Turkey, Radio and Television Supreme Council (RTÜK) to remove LGBT characters from its Turkish original series Love 101 and The Protector. Netflix subsequently cancelled the ongoing production of its Turkish series If Only when ordered to remove a gay character.
Depiction of Cleopatra
In 2023, Netflix announced that the second installment of the African Queens docuseries, subtitled Queen Cleopatra. The series received criticism upon the trailer release as Adele James, a black woman, was cast as Cleopatra, a Greek-Macedonian woman, instead of a white woman. The series was accused of "falsifying history" and a petition on Change.org reached 85,000 signatures in two days before being shut down by the site's administrators. Netflix faced criticism on Twitter, with social media users accusing the series of Afrocentrism and saying that the "theft" of Greek and Egyptian cultures was continuing on Netflix. Zahi Hawass, the Egyptian Minister of Tourism and Antiquities and Egyptologist, called Netflix's portrayal of Cleopatra "completely fake" and said that the producers are "trying to stir up confusion to spread false information". Egyptian lawyer Mahmoud al-Semary filed a lawsuit against Netflix in April 2023, calling the depiction Afrocentric and a "crime". Al-Semary seeks to have Netflix discontinued in Egypt and for Netflix's management team to be investigated for the series.
Corporate affairs
Employee poaching
In September 2016, Netflix was sued by 20th Century Fox for tortious interference, alleging that the company "unlawfully target[ed], recruit[ed], and poach[ed] valuable Fox executives by illegally inducing them to break their employment contracts with Fox to work at Netflix." The suit in particular referred to Netflix's hiring of Tara Flynn and Marco Waltenberg, who were still under contract with Fox. In October 2016, Netflix filed a counter-suit against 20CF, alleging that the fixed-term contracts being used by Fox were in violation of the California Business and Professions Code, for "facilitating and enforcing a system that restrains employee mobility, depresses compensation levels, and creates unlawful barriers to entry for Netflix and others competing in the film and television production business". Netflix described the agreement as "a form of involuntary servitude". Viacom sued Netflix for the same reason in October 2018, over its hiring of Momita Sengupta.
In June 2019, a judge issued a tentative ruling holding that Netflix "intentionally interfered with Fox's contracts with Waltenberg and Flynn" to "further its own economic interest at Fox's expense", but that Fox had failed to present any evidence of actual damages against the company. The case was to go to trial in January 2020. In December 2019, the judge issued a final ruling barring Netflix from soliciting employees under fixed-term employment contracts with Fox, or inducing them to violate such contracts.
Firing of Jonathan Friedland for saying nigger
In June 2018, Netflix CCO Jonathan Friedland was fired for saying the word nigger during a company meeting about offensive words. A memo released by Reed Hastings, which stated that he should have used a euphemism, mentioned that Friedland said the word again during a follow-up meeting with human resources. Hastings described the second utterance as "confirm[ing] a deep lack of understanding". Days later, an advertising campaign for Netflix launched, which emphasized its black talent.
Insider trading ring
In 2021, five Netflix employees were charged with insider trading by the SEC. The group was accused of using insider information to trade ahead of 13 earnings announcements between 2016 and 2019. The ring had netted $3.1M in profits.
In December 2021, former Netflix engineer Sung Mo Jun was sentenced to 2 years in prison for an insider trading scheme where he leaked subscriber numbers in advance of official releases.
Tax avoidance
According to a blog post by the Institute on Taxation and Economic Policy, Netflix reported its largest ever profit in the US for 2018, but paid nothing in federal or state tax. The explanation is that US Tax law allows companies to claim tax credit on foreign earnings and thus avoid double taxation. US Senator Bernie Sanders has criticized Netflix for this both on Twitter and at a Fox News town hall event on April 15, 2019. A spokesperson from Netflix has addressed such claims as "inaccurate", but no evidence has been provided that Netflix did pay any state or federal taxes in 2018.
In October 2019, allegations of tax evasion were investigated by Italian prosecutors. While Netflix doesn't have a headquarters in Italy, the prosecution claims that the digital infrastructure such as servers and cables amounts to a physical presence in the country.
In January 2020, Netflix was accused of funneling $430 million of profits into tax havens.
in February 2020, according to Labour MP Margaret Hodge, Netflix allegedly should have paid over £13 million in UK tax in 2019 but "deliberately avoided" doing so. Netflix said it complies with the rules of countries in which it operates.
In August 2020, Netflix was one of 21 international companies being investigated for allegedly evading tax in South Korea.
Throttling of DVDs by mail
Netflix's DVD allocation policy – referred to by many as "throttling" – gives priority shipping and selection to customers who rent fewer discs per month. Higher volume renters may see some of their selections delayed, routed elsewhere, or sent out of order. Netflix claimed that the large majority of subscribers are able to receive their movies in about one business day following our shipment of the requested movie from their local distribution center. However, not all shipments came from the subscriber's local distribution center, and shipments from distant centers were often delayed, as well.
In September 2004, a consumer class action lawsuit, Frank Chavez v. Netflix, Inc., was brought against Netflix in San Francisco Superior Court. The suit alleged false advertising in relation to claims of "unlimited rentals" with "one-day delivery." In January 2005, Netflix changed its terms of use to acknowledge "throttling". In October 2005, Netflix proposed a settlement for those who had enrolled as a paid Netflix member prior to January 15, 2005. These earlier members would be able to renew their subscriptions with a one-month free membership, and those early members with current subscriptions would receive a one-month free upgrade to the next-highest membership level. Netflix's settlement denied allegations of any wrongdoing, and the case did not reach a legal judgment. A controversial aspect of the settlement offer was that the customer's account would continue at the renewed or upgraded membership level after the free month provided by the settlement, with customers being charged accordingly unless they opted out after the month-long free period ended. After Trial Lawyers for Public Justice filed a challenge to the proposed settlement and the Federal Trade Commission filed an amicus brief urging the rejection or modification of the settlement, Netflix offered to alter the settlement terms, requiring customers to actively approve any continuation after the free month. The settlement was affirmed on April 21, 2008.
The summary notice and long-form notice together provided all of the detail required by statute or court rule, in a highly accessible form. The fact that not all of the information was contained in a single e-mail or mailing is immaterial ... Using a summary notice that directed the class member wanting more information to a Web site containing a more detailed notice, and provided hyperlinks to that Web site, was a perfectly acceptable manner of giving notice in this case ... The class members conducted business with defendant over the Internet, and can be assumed to know how to navigate between the summary notice and the Web site. Using the capability of the Internet in that fashion was a sensible and efficient way of providing notice, especially compared to the alternative Vogel apparently preferred—mailing out a lengthy legalistic document that few class members would have been able to plow through.
The settlement was criticized because it paid out $2.5 million to attorneys for fees and costs, while offering only coupons to the class members.
The Terms of Use have since been amended with terms that indicate such a suit would not be possible in the future:
These Terms of Use shall be governed by and construed in accordance with the laws of the state of Delaware, without regard to conflicts of laws provisions. You and Netflix agree that the United States District Court for the Northern District of California and/or the California Superior Court for the County of Santa Clara shall have exclusive jurisdiction over any dispute between you and Netflix relating in any way to the Netflix service or Web site or these Terms of Use. You and Netflix expressly and irrevocably consent to personal jurisdiction and venue in these courts. The parties agree that in any such dispute or subsequent legal action, they will only assert claims in an individual (non-class, non-representative) basis, and that they will not seek or agree to serve as a named representative in a class action or seek relief on behalf of those other than themselves.
The Netflix website at one time featured a list of titles, "Releasing This Week" (RTW), that enabled customers to easily view new DVDs the company planned for rental release each week. On December 21, 2007, the company removed the link to the page without notice and replaced it with a slider system showing only four previously released movies at a time. The new page, called "Popular New Releases", does not list newly released DVDs for rental. The listing of new releases was still active, although there is was menu option that links to the page. On January 1, 2008, a Netflix employee unofficially stated on the Netflix Community Blog that customers used the RTW page to add newly released movies to the top of their queues, then complained about delays in receiving them after demand outstripped the supply of DVDs on hand. By removing the page, Netflix sought to quell complaints that these movies were not readily available. Critics, however, suggested this was just another Netflix attempt at throttling.
Selective release of viewership information and calculation methodology of viewership numbers
Netflix has been criticised by some media organizations and competitors for only rarely and selectively releasing its ratings and viewer numbers. A notable instance of this involves the film Bird Box. A week after its release, Netflix claimed that it had the biggest seven-day viewing record of any of its original films at over 45 million viewers, but did not provide data to validate it. It also was not possible to accurately compare its week-long success to a major cultural event such as the Super Bowl or Academy Awards or to a blockbuster film run. In June 2019, Netflix claimed that 30,869,863 accounts watched the Adam Sandler- and Jennifer Aniston-starring Netflix original film Murder Mystery, despite it being critically panned, making it the biggest "opening weekend" for a Netflix original film. If the film had been in theaters it would have made the equivalent of $556 million based on a $9 ticket price. Critics cast doubt that this number of people would have watched the film given that it would have made the film more popular than the finale of Game of Thrones.
In the fourth quarter of 2019, Netflix changed the method it used to estimate viewers for a show. Before this, Netflix counted a viewer towards viewership if they watched 70% of the show; with the change, a viewer need only watch two minutes of the show to count. Netflix started the two-minute metric indicated that the viewer chose to watch the show, and thus counted in its viewership. This also eliminated factors such as the length of the work, so that both short and long works would be treated equally. In a statement to shareholders, Netflix estimated this increased viewership by 35% on average. This new metric was criticized as commentators felt two minutes was far too little of any show to engage a viewer, and instead the move by Netflix was to artificially increase viewership to put their numbers on par with television networks and movie ticket sales, such as trying to compare viewership of The Witcher with that of HBO's Game of Thrones.
In October 2021, Netflix agreed to release more viewership information and changed its viewership metrics to measuring the number of hours that a show was watched including rewatches, which the company said was closer to the measurements used in linear broadcast television.
Workplace culture
Netflix grants all employees extremely broad discretion with respect to business decisions, expenses, and vacation—but in return expects consistently high performance, as enforced by what is known as the "keeper test." All supervisors are expected to constantly ask themselves if they would fight to keep an employee. If the answer is no, then it is time to let that employee go. A slide from an internal presentation on Netflix's corporate culture summed up the test as: "Adequate performance gets a generous severance package." Such packages reportedly range from four months' salary in the United States to as much as six months in the Netherlands.
The company offers unlimited vacation time for salaried workers and allows employees to take any amount of their paychecks in stock options.
About the culture that results from applying such a demanding test, Hastings has said that "You gotta earn your job every year at Netflix," and, "There's no question it's a tough place...There's no question it's not for everyone." Hastings has drawn an analogy to athletics: professional athletes lack long-term job security because an injury could end their career in any particular game, but they learn to put aside their fear of that constant risk and focus on working with great colleagues in the current moment.
Digital rights management
Use of digital rights management (DRM) by Netflix has been criticized by Defective by Design/Free Software Foundation. The digital restrictions have impeded viewing for paying subscribers. For example, a 2019 update to Netflix dropped support for certain Samsung and Roku devices because they predate Microsoft's PlayReady DRM.
Consumer-related
Allowing users to bypass geo-blocking
As of November 2013, Canadian Netflix offered 3,600 titles compared to the U.S. service which had more than 10,000 and so Canadians used VPNs so they can access the larger U.S. content selection. As of 2015, more than 30 million Netflix subscribers used the service via a proxy server or virtual private network (VPN); doing so can make a user appear to be located in a country other than the one they are actually in, thus allowing them to circumvent geo-blocking and use the service to access content that Netflix does not offer in their region, due to geographical licensing restrictions. It is unclear whether accessing geo-blocked content via VPN violates local copyright laws, but content providers and other broadcasters have asserted that it is illegal because it infringes local rights to content that may have been sold to a competitor. GlobalWebIndex showed about 20 million of such VPN users came from China alone.
In a leaked e-mail revealed by the Sony Pictures Entertainment hack in 2014, Sony Pictures Television's president of international distribution, Keith LeGoy, described VPN usage of Netflix as being "semi-sanctioned" piracy, and he criticized the company for not taking further steps to detect these users and restrict their access to content Netflix had not licensed for their region.
On January 14, 2016, Netflix announced its intent to strengthen measures to restrict access to unlicensed material, by viewers using VPNs or proxies.
Release of customer data during a competition
In 2006, Netflix held the first Netflix Prize competition to find a better program to predict user preferences and beat its existing Netflix movie recommendation system, known as Cinematch, by at least 10%. CEO Hastings did not necessarily expect a lot of quick progress towards the prize, "We thought we built the best darn thing ever." But by June 2007, Hastings said the competition is "three-quarters of the way there in three-quarters of a year." Three teams – an AT&T Research Team called BellKor, commendo's team BigChaos, and Pragmatic Theory – combined to win the 2009 grand prize competition for $1 million. The winning team, called BellKor's Pragmatic Chaos, used machine learning techniques to find that, for example, the rating system people use for older movies is very different from that used for a movie they just saw. The mood of the day made a difference also; for example, Friday ratings were different from Monday morning ratings.
In 2010, Netflix canceled a running contest to improve the company's recommendation algorithm due to privacy concerns: under the terms of the competition, contestants were given access to customer rental data, which the company had purportedly anonymized. However, it was discovered that even this anonymized dataset could, in fact, identify a user personally. Netflix was sued by KamberLaw L.L.C. in Doe v Netflix and ended the contest after reaching a deal with the FTC.
Inadequate closed captioning
In June 2011, the National Association of the Deaf represented by the Disability Rights Education and Defense Fund (DREDF) filed a lawsuit against Netflix under the Americans with Disabilities Act over a lack of subtitles. In October 2012, the parties agreed to a settlement under which Netflix agreed to pay $755,000 in legal fees, provide closed captioning for its entire library by 2014, and have captions available for all new content within 7 days by 2016. In April 2015, the United States Court of Appeals for the Ninth Circuit issued an unpublished decision ruling that the ADA did not apply to Netflix in this case, as it is "not connected to any actual, physical place" and thus not a "place of public accommodation" that applies to the Act.
In July 2012, Netflix formed an experimental project to crowdsource the closed-captioning effort using the Amara (formerly Universal Subtitles) platform. However, this proved problematic in the face of claims that crowdsourced subtitles, regardless of whether they are transcriptions or translations, are derivative works and were considered copyright infringement if created or distributed without consent from the film's copyright owner. Amara operates under DMCA safe-harbor provisions which indemnify it from secondary copyright infringement lawsuits over user-uploaded content, and presumably Netflix would not publish any subtitles produced by this effort without authorization. Netflix stated it is not committed to using any subtitles produced by the crowdsourcing project. In October 2012, Netflix offered the television series Andromeda to customers in Finland with unauthorized subtitles from the fansub scene. When confronted, Netflix apologized and promised to remove the unauthorized translations but did not explain how the content came to be offered in the first place, or whether other potentially copyright-infringing subtitles existed.
Netflix has been criticized over the quality of subtitles on some of its content and original productions; the service's video player contains a function allowing users to report issues with captioning. In one notable instance in 2018, Queer Eye contained sentences of dialogue missed by the subtitles, and censoring of expletives that were not censored in the audio. Netflix corrected these subtitles after receiving criticism via social media.
Removal of social networking feature
Beginning in 2004, Netflix subscribers could use "Netflix Friends", social networking service feature to interact with friends who were also members. Users could see how their friends rated a movie on that movie's page, view what DVDs their friends were renting, and allow them to leave their friends notes with film recommendations. In March 2010, as part of a redesign of its movie-details pages, the Friends feature began to be phased out. Users could no longer see their friends' ratings on movie pages, and what remained of the friends section was moved to a small link at the bottom of each page. Angry users posted negative comments and the feedback prompted Netflix's Vice President of Product Management, Todd Yellin, to post a follow-up statement. While apologizing for poor communication about the changes, Yellin stated that the Friends feature would continue to be phased out, stating that only 2% of members used the feature and the company had limited resources to maintain the service.
Price increase complaint
In June 2016 a Netflix subscriber, sued the company over price increases, alleging he was told by a Netflix customer support representative in 2011 that he would pay the same price in perpetuity as long as he maintained his subscription continuously. The plaintiff voluntarily dismissed the case in July 2016.
Privacy rights lawsuit
In 2013, Netflix paid $9M to settle a consumer privacy lawsuit. Allegedly, the company had illegally retained and used the rental histories of individual subscribers for a period of two years.
Language discrimination
Since 2020, several studies, organizations and social movements mostly from Europe have protested language discrimination in Netflix's browsing interface, the searching algorithms, and content catalogues.
This alleged language discrimination is most noted for the official, non-official and minority languages in Spain. But criticism has also been equally raised for Welsh, Icelandic and for India's many indigenous languages.
Netflix has been criticized in Spain for the non-inclusion of other languages in Spain such as Catalan, Basque, Galician, Aranese Occitan, and Asturian.
A study by the Catalan-language NGO Plataforma per la Llengua had concluded in 2020 that of 2,092 video products surveyed, 327 had already been dubbed in Catalan previously but such versions were not made available by Netflix. Only 30 out of the 6,034 streaming products were available in Catalan on the Spanish Netflix catalogue by early 2022, which represented only 0.5% of the total content.
In 2021, the Spanish government passed a new audiovisual law stating that at least 6% of the total content of a provider must be made available in Catalan, Basque or Galician. However, the law was criticized for excluding major foreign broadcasters such as Netflix, HBO, Amazon Prime or Disney+, meaning only domestic streaming companies were affected by the quota.
In response to the controversy, Netflix announced in March 2022 that it would publish a total of 70 new titles (dubbed or subtitled) in Catalan, Basque, and Galician yearly. The decision was applauded by the Government of Catalonia, which recognized ongoing negotiations with the streaming company. Nonetheless, this compromise was still considered unsatisfactory by Plataforma per la Llengua.
In June 2022, a self-organized online campaign by the Catalan-speaking community led by linguist Carme Junyent i Figueras and organizations such as Mantinc el català declared a boycott and asked people to cancel their Netflix subscriptions by June 23, coinciding with the National Day of the Catalan Countries. Aside from the lack of content, the campaigners also criticized the lack of available language options for the user interface allowing users to search for titles in their own language. The boycott gained momentum on Twitter with numerous people claiming to have unsubscribed from the service in support. By June 28, Netflix released 12 more titles in Catalan to the platform which were also made available internationally.
In March 2023, Mithun Vijay Kumar, a political activist in India sued Netflix India for streaming an episode of sitcom The Big Bang Theory in which a character played by Kunal Nayyar allegedly call actress Madhuri Dixit "a leprous prostitute." Many people online trolled Netflix for streaming the episode containing insulting dialogue. Kumar expressed that online streaming platforms like Netflix should be held accountable for their actions.
Technical issues
Stress on broadband networks
On March 18, 2020, Thierry Breton, the European Commissioner for Internal Market and Services urged streaming services including Netflix to cut back their service to limit the stress on Europe's broadband networks. The COVID-19 lockdowns increased pressure on the networks with people both working and looking for entertainment at home. Netflix agreed to reduce its streaming rate in the European Union by 25% for 30 days, while allowing users to stream in HD and 4K with reduced image quality.
Lack of Linux support before 2014
Netflix formerly supported online streaming only on Microsoft Windows, macOS, iOS, and Android, relying on Microsoft Silverlight. Partly due to digital rights management issues, despite the open source implementation of Silverlight known as Moonlight, this created problems for users of fully open-source versions of Linux and similar operating systems. Though Google's partially proprietary Android and ChromeOS platforms are essentially based upon Linux and other free software infrastructure, Netflix did not provide any crossover support for using its proprietary components to stream any of its content upon more free systems, such as Ubuntu and Fedora, although this changed in October 2014. On August 9, 2011, Netflix released a Google Chrome web store item for ChromeOS, Mac OS, and Windows; however, it did not initially enable Netflix streaming on Linux machines. On Linux systems running the Chrome browser, the extension simply redirected users to view Netflix.com. In June 2014, Netflix switched from Silverlight to HTML5 playback using Encrypted Media Extensions (EME); the extensions were added to Microsoft's Internet Explorer on Windows 8.1 and Apple's Safari on OS X Yosemite and Google Chrome. Versions of Linux including Ubuntu and PCLinuxOS now offer support for Netflix in Google Chrome version 37 or newer. Users of other Linux distributions such as version 17 of Linux Mint have been successfully using Netflix via Google Chrome without any special workarounds. Google initially released plans for a plugin for the Chrome browser and ChromeOS which would allow Netflix streaming, including traditional Linux users. On November 15, 2012, patches to the Wine compatibility layer to make viewing of Netflix on Linux and similar systems were made available. On November 18, 2012, a PPA and installation files were made publicly available making the installation and use of Netflix much easier for users of Ubuntu 12.04 and possibly other distributions. On August 8, 2013, software repositories were made publicly available making possible the usage of the Windows Silverlight plugin in Linux-native web browsers using Wine. Previous Linux Netflix support required running the entire Firefox web browser through the Wine compatibility layer.
See also
Computer addiction
Internet addiction disorder
Social aspects of television
Television addiction
References
Netflix
Netflix |
Taşağıl is a neighbourhood in the municipality and district of Çat, Erzurum Province in Turkey. Its population is 260 (2022).
References
Neighbourhoods in Çat District |
```xml
import {
Alert,
Button,
Header,
Modal,
SpaceBetween,
Spinner,
} from "@cloudscape-design/components";
import { ChangeEvent, useCallback, useRef, useState } from "react";
export interface FileUploadProps {
accept?: string[];
disabled: boolean | undefined;
onSubmit: (file: File) => Promise<void>;
}
function FileUpload({ disabled, onSubmit, accept = [] }: FileUploadProps) {
const [modalVisible, setModalVisible] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [error, setError] = useState<string | null>(null);
const fileInput = useRef<HTMLInputElement>(null);
const handleChange = useCallback(
({ target }: ChangeEvent<HTMLInputElement>) => {
if (target.files?.length) {
setSelectedFile(target.files[0]);
}
},
[setSelectedFile]
);
const handleDismiss = useCallback(() => {
setModalVisible(false);
setError(null);
setSelectedFile(null);
}, [setModalVisible, setError, setSelectedFile]);
const handleSelectFiles = useCallback(() => {
setError(null);
setSelectedFile(null);
fileInput.current?.click();
}, [setError, setSelectedFile, fileInput]);
const handleSubmit = useCallback(
async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
setError(null);
const formData = new FormData(e.currentTarget);
const file = formData.get("file") as File | null;
if (!file) {
setError("No file selected.");
return;
}
try {
setIsLoading(true);
await onSubmit(file);
setModalVisible(false);
} catch (err) {
console.error("Upload failed.", err);
const message = (err as Error)?.message ?? "Upload failed.";
setError(message);
} finally {
setIsLoading(false);
}
},
[setError, setIsLoading, setModalVisible, onSubmit]
);
return (
<>
<Button disabled={disabled} onClick={() => setModalVisible(true)}>
Upload
</Button>
<Modal
visible={modalVisible}
header={<Header variant="h2">Upload file</Header>}
onDismiss={handleDismiss}
>
<SpaceBetween size="s">
{error && <Alert type="error">{error}</Alert>}
<form encType="multipart/form-data" onSubmit={handleSubmit}>
{selectedFile && (
<img
width={125}
src={URL.createObjectURL(selectedFile)}
alt="Image to upload"
/>
)}
<SpaceBetween size="s" direction="horizontal">
<Button
disabled={disabled}
formAction="none"
onClick={handleSelectFiles}
>
Select file
</Button>
<Button
disabled={isLoading || fileInput.current?.value.length === 0}
>
{isLoading ? <Spinner /> : "Upload"}
</Button>
</SpaceBetween>
<input
name="file"
ref={fileInput}
type="file"
accept={accept.join(",")}
onChange={handleChange}
hidden
/>
</form>
</SpaceBetween>
</Modal>
</>
);
}
export default FileUpload;
``` |
```java
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
package jdk.graal.compiler.jtt.except;
import org.junit.Test;
import jdk.graal.compiler.jtt.JTTTest;
public class BC_athrow0 extends JTTTest {
static Throwable throwable = new Throwable();
public static int test(int arg) throws Throwable {
if (arg == 2) {
throw throwable;
}
return arg;
}
@Test
public void run0() throws Throwable {
runTest("test", 0);
}
@Test
public void run1() throws Throwable {
runTest("test", 2);
}
}
``` |
Jin Jiangbo (; born 1972 in Zhejiang Province, China) is a contemporary Chinese artist who focuses on site-specific artwork. From 2002 to 2007 he was Digital Art Center Studio Director for the Academy of Fine Arts, Shanghai University.
He has taken part in the Venice Biennale, the Shanghai Biennale, Nanjing Triennial and other international exhibitions. He was the Shanghai Curator of the 1st Beijing International Design Triennial, visiting scholar of Alfred University, United States.
In 1995 he graduated from the Academy of Fine Arts, Shanghai University. In 2002 he received a master's degree in digital art from the Academy of Fine Arts, Shanghai University. In 2012 he earned a PhD in art from the Academy of Fine Arts, Tsinghua University.
According to Gu Zhenqing's article "Light as Fuck" for ShangART:
The true "Shanghai assemblage" could not overlook artists such as Hu Jie Ming, Zhou Hongxiang and Jin Jiangbo. Their work is the pledge for the sustained advancement towards diversity of the Shanghai artists' community... Jin Jiangbo's online interactive multi-media work that linked Shanghai with the outside world – they all contain the essence of experience and spirit of the individual artists, and form an interconnected relationship with the different points of view. This avoids the tendency towards conceptualisation in the "Shanghai assemblage".
References
Chinese contemporary artists
Living people
1972 births
Artists from Zhejiang |
```java
/*
This file is part of the iText (R) project.
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at path_to_url For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program. If not, see <path_to_url
*/
package com.itextpdf.io.font.constants;
public final class FontWeights {
private FontWeights() {
}
// Font weight Thin
public static final int THIN = 100;
// Font weight Extra-light (Ultra-light)
public static final int EXTRA_LIGHT = 200;
// Font weight Light
public static final int LIGHT = 300;
// Font weight Normal
public static final int NORMAL = 400;
// Font weight Medium
public static final int MEDIUM = 500;
// Font weight Semi-bold
public static final int SEMI_BOLD = 600;
// Font weight Bold
public static final int BOLD = 700;
// Font weight Extra-bold (Ultra-bold)
public static final int EXTRA_BOLD = 800;
// Font weight Black (Heavy)
public static final int BLACK = 900;
public static int fromType1FontWeight(String weight) {
int fontWeight = NORMAL;
switch (weight.toLowerCase()) {
case "ultralight":
fontWeight = THIN;
break;
case "thin":
case "extralight":
fontWeight = EXTRA_LIGHT;
break;
case "light":
fontWeight = LIGHT;
break;
case "book":
case "regular":
case "normal":
fontWeight = NORMAL;
break;
case "medium":
fontWeight = MEDIUM;
break;
case "demibold":
case "semibold":
fontWeight = SEMI_BOLD;
break;
case "bold":
fontWeight = BOLD;
break;
case "extrabold":
case "ultrabold":
fontWeight = EXTRA_BOLD;
break;
case "heavy":
case "black":
case "ultra":
case "ultrablack":
fontWeight = BLACK;
break;
case "fat":
case "extrablack":
fontWeight = BLACK;
break;
}
return fontWeight;
}
public static int normalizeFontWeight(int fontWeight) {
fontWeight = (fontWeight/100)*100;
if (fontWeight < FontWeights.THIN) return FontWeights.THIN;
if (fontWeight > FontWeights.BLACK) return FontWeights.BLACK;
return fontWeight;
}
}
``` |
The Matrimonial Bed is a 1930 American pre-Code comedy film produced and released by Warner Bros. It was based on the French play by André Mouëzy-Éon and Yves Mirande. The English version of the play, by Sir Seymour Hicks, opened in New York on October 12, 1927, and had 13 performances.
Plot
Leopold Trebel (Frank Fay) is a man who was in a train wreck five years earlier and was taken for dead by his wife, Juliet (Florence Eldridge). Leopold and Juliet have both remarried. Leopold, who remembers nothing that occurred before the train wreck, is the father of two sets of twins by his new wife, Sylvaine (Lilyan Tashman). Juliet has recently had a child with her new husband, Gustave Corton (James Gleason). Leopold is a very popular hairdresser and some of Juliet's friends urge her to try him out.
When Leopold shows up at her home, he shocks the servants and his ex-wife. A doctor manages to restore Leopold's memory through hypnosis but in the process makes him forget what has happened in the last five years. When Leopold awakes from hypnosis, he thinks he has only been unconscious for a short while. He assumes he is still Juliet's husband. The doctor warns everyone not to tell him the truth because the shock could kill him. Just at this crucial moment, Gustave Corton arrives home and is shocked to find Leopold in his bed. Later on, Sylvaine arrives only to find her husband in bed with Gustave Corton. Eventually, Leopold learns what has happened and asks the doctor to pretend to take back his memory so that Juliet, whom he deeply loves, can continue to live her new life.
Pre-Code Sequences
Leopold is discovered in bed with Gustave, and Sylvaine assumes they are having an affair and, shocked, exclaims: "What kind of a house is this?"
When the doctor attempts to examine Leopold, the other assumes the doctor is gay and refuses to take off his shirt. When the doctor turns off the light to hypnotize him, Leopold exclaims that he was right in his suspicions about him.
The movie has numerous gay jokes as the hairdresser/husband played by Leopold. Actor Frank Fay camps up the hairdresser persona to differentiate himself from the personality of the husband. There are lines like "I may be a hairdresser but that doesn't mean I hold men's hands". When he asks what manner of person was he as the hairdresser, he is told, "You were gay, a bit dandified."
Cast
Frank Fay as Adolphe Noblet/Leopold
Lilyan Tashman as Sylvaine
James Gleason as Gustave Corton
Beryl Mercer as Corinne
Marion Byron as Marianne
Vivian Oakland as Suzanne Trebel
Arthur Edmund Carew as Dr. Friedland
James Bradbury Sr. as Chabonnais
Florence Eldridge as Juliette
Preservation status
A print is held in the Library of Congress collection.
References
External links
1930 films
Warner Bros. films
American films based on plays
1930s English-language films
Films about amnesia
Films directed by Michael Curtiz
American black-and-white films
Films scored by Louis Silvers
American comedy films
1930 comedy films
1930s American films |
```c++
#pragma once
/*
datetime.hpp
*/
/*
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <WinCompat.h>
#include "FARString.hpp"
DWORD ConvertYearToFull(DWORD ShortYear);
int GetDateFormat();
wchar_t GetDateSeparator();
wchar_t GetTimeSeparator();
inline int GetDateFormatDefault() { return 1; };
inline const wchar_t GetDateSeparatorDefault() { return L'-'; };
inline const wchar_t GetTimeSeparatorDefault() { return L':'; };
inline const wchar_t* GetDateSeparatorDefaultStr() { return L"-"; };
inline const wchar_t* GetTimeSeparatorDefaultStr() { return L":"; };
int64_t FileTimeDifference(const FILETIME *a, const FILETIME *b);
uint64_t FileTimeToUI64(const FILETIME *ft);
void GetFileDateAndTime(const wchar_t *Src, LPWORD Dst, size_t Count, int Separator);
void StrToDateTime(const wchar_t *CDate, const wchar_t *CTime, FILETIME &ft, int DateFormat,
int DateSeparator, int TimeSeparator, bool bRelative = false);
void ConvertDate(const FILETIME &ft, FARString &strDateText, FARString &strTimeText, int TimeLength,
int Brief = FALSE, int TextMonth = FALSE, int FullYear = 0, int DynInit = FALSE);
void ConvertDate_ResetInit();
void ConvertRelativeDate(const FILETIME &ft, FARString &strDaysText, FARString &strTimeText);
void PrepareStrFTime();
size_t WINAPI StrFTime(FARString &strDest, const wchar_t *Format, const tm *t);
size_t MkStrFTime(FARString &strDest, const wchar_t *Fmt = nullptr);
``` |
The Battle of Tarbat was a Scottish clan battle fought in the 1480s on the Tarbat peninsula, in Easter Ross. The Clan Ross cornered a raiding party of Clan Mackay near the village of Portmahomack and put many of them to the sword. The survivors sought sanctuary in the nearby church but the Rosses set fire to it, killing all inside. The Mackays took revenge for this outrage in the subsequent Battle of Aldy Charrish.
Background
The second half of the 15th century had seen a series of raids by the Mackays of Strathnaver on the Rosses of Balnagown. According to the Blackcastle MS (which was written by Alexander Mackay of Blackcastle who had access to the Mackay chief's family charters and papers) the Rosses had made "a predatory incursion" into the territory of the Mackays. Sir Robert Gordon, however, says that the Mackays "often molested with incursions and invasions" the lands of the Rosses. According to historian Angus Mackay, the evidence is ample that the Mackays managed to recover some of the lands in Ross-shire that had belonged to their relatives and enemies, Neil Neilson Mackay, his brother Morgan Neilson Mackay, and Neil and Morgan's father-in-law Murray of Cubin, all three of whom had been defeated and killed by the Mackays of Strathnaver at the Battle of Drumnacoub in 1433. The evidence is also ample that the Rosses managed to secure some of these lands lying in the parishes of Edderton and Kincardine in Ross-shire. So it appears that the feud between the Mackays and the Rosses arose out of a scramble for disputed lands. Finally the Rosses gathered their forces to attack the invaders who were led by Angus Roy Mackay of Strathnaver, son of Neil "Bass" Mackay.
The exact date of the battle is uncertain, other than it happened before the Battle of Aldy Charrish, which documentary evidence dates to either July 1487 or June 1486. The date most commonly cited for events at Tarbat is 1486, but all that can be said is that it was probably some time in the 1480s.
Battle
The Rosses appear to have encountered the Mackay raiding party on the Tarbat peninsula, where they were "fiercely attacked". It appears that many Mackays were killed before they sought shelter in the Tarbat church. More were apparently killed before the church was set on fire. Angus Roy MacKay was among those killed. As a poem put it :
Archaeology supports this story. Archaeologists have been investigating the Tarbat Old Church at Portmahomack for evidence of a major monastery largely destroyed around 800AD. While the target of this presumed Viking raid has attracted most attention, a new church was built on the site in the 13th century. This "Church 4" apparently suffered a major fire during the Middle Ages. Fire has scorched the sandstone of the internal walling to a bright orange, even in the crypt, and charcoal from possible roof timbers or thatch was found in the nave near the crypt entrance.
Sir Robert Gordon, 1st Baronet's 17th century manuscript, A Genealogical History of the Earldom of Sutherland, which was written in about 1630, states: This Angus Macky, heir mentioned, wes afterward killed and burnt in the church of Tarbet, by the surname of Rosse, whom he had often molested with incursions and invasions.
James Fraser of Wardlaw wrote the Wardlaw Manuscript in about 1674. It states that the conflict at Tarbat took place in 1438 and gives the following details: This Anguis Macky, not content with what outrages he had formerly committed, and the slaughter at Cha blair Tannie, but resolves from thence to invade Rosse er he returned home, and, marching through Sutherland, crost at Port in Culternach, or the Meikle Ferry, with a company of rather desperat than resolut men, and, notwithstanding of the threates and interdictions of the monks of Fern (terrible enugh in these dayes to deterr any, nay the most barbarous, from outrages) he runss over the whole country, purposeing to make a prey of all in a peaceable time; but he was briskly mett with by the Rosses, who, killing all his men, persued himselfe to the church of Tarbit, takeing sanctury in the temple, quher they killed and burnt him. Thus the Rosses requitted him whom he often molested with incursions and invasions.
Aftermath
John (Iain) Riabhach Mackay avenged his father's death by invading the Ross lands in 1487. This raid culminated in the Battle of Aldy Charrish at the head of the Kyle of Sutherland which saw Alexander Ross of Balnagowan and many of his kinsmen slaughtered. The Clan Ross never really recovered from this defeat.
References
1486 in Scotland
15th-century Scottish clan battles
History of the Scottish Highlands
Conflicts in 1486
Clan Mackay |
```smalltalk
using System;
using sys = System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Atomix.CompilerExt;
using Atomix.CompilerExt.Attributes;
using Kernel_alpha.x86.Intrinsic;
namespace Atomix.mscorlib
{
public static class StringImpl
{
/*
Length Offset => [0x0C - 0x10)
Data Offset => [0x10 - )
*/
[Plug("System_Void__System_String__ctor_System_Char___")]
public static unsafe void ctor(byte* aFirstChar, char[] aChar)
{
ctor(aFirstChar, aChar, 0, aChar.Length);
}
[Plug("System_Void__System_String__ctor_System_Char__")]
public static unsafe void ctor(byte* aFirstChar, char* aChar)
{
int i = 0;
char* chars = (char*)(aFirstChar + 0x10);
while (*aChar != '\0')
{
*chars = *aChar;
++chars;
++aChar;
++i;
}
*((int*)(aFirstChar + 0xC)) = i;
}
[Plug(your_sha256_hashstem_Int32_")]
public static unsafe void ctor(byte* aFirstChar, char[] aChar, int Start, int Length)
{
int i;
char* chars = (char*)(aFirstChar + 0x10);
for (i = 0; i < Length; i++)
chars[i] = aChar[i + Start];
*((int*)(aFirstChar + 0xC)) = i;
}
[Plug("System_Char_System_String_get_Chars_System_Int32_")]
public static unsafe char Get_Chars(byte* aThis, int aIndex)
{
if (aIndex < 0 || aIndex >= Get_Length(aThis))
return '\0';
var xCharIdx = (char*)(aThis + 16);
return xCharIdx[aIndex];
}
[Plug("System_Int32_System_String_get_Length__")]
public unsafe static int Get_Length(byte* aThis)
{
var xCharIdx = (byte*)(aThis + 12);
return (int)(xCharIdx[3] << 24 | xCharIdx[2] << 16 | xCharIdx[1] << 8 | xCharIdx[0]);
}
[Plug(your_sha256_hash_System_String__System_String_")]
public static string Concat(string s0, string s1, string s2, string s3)
{
return ConcatArray(new string[] { s0, s1, s2, s3 }, s0.Length + s1.Length + s2.Length + s3.Length);
}
[Plug(your_sha256_hash_System_String_")]
public static string Concat(string s0, string s1, string s2)
{
return ConcatArray(new string[] { s0, s1, s2 }, s0.Length + s1.Length + s2.Length);
}
[Plug(your_sha256_hash)]
public static string Concat(string s0, string s1)
{
return ConcatArray(new string[] { s0, s1 }, s0.Length + s1.Length);
}
[Plug("System_String_System_String_Concat_System_String___")]
public static string Concat(params string[] strs)
{
int len= 0;
for (int i = 0; i < strs.Length; i++)
len += strs[i].Length;
return ConcatArray(strs, len);
}
private static string ConcatArray(string[] strs, int length)
{
char[] xResult = new char[length];
int p = 0;
for (int i = 0; i < strs.Length; i++)
{
var str = strs[i];
for (int j = 0; j < str.Length; j++)
{
xResult[p++] = str[j];
}
}
return new String(xResult);
}
[Plug(your_sha256_hash_")]
public static string SubString(string aThis, int index, int length)
{
char[] xResult = new char[length];
for (int i = 0; i < length; i++)
{
xResult[i] = aThis[index + i];
}
return new String(xResult);
}
[Plug("System_String_System_String_Substring_System_Int32_")]
public static string SubString(string aThis, int index)
{
return SubString(aThis, index, aThis.Length - index + 1);
}
[Plug("System_String_System_String_ToLower__")]
public static string ToLower(string aThis)
{
return ChangeCase(aThis, 65, 90, 32);
}
[Plug("System_String_System_String_ToUpper__")]
public static string ToUpper(string aThis)
{
return ChangeCase(aThis, 97, 122, -32);
}
[Plug("System_String_System_String_PadLeft_System_Int32__System_Char_")]
public static string PadLeft(string aThis, int TotalWidth, char paddingchar)
{
return Padding(aThis, TotalWidth, paddingchar, false);
}
[Plug("System_String_System_String_PadRight_System_Int32__System_Char_")]
public static string PadRight(string aThis, int TotalWidth, char paddingchar)
{
return Padding(aThis, TotalWidth, paddingchar, true);
}
[Label("getLength_System_Char__")]
public unsafe static int getLength(char* str)
{
int length = 0;
while (*str != '\0')
{
++str;
++length;
}
return length;
}
private static string Padding(string aThis, int TotalWidth, char PaddingChar, bool Direction)
{
var len = aThis.Length;
if (len >= TotalWidth)
return aThis;
char[] xResult = new char[TotalWidth];
if (Direction)
{
//Padding Right
for (int i = 0; i < TotalWidth; i++)
{
if (len <= i)
xResult[i] = PaddingChar;
else
xResult[i] = aThis[i];
}
}
else
{
var xOffset = TotalWidth - len;
//Padding Left
for (int i = 0; i < TotalWidth; i++)
{
if (i < xOffset)
xResult[i] = PaddingChar;
else
xResult[i] = aThis[i - xOffset];
}
}
return new String(xResult);
}
private static string ChangeCase(string xStr, int lowerACII, int upperASCII, int value)
{
char[] xResult = new char[xStr.Length];
for (int i = 0; i < xStr.Length; i++)
{
var xChar = xStr[i];
if (xChar >= lowerACII && xChar <= upperASCII)
{
xChar = (char)(xChar + value);
}
xResult[i] = xChar;
}
return new String(xResult);
}
[Plug("System_String___System_String_Split_System_Char___")]
public static string[] Split(string str, char[] c)
{
int counter = 0;
for (int i = 0; i < str.Length; i++)
{
if (str[i] == c[0])
{
counter++;
}
}
string[] xResult = new string[counter + 1];
char[] xTemp = new char[255];
int mcounter = 0;
int zcounter = 0;
for (int i = 0; i < str.Length; i++)
{
if (str[i] == c[0])
{
char[] xTemp2 = new char[mcounter + 1];
for (int j = 0; j < mcounter; j++)
{
xTemp2[j] = xTemp[j];
}
mcounter = 0;
xResult[zcounter] = new string(xTemp2);
zcounter++;
}
else
{
xTemp[mcounter] = str[i];
mcounter++;
if (i == str.Length - 1)
{
char[] xTemp2 = new char[mcounter + 1];
for (int j = 0; j < mcounter; j++)
{
xTemp2[j] = xTemp[j];
}
mcounter = 0;
xResult[zcounter] = new string(xTemp2);
zcounter++;
}
}
}
return xResult;
}
[Plug("System_String_System_String_Trim__")]
public static string Trim(string aThis)
{
int c = 0;
for (int i = 0; i < aThis.Length; i++)
{
if (aThis[i] == ' ')
break;
c++;
}
return aThis.Substring(0, c);
}
[Plug("System_String_System_String_Trim_System_Char___")]
public static string Trim(string aThis, char[] aChar)
{
/* Done it in very hurry, haha...so it do limited work */
int c = 0;
for (int i = 0; i < aThis.Length; i++)
{
if (aThis[i] == aChar[0])
break;
c++;
}
return aThis.Substring(0, c);
}
[Plug(your_sha256_hashtring_")]
public static bool Equality(string str1, string str2)
{
var len = str1.Length;
if (len != str2.Length)
return false;
for (int i = 0; i < len; i++)
{
if (str1[i] != str2[i])
return false;
}
return true;
}
}
}
``` |
The Croatia national under-19 football team represents Croatia in international football matches for players 19 or under. It is governed by the Croatian Football Federation, the governing body for football in Croatia. It is a member of UEFA in Europe and FIFA in global competitions. The team's colours reference two national symbols: the Croatian checkerboard and the country's tricolour. They are colloquially referred to as the Mladi vatreni ('Young Blazers'). So far, the Mladi vatreni qualified for five UEFA European Under-19 Championships, namely in 1998, 2000, 2010, 2012 and 2016. Croatia won third place two times, namely in 1996 and 2010, its greatest success in the tournament so far.
Recent results and fixtures
2022
2023
Players
Current squad
The following is the squad named for the international tournament to be played in Zaprešić and Lučko, Croatia, from 11 to 17 October 2023.
Recent call-ups
The following players have also been called up within the last twelve months and remain eligible for future selections.
Competitive record
Champions Runners-up Third place Fourth place Tournament played fully or partially on home soil
Prior to 1990, Croatian players played for the Yugoslavia Under-18 team. Although the Croatian team was formed in the early 1990s after the breakup of Yugoslavia, the Under-18 team had to wait for UEFA to officially accept Croatian Football Federation's membership bid in order to be included in UEFA-governed competitions. Croatia's membership was accepted in June 1993 and the first continental competition Croatia's under-18 team took part in was the qualification for the 1994 European Under-18 Championship. In 2001 UEFA changed the player eligibility dates and from 2002 onwards the continental championship is known as UEFA European Under-19 Championship. The tournament is held every year and serves as the qualifying tournament for FIFA U-20 World Cup which is held every two years.
Croatia's Under-18/19 team managed to qualify for the European championship on four occasions. In 1998 and 2010 they won third place which earned them a place at the 1999 FIFA World Youth Championship and 2011 FIFA U-20 World Cup.
UEFA European Under-19 Championship record
Head-to-head record
Key
See also
Croatia national football team
Croatia national football B team
Croatia national under-23 football team
Croatia national under-21 football team
Croatia national under-20 football team
Croatia national under-18 football team
Croatia national under-17 football team
Croatia national under-16 football team
Croatia national under-15 football team
Croatia women's national football team
Croatia women's national under-19 football team
Croatia women's national under-17 football team
Croatia women's national under-15 football team
Notes
References
External links
European Under-19 Championship official website at UEFA.com
Youth team news at the Croatian FA official website
Appearance stats for all youth selections at the Croatian FA official website
Under-19
European national under-19 association football teams
Youth football in Croatia |
Quentin "Dragon" Chong is a retired South African professional mixed martial artist, trainer/coach and actor who has appeared in a number of American movies, local TV series, advertisements and magazines.
Background
Quentin Chong, nicknamed “the Dragon”, was born in 1972, in Gaborone, Botswana. He is the youngest of three siblings. He grew up in Cape Town, South Africa, where he still resides. As a child, aged 5, he trained in Chinese Kung Fu in Hong Kong. On a later visit to Thailand in the early 1990s he started training in Muaythai (also known as Muay Thai), a well-known combat sport of Thailand, under Manop Maswichean, who is a World Champion in the heavy weight category of this sport.
Professional career
In 2001 he was challenged to a World Muaythai title fight in the super middle weight category, in Chumphon, Thailand, against Saroonsak. He won the World Champion Title and successfully defended it in 2002 in Cape Town, South Africa, against Nokweit Davies (Nokweed Devy), also a world champion in the super-middle weight category. He has won 18 of 19 professional fights. His fight in 2002, against Davies, was his last professional fight.
His current involvement in the sport is in capacity of president, coach and manager of the South African Amateur Muaythai Foundation. He currently serves on the Executive Board of the International Federation of Muaythai Amateur
Other
Quentin has appeared in various international television series and films such as Wake of Death, Death Race 2 and Number One Girl(2005) and featured alongside actors such as Jean-Claude Van Damme, Pat Morita and Vinnie Jones. He had surgery to replace thinning hair after which he appeared in a number of South African newspapers, magazines, television adverts and shows such as Top Billing, the South African television series "Way of the Warrior" and the international television series "Strikeback" . He has trained other well-known international martial arts fighters such as Randy Courture and currently focuses on training fighters at his own gym called Dragon Power Muaythai, MMA and Fitness Centre , based in Cape Town.
His philanthropic efforts includes involvement with the Amy Biehl Foundation Trust and also with his own registered non-profit organisation called the South African Muaythai Against Drugs Association, which involves martial arts training, African drumming and cultural dancing for children from disadvantaged backgrounds from the townships around Cape Town.
References
External links
Quentin on Executive Board of the International Federation of Muaythai Amateur
Farrah Francis "Follow the Way of the Warrior" City Press, 4 April 2010. Retrieved 8 October 2012
Muythai against drugs
Quentin Chong trains Randy Couture
Quentin feature in February 2009 Top Billing magazine
Quentin Chong retires
Quentin's story told by Mnet 14 April 2010. Retrieved 13 October 2012
Quentin and the Amy Biehl Foundation Trust
Dragonpower
Amy Biehl Foundation Trust http://www.amybiehl.co.za/
1972 births
Living people
Mixed martial arts trainers
South African male film actors
South African Muay Thai practitioners
Sportspeople from Cape Town
Muay Thai trainers |
The People's Party of Castile and León (, PP) is the regional section of the People's Party of Spain (PP) in Castile and León. It was formed in 1989 from the re-foundation of the People's Alliance.
Its president is Alfonso Fernández Mañueco, current president of the Junta de Castilla y León. He succeeded Juan Vicente Herrera, former president of the Junta de Castilla y León, who had been in office for fourteen years. He currently governs in Ávila, Burgos, León, Palencia and Salamanca.
Electoral performance
Cortes of Castile and León
Cortes Generales
European Parliament
References
People's Party (Spain)
Political parties in Castile and León |
The Richard Ward House is a historic house in Andover, Massachusetts. It is a -story wood-frame house, with asymmetrical massing characteristic of the Queen Anne style. It has a front gable with decorative cut shingles and an oriel window, and a porch with turned posts and balustrade. It is a locally distinctive example of a middle class Queen Anne style Victorian in a rural setting. It was built between 1885 and 1888 for Richard Ward, a milk dealer who had married into the locally prominent Abbot family.
The house was listed on the National Register of Historic Places in 1982.
See also
National Register of Historic Places listings in Andover, Massachusetts
National Register of Historic Places listings in Essex County, Massachusetts
References
Houses in Andover, Massachusetts
National Register of Historic Places in Andover, Massachusetts
Houses on the National Register of Historic Places in Essex County, Massachusetts |
Marie-Lucie Morin is a Canadian public official, lawyer, and former diplomat and a former Committee member of the National Security and Intelligence Review Agency of Canada, and was also the same for its predecessor the Security Intelligence Review Committee from 2015, till the latter was superseded by the former in 2019. As such, she is also a member of the King's Privy Council for Canada and entitled to be styled as The Honourable. She is on the board of directors of AGT Food and Ingredients and Stantec since 2016.
Morin was the executive director for Canada, Ireland and the Caribbean at the World Bank from 2010 to 2013. Previously, from 2008 until 2010, she was National Security Advisor to the Prime Minister of Canada and associate secretary to the Cabinet. She served as deputy minister of international trade from 2006 to 2008 and as associate deputy minister of foreign affairs from 2003 to 2006. She served as Canadian ambassador to Norway from 1997 to 2001. In 2016, Morin was appointed to the Order of Canada.
She is a graduate of the Université de Sherbrooke. She is a member of the Bar of Quebec.
References
Members of the King's Privy Council for Canada
Canadian diplomats
Living people
Université de Sherbrooke alumni
Members of the Order of Canada
Lawyers in Quebec
Year of birth missing (living people) |
Eric Barnes (17 October 1940 − 27 June 2019) was an Australian rugby league footballer who played in the 1960s. He played for North Sydney and Cronulla-Sutherland as a lock but also played at prop and hooker. He was an inaugural player for Cronulla and played in the club's first ever game.
Playing career
Barnes began his first grade career for North Sydney in 1962. In 1965, Barnes played in both finals games for North Sydney which were a 47–7 defeat against St. George and a 14–9 defeat against Souths in the preliminary final.
In 1967, Barnes joined newly admitted side Cronulla-Sutherland and played in the club's first ever game, an 11–5 victory over Eastern Suburbs at the Sydney Sports Ground. Barnes went on to play 22 times for Cronulla as the club finished last on the table and claimed the wooden spoon.
Death
Barnes died at Coffs Harbour on 27 June 2019.
References
1940 births
2019 deaths
North Sydney Bears players
Cronulla-Sutherland Sharks players
Australian rugby league players
Rugby league players from Sydney
Rugby league locks |
Live At Howlin’ Wolf is a promo EP by the band The Afghan Whigs containing 4 tracks from a live concert from Thanksgiving Night 1997 at The Howlin' Wolf in New Orleans, Louisiana.
Track listing
"If There’s Hell Below (We’re All Going To Go)" (cover)
"Blame, Etc."
"Superstition/Going To Town"
"Debonair"
References
The Afghan Whigs albums
1998 EPs |
```forth
*> \brief \b SLATPS solves a triangular system of equations with the matrix held in packed storage.
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* path_to_url
*
*> \htmlonly
*> Download SLATPS + dependencies
*> <a href="path_to_url">
*> [TGZ]</a>
*> <a href="path_to_url">
*> [ZIP]</a>
*> <a href="path_to_url">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
*
* SUBROUTINE SLATPS( UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE,
* CNORM, INFO )
*
* .. Scalar Arguments ..
* CHARACTER DIAG, NORMIN, TRANS, UPLO
* INTEGER INFO, N
* REAL SCALE
* ..
* .. Array Arguments ..
* REAL AP( * ), CNORM( * ), X( * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> SLATPS solves one of the triangular systems
*>
*> A *x = s*b or A**T*x = s*b
*>
*> with scaling to prevent overflow, where A is an upper or lower
*> triangular matrix stored in packed form. Here A**T denotes the
*> transpose of A, x and b are n-element vectors, and s is a scaling
*> factor, usually less than or equal to 1, chosen so that the
*> components of x will be less than the overflow threshold. If the
*> unscaled problem will not cause overflow, the Level 2 BLAS routine
*> STPSV is called. If the matrix A is singular (A(j,j) = 0 for some j),
*> then s is set to 0 and a non-trivial solution to A*x = 0 is returned.
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] UPLO
*> \verbatim
*> UPLO is CHARACTER*1
*> Specifies whether the matrix A is upper or lower triangular.
*> = 'U': Upper triangular
*> = 'L': Lower triangular
*> \endverbatim
*>
*> \param[in] TRANS
*> \verbatim
*> TRANS is CHARACTER*1
*> Specifies the operation applied to A.
*> = 'N': Solve A * x = s*b (No transpose)
*> = 'T': Solve A**T* x = s*b (Transpose)
*> = 'C': Solve A**T* x = s*b (Conjugate transpose = Transpose)
*> \endverbatim
*>
*> \param[in] DIAG
*> \verbatim
*> DIAG is CHARACTER*1
*> Specifies whether or not the matrix A is unit triangular.
*> = 'N': Non-unit triangular
*> = 'U': Unit triangular
*> \endverbatim
*>
*> \param[in] NORMIN
*> \verbatim
*> NORMIN is CHARACTER*1
*> Specifies whether CNORM has been set or not.
*> = 'Y': CNORM contains the column norms on entry
*> = 'N': CNORM is not set on entry. On exit, the norms will
*> be computed and stored in CNORM.
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The order of the matrix A. N >= 0.
*> \endverbatim
*>
*> \param[in] AP
*> \verbatim
*> AP is REAL array, dimension (N*(N+1)/2)
*> The upper or lower triangular matrix A, packed columnwise in
*> a linear array. The j-th column of A is stored in the array
*> AP as follows:
*> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
*> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
*> \endverbatim
*>
*> \param[in,out] X
*> \verbatim
*> X is REAL array, dimension (N)
*> On entry, the right hand side b of the triangular system.
*> On exit, X is overwritten by the solution vector x.
*> \endverbatim
*>
*> \param[out] SCALE
*> \verbatim
*> SCALE is REAL
*> The scaling factor s for the triangular system
*> A * x = s*b or A**T* x = s*b.
*> If SCALE = 0, the matrix A is singular or badly scaled, and
*> the vector x is an exact or approximate solution to A*x = 0.
*> \endverbatim
*>
*> \param[in,out] CNORM
*> \verbatim
*> CNORM is REAL array, dimension (N)
*>
*> If NORMIN = 'Y', CNORM is an input argument and CNORM(j)
*> contains the norm of the off-diagonal part of the j-th column
*> of A. If TRANS = 'N', CNORM(j) must be greater than or equal
*> to the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j)
*> must be greater than or equal to the 1-norm.
*>
*> If NORMIN = 'N', CNORM is an output argument and CNORM(j)
*> returns the 1-norm of the offdiagonal part of the j-th column
*> of A.
*> \endverbatim
*>
*> \param[out] INFO
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -k, the k-th argument had an illegal value
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup latps
*
*> \par Further Details:
* =====================
*>
*> \verbatim
*>
*> A rough bound on x is computed; if that is less than overflow, STPSV
*> is called, otherwise, specific code is used which checks for possible
*> overflow or divide-by-zero at every operation.
*>
*> A columnwise scheme is used for solving A*x = b. The basic algorithm
*> if A is lower triangular is
*>
*> x[1:n] := b[1:n]
*> for j = 1, ..., n
*> x(j) := x(j) / A(j,j)
*> x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j]
*> end
*>
*> Define bounds on the components of x after j iterations of the loop:
*> M(j) = bound on x[1:j]
*> G(j) = bound on x[j+1:n]
*> Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}.
*>
*> Then for iteration j+1 we have
*> M(j+1) <= G(j) / | A(j+1,j+1) |
*> G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] |
*> <= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | )
*>
*> where CNORM(j+1) is greater than or equal to the infinity-norm of
*> column j+1 of A, not counting the diagonal. Hence
*>
*> G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | )
*> 1<=i<=j
*> and
*>
*> |x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| )
*> 1<=i< j
*>
*> Since |x(j)| <= M(j), we use the Level 2 BLAS routine STPSV if the
*> reciprocal of the largest M(j), j=1,..,n, is larger than
*> max(underflow, 1/overflow).
*>
*> The bound on x(j) is also used to determine when a step in the
*> columnwise method can be performed without fear of overflow. If
*> the computed bound is greater than a large constant, x is scaled to
*> prevent overflow, but if the bound overflows, x is set to 0, x(j) to
*> 1, and scale to 0, and a non-trivial solution to A*x = 0 is found.
*>
*> Similarly, a row-wise scheme is used to solve A**T*x = b. The basic
*> algorithm for A upper triangular is
*>
*> for j = 1, ..., n
*> x(j) := ( b(j) - A[1:j-1,j]**T * x[1:j-1] ) / A(j,j)
*> end
*>
*> We simultaneously compute two bounds
*> G(j) = bound on ( b(i) - A[1:i-1,i]**T * x[1:i-1] ), 1<=i<=j
*> M(j) = bound on x(i), 1<=i<=j
*>
*> The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we
*> add the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1.
*> Then the bound on x(j) is
*>
*> M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) |
*>
*> <= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| )
*> 1<=i<=j
*>
*> and we can safely call STPSV if 1/M(n) and 1/G(n) are both greater
*> than max(underflow, 1/overflow).
*> \endverbatim
*>
* =====================================================================
SUBROUTINE SLATPS( UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE,
$ CNORM, INFO )
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*
* .. Scalar Arguments ..
CHARACTER DIAG, NORMIN, TRANS, UPLO
INTEGER INFO, N
REAL SCALE
* ..
* .. Array Arguments ..
REAL AP( * ), CNORM( * ), X( * )
* ..
*
* =====================================================================
*
* .. Parameters ..
REAL ZERO, HALF, ONE
PARAMETER ( ZERO = 0.0E+0, HALF = 0.5E+0, ONE = 1.0E+0 )
* ..
* .. Local Scalars ..
LOGICAL NOTRAN, NOUNIT, UPPER
INTEGER I, IMAX, IP, J, JFIRST, JINC, JLAST, JLEN
REAL BIGNUM, GROW, REC, SMLNUM, SUMJ, TJJ, TJJS,
$ TMAX, TSCAL, USCAL, XBND, XJ, XMAX
* ..
* .. External Functions ..
LOGICAL LSAME
INTEGER ISAMAX
REAL SASUM, SDOT, SLAMCH
EXTERNAL LSAME, ISAMAX, SASUM, SDOT, SLAMCH
* ..
* .. External Subroutines ..
EXTERNAL SAXPY, SSCAL, STPSV, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC ABS, MAX, MIN
* ..
* .. Executable Statements ..
*
INFO = 0
UPPER = LSAME( UPLO, 'U' )
NOTRAN = LSAME( TRANS, 'N' )
NOUNIT = LSAME( DIAG, 'N' )
*
* Test the input parameters.
*
IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
INFO = -1
ELSE IF( .NOT.NOTRAN .AND. .NOT.LSAME( TRANS, 'T' ) .AND. .NOT.
$ LSAME( TRANS, 'C' ) ) THEN
INFO = -2
ELSE IF( .NOT.NOUNIT .AND. .NOT.LSAME( DIAG, 'U' ) ) THEN
INFO = -3
ELSE IF( .NOT.LSAME( NORMIN, 'Y' ) .AND. .NOT.
$ LSAME( NORMIN, 'N' ) ) THEN
INFO = -4
ELSE IF( N.LT.0 ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'SLATPS', -INFO )
RETURN
END IF
*
* Quick return if possible
*
IF( N.EQ.0 )
$ RETURN
*
* Determine machine dependent parameters to control overflow.
*
SMLNUM = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' )
BIGNUM = ONE / SMLNUM
SCALE = ONE
*
IF( LSAME( NORMIN, 'N' ) ) THEN
*
* Compute the 1-norm of each column, not including the diagonal.
*
IF( UPPER ) THEN
*
* A is upper triangular.
*
IP = 1
DO 10 J = 1, N
CNORM( J ) = SASUM( J-1, AP( IP ), 1 )
IP = IP + J
10 CONTINUE
ELSE
*
* A is lower triangular.
*
IP = 1
DO 20 J = 1, N - 1
CNORM( J ) = SASUM( N-J, AP( IP+1 ), 1 )
IP = IP + N - J + 1
20 CONTINUE
CNORM( N ) = ZERO
END IF
END IF
*
* Scale the column norms by TSCAL if the maximum element in CNORM is
* greater than BIGNUM.
*
IMAX = ISAMAX( N, CNORM, 1 )
TMAX = CNORM( IMAX )
IF( TMAX.LE.BIGNUM ) THEN
TSCAL = ONE
ELSE
TSCAL = ONE / ( SMLNUM*TMAX )
CALL SSCAL( N, TSCAL, CNORM, 1 )
END IF
*
* Compute a bound on the computed solution vector to see if the
* Level 2 BLAS routine STPSV can be used.
*
J = ISAMAX( N, X, 1 )
XMAX = ABS( X( J ) )
XBND = XMAX
IF( NOTRAN ) THEN
*
* Compute the growth in A * x = b.
*
IF( UPPER ) THEN
JFIRST = N
JLAST = 1
JINC = -1
ELSE
JFIRST = 1
JLAST = N
JINC = 1
END IF
*
IF( TSCAL.NE.ONE ) THEN
GROW = ZERO
GO TO 50
END IF
*
IF( NOUNIT ) THEN
*
* A is non-unit triangular.
*
* Compute GROW = 1/G(j) and XBND = 1/M(j).
* Initially, G(0) = max{x(i), i=1,...,n}.
*
GROW = ONE / MAX( XBND, SMLNUM )
XBND = GROW
IP = JFIRST*( JFIRST+1 ) / 2
JLEN = N
DO 30 J = JFIRST, JLAST, JINC
*
* Exit the loop if the growth factor is too small.
*
IF( GROW.LE.SMLNUM )
$ GO TO 50
*
* M(j) = G(j-1) / abs(A(j,j))
*
TJJ = ABS( AP( IP ) )
XBND = MIN( XBND, MIN( ONE, TJJ )*GROW )
IF( TJJ+CNORM( J ).GE.SMLNUM ) THEN
*
* G(j) = G(j-1)*( 1 + CNORM(j) / abs(A(j,j)) )
*
GROW = GROW*( TJJ / ( TJJ+CNORM( J ) ) )
ELSE
*
* G(j) could overflow, set GROW to 0.
*
GROW = ZERO
END IF
IP = IP + JINC*JLEN
JLEN = JLEN - 1
30 CONTINUE
GROW = XBND
ELSE
*
* A is unit triangular.
*
* Compute GROW = 1/G(j), where G(0) = max{x(i), i=1,...,n}.
*
GROW = MIN( ONE, ONE / MAX( XBND, SMLNUM ) )
DO 40 J = JFIRST, JLAST, JINC
*
* Exit the loop if the growth factor is too small.
*
IF( GROW.LE.SMLNUM )
$ GO TO 50
*
* G(j) = G(j-1)*( 1 + CNORM(j) )
*
GROW = GROW*( ONE / ( ONE+CNORM( J ) ) )
40 CONTINUE
END IF
50 CONTINUE
*
ELSE
*
* Compute the growth in A**T * x = b.
*
IF( UPPER ) THEN
JFIRST = 1
JLAST = N
JINC = 1
ELSE
JFIRST = N
JLAST = 1
JINC = -1
END IF
*
IF( TSCAL.NE.ONE ) THEN
GROW = ZERO
GO TO 80
END IF
*
IF( NOUNIT ) THEN
*
* A is non-unit triangular.
*
* Compute GROW = 1/G(j) and XBND = 1/M(j).
* Initially, M(0) = max{x(i), i=1,...,n}.
*
GROW = ONE / MAX( XBND, SMLNUM )
XBND = GROW
IP = JFIRST*( JFIRST+1 ) / 2
JLEN = 1
DO 60 J = JFIRST, JLAST, JINC
*
* Exit the loop if the growth factor is too small.
*
IF( GROW.LE.SMLNUM )
$ GO TO 80
*
* G(j) = max( G(j-1), M(j-1)*( 1 + CNORM(j) ) )
*
XJ = ONE + CNORM( J )
GROW = MIN( GROW, XBND / XJ )
*
* M(j) = M(j-1)*( 1 + CNORM(j) ) / abs(A(j,j))
*
TJJ = ABS( AP( IP ) )
IF( XJ.GT.TJJ )
$ XBND = XBND*( TJJ / XJ )
JLEN = JLEN + 1
IP = IP + JINC*JLEN
60 CONTINUE
GROW = MIN( GROW, XBND )
ELSE
*
* A is unit triangular.
*
* Compute GROW = 1/G(j), where G(0) = max{x(i), i=1,...,n}.
*
GROW = MIN( ONE, ONE / MAX( XBND, SMLNUM ) )
DO 70 J = JFIRST, JLAST, JINC
*
* Exit the loop if the growth factor is too small.
*
IF( GROW.LE.SMLNUM )
$ GO TO 80
*
* G(j) = ( 1 + CNORM(j) )*G(j-1)
*
XJ = ONE + CNORM( J )
GROW = GROW / XJ
70 CONTINUE
END IF
80 CONTINUE
END IF
*
IF( ( GROW*TSCAL ).GT.SMLNUM ) THEN
*
* Use the Level 2 BLAS solve if the reciprocal of the bound on
* elements of X is not too small.
*
CALL STPSV( UPLO, TRANS, DIAG, N, AP, X, 1 )
ELSE
*
* Use a Level 1 BLAS solve, scaling intermediate results.
*
IF( XMAX.GT.BIGNUM ) THEN
*
* Scale X so that its components are less than or equal to
* BIGNUM in absolute value.
*
SCALE = BIGNUM / XMAX
CALL SSCAL( N, SCALE, X, 1 )
XMAX = BIGNUM
END IF
*
IF( NOTRAN ) THEN
*
* Solve A * x = b
*
IP = JFIRST*( JFIRST+1 ) / 2
DO 100 J = JFIRST, JLAST, JINC
*
* Compute x(j) = b(j) / A(j,j), scaling x if necessary.
*
XJ = ABS( X( J ) )
IF( NOUNIT ) THEN
TJJS = AP( IP )*TSCAL
ELSE
TJJS = TSCAL
IF( TSCAL.EQ.ONE )
$ GO TO 95
END IF
TJJ = ABS( TJJS )
IF( TJJ.GT.SMLNUM ) THEN
*
* abs(A(j,j)) > SMLNUM:
*
IF( TJJ.LT.ONE ) THEN
IF( XJ.GT.TJJ*BIGNUM ) THEN
*
* Scale x by 1/b(j).
*
REC = ONE / XJ
CALL SSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
X( J ) = X( J ) / TJJS
XJ = ABS( X( J ) )
ELSE IF( TJJ.GT.ZERO ) THEN
*
* 0 < abs(A(j,j)) <= SMLNUM:
*
IF( XJ.GT.TJJ*BIGNUM ) THEN
*
* Scale x by (1/abs(x(j)))*abs(A(j,j))*BIGNUM
* to avoid overflow when dividing by A(j,j).
*
REC = ( TJJ*BIGNUM ) / XJ
IF( CNORM( J ).GT.ONE ) THEN
*
* Scale by 1/CNORM(j) to avoid overflow when
* multiplying x(j) times column j.
*
REC = REC / CNORM( J )
END IF
CALL SSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
X( J ) = X( J ) / TJJS
XJ = ABS( X( J ) )
ELSE
*
* A(j,j) = 0: Set x(1:n) = 0, x(j) = 1, and
* scale = 0, and compute a solution to A*x = 0.
*
DO 90 I = 1, N
X( I ) = ZERO
90 CONTINUE
X( J ) = ONE
XJ = ONE
SCALE = ZERO
XMAX = ZERO
END IF
95 CONTINUE
*
* Scale x if necessary to avoid overflow when adding a
* multiple of column j of A.
*
IF( XJ.GT.ONE ) THEN
REC = ONE / XJ
IF( CNORM( J ).GT.( BIGNUM-XMAX )*REC ) THEN
*
* Scale x by 1/(2*abs(x(j))).
*
REC = REC*HALF
CALL SSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
END IF
ELSE IF( XJ*CNORM( J ).GT.( BIGNUM-XMAX ) ) THEN
*
* Scale x by 1/2.
*
CALL SSCAL( N, HALF, X, 1 )
SCALE = SCALE*HALF
END IF
*
IF( UPPER ) THEN
IF( J.GT.1 ) THEN
*
* Compute the update
* x(1:j-1) := x(1:j-1) - x(j) * A(1:j-1,j)
*
CALL SAXPY( J-1, -X( J )*TSCAL, AP( IP-J+1 ), 1,
$ X,
$ 1 )
I = ISAMAX( J-1, X, 1 )
XMAX = ABS( X( I ) )
END IF
IP = IP - J
ELSE
IF( J.LT.N ) THEN
*
* Compute the update
* x(j+1:n) := x(j+1:n) - x(j) * A(j+1:n,j)
*
CALL SAXPY( N-J, -X( J )*TSCAL, AP( IP+1 ), 1,
$ X( J+1 ), 1 )
I = J + ISAMAX( N-J, X( J+1 ), 1 )
XMAX = ABS( X( I ) )
END IF
IP = IP + N - J + 1
END IF
100 CONTINUE
*
ELSE
*
* Solve A**T * x = b
*
IP = JFIRST*( JFIRST+1 ) / 2
JLEN = 1
DO 140 J = JFIRST, JLAST, JINC
*
* Compute x(j) = b(j) - sum A(k,j)*x(k).
* k<>j
*
XJ = ABS( X( J ) )
USCAL = TSCAL
REC = ONE / MAX( XMAX, ONE )
IF( CNORM( J ).GT.( BIGNUM-XJ )*REC ) THEN
*
* If x(j) could overflow, scale x by 1/(2*XMAX).
*
REC = REC*HALF
IF( NOUNIT ) THEN
TJJS = AP( IP )*TSCAL
ELSE
TJJS = TSCAL
END IF
TJJ = ABS( TJJS )
IF( TJJ.GT.ONE ) THEN
*
* Divide by A(j,j) when scaling x if A(j,j) > 1.
*
REC = MIN( ONE, REC*TJJ )
USCAL = USCAL / TJJS
END IF
IF( REC.LT.ONE ) THEN
CALL SSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
*
SUMJ = ZERO
IF( USCAL.EQ.ONE ) THEN
*
* If the scaling needed for A in the dot product is 1,
* call SDOT to perform the dot product.
*
IF( UPPER ) THEN
SUMJ = SDOT( J-1, AP( IP-J+1 ), 1, X, 1 )
ELSE IF( J.LT.N ) THEN
SUMJ = SDOT( N-J, AP( IP+1 ), 1, X( J+1 ), 1 )
END IF
ELSE
*
* Otherwise, use in-line code for the dot product.
*
IF( UPPER ) THEN
DO 110 I = 1, J - 1
SUMJ = SUMJ + ( AP( IP-J+I )*USCAL )*X( I )
110 CONTINUE
ELSE IF( J.LT.N ) THEN
DO 120 I = 1, N - J
SUMJ = SUMJ + ( AP( IP+I )*USCAL )*X( J+I )
120 CONTINUE
END IF
END IF
*
IF( USCAL.EQ.TSCAL ) THEN
*
* Compute x(j) := ( x(j) - sumj ) / A(j,j) if 1/A(j,j)
* was not used to scale the dotproduct.
*
X( J ) = X( J ) - SUMJ
XJ = ABS( X( J ) )
IF( NOUNIT ) THEN
*
* Compute x(j) = x(j) / A(j,j), scaling if necessary.
*
TJJS = AP( IP )*TSCAL
ELSE
TJJS = TSCAL
IF( TSCAL.EQ.ONE )
$ GO TO 135
END IF
TJJ = ABS( TJJS )
IF( TJJ.GT.SMLNUM ) THEN
*
* abs(A(j,j)) > SMLNUM:
*
IF( TJJ.LT.ONE ) THEN
IF( XJ.GT.TJJ*BIGNUM ) THEN
*
* Scale X by 1/abs(x(j)).
*
REC = ONE / XJ
CALL SSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
X( J ) = X( J ) / TJJS
ELSE IF( TJJ.GT.ZERO ) THEN
*
* 0 < abs(A(j,j)) <= SMLNUM:
*
IF( XJ.GT.TJJ*BIGNUM ) THEN
*
* Scale x by (1/abs(x(j)))*abs(A(j,j))*BIGNUM.
*
REC = ( TJJ*BIGNUM ) / XJ
CALL SSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
X( J ) = X( J ) / TJJS
ELSE
*
* A(j,j) = 0: Set x(1:n) = 0, x(j) = 1, and
* scale = 0, and compute a solution to A**T*x = 0.
*
DO 130 I = 1, N
X( I ) = ZERO
130 CONTINUE
X( J ) = ONE
SCALE = ZERO
XMAX = ZERO
END IF
135 CONTINUE
ELSE
*
* Compute x(j) := x(j) / A(j,j) - sumj if the dot
* product has already been divided by 1/A(j,j).
*
X( J ) = X( J ) / TJJS - SUMJ
END IF
XMAX = MAX( XMAX, ABS( X( J ) ) )
JLEN = JLEN + 1
IP = IP + JINC*JLEN
140 CONTINUE
END IF
SCALE = SCALE / TSCAL
END IF
*
* Scale the column norms by 1/TSCAL for return.
*
IF( TSCAL.NE.ONE ) THEN
CALL SSCAL( N, ONE / TSCAL, CNORM, 1 )
END IF
*
RETURN
*
* End of SLATPS
*
END
``` |
Spaccanapoli may refer to:
Spaccanapoli (street), a street in Naples, Italy
Spaccanapoli (band), a band from Naples named after the street |
In biochemistry, immunostaining is any use of an antibody-based method to detect a specific protein in a sample. The term "immunostaining" was originally used to refer to the immunohistochemical staining of tissue sections, as first described by Albert Coons in 1941. However, immunostaining now encompasses a broad range of techniques used in histology, cell biology, and molecular biology that use antibody-based staining methods.
Techniques
Immunohistochemistry
Immunohistochemistry or IHC staining of tissue sections (or immunocytochemistry, which is the staining of cells), is perhaps the most commonly applied immunostaining technique. While the first cases of IHC staining used fluorescent dyes (see immunofluorescence), other non-fluorescent methods using enzymes such as peroxidase (see immunoperoxidase staining) and alkaline phosphatase are now used. These enzymes are capable of catalysing reactions that give a coloured product that is easily detectable by light microscopy. Alternatively, radioactive elements can be used as labels, and the immunoreaction can be visualized by autoradiography.
Tissue preparation or fixation is essential for the preservation of cell morphology and tissue architecture. Inappropriate or prolonged fixation may significantly diminish the antibody binding capability. Many antigens can be successfully demonstrated in formalin-fixed paraffin-embedded tissue sections. However, some antigens will not survive even moderate amounts of aldehyde fixation. Under these conditions, tissues should be rapidly fresh frozen in liquid nitrogen and cut with a cryostat. The disadvantages of frozen sections include poor morphology, poor resolution at higher magnifications, difficulty in cutting over paraffin sections, and the need for frozen storage. Alternatively, vibratome sections do not require the tissue to be processed through organic solvents or high heat, which can destroy the antigenicity, or disrupted by freeze thawing. The disadvantage of vibratome sections is that the sectioning process is slow and difficult with soft and poorly fixed tissues, and that chatter marks or vibratome lines are often apparent in the sections.
The detection of many antigens can be dramatically improved by antigen retrieval methods that act by breaking some of the protein cross-links formed by fixation to uncover hidden antigenic sites. This can be accomplished by heating for varying lengths of times (heat induced epitope retrieval or HIER) or using enzyme digestion (proteolytic induced epitope retrieval or PIER).
One of the main difficulties with IHC staining is overcoming specific or non-specific background. Optimisation of fixation methods and times, pre-treatment with blocking agents, incubating antibodies with high salt, and optimising post-antibody wash buffers and wash times are all important for obtaining high quality immunostaining. In addition, the presence of both positive and negative controls for staining are essential for determining specificity.
Flow cytometry
A flow cytometer can be used for the direct analysis of cells expressing one or more specific proteins. Cells are immunostained in solution using methods similar to those used for immunofluorescence, and then analysed by flow cytometry.
Flow cytometry has several advantages over IHC including: the ability to define distinct cell populations by their size and granularity; the capacity to gate out dead cells; improved sensitivity; and multi-colour analysis to measure several antigens simultaneously. However, flow cytometry can be less effective at detecting extremely rare cell populations, and there is a loss of architectural relationships in the absence of a tissue section. Flow cytometry also has a high capital cost associated with the purchase of a flow cytometer.
Western blotting
Western blotting allows the detection of specific proteins from extracts made from cells or tissues, before or after any purification steps. Proteins are generally separated by size using gel electrophoresis before being transferred to a synthetic membrane via dry, semi-dry, or wet blotting methods. The membrane can then be probed using antibodies using methods similar to immunohistochemistry, but without a need for fixation. Detection is typically performed using peroxidase linked antibodies to catalyse a chemiluminescent reaction.
Western blotting is a routine molecular biology method that can be used to semi-quantitatively compare protein levels between extracts. The size separation prior to blotting allows the protein molecular weight to be gauged as compared with known molecular weight markers.
Enzyme-linked immunosorbent assay
The enzyme-linked immunosorbent assay or ELISA is a diagnostic method for quantitatively or semi-quantitatively determining protein concentrations from blood plasma, serum or cell/tissue extracts in a multi-well plate format (usually 96-wells per plate). Broadly, proteins in solution are absorbed to ELISA plates. Antibodies specific for the protein of interest are used to probe the plate. Background is minimised by optimising blocking and washing methods (as for IHC), and specificity is ensured via the presence of positive and negative controls. Detection methods are usually colorimetric or chemiluminescence based.
Immuno-electron microscopy
Electron microscopy or EM can be used to study the detailed microarchitecture of tissues or cells. Immuno-EM allows the detection of specific proteins in ultrathin tissue sections. Antibodies labelled with heavy metal particles (e.g. gold) can be directly visualised using transmission electron microscopy. While powerful in detecting the sub-cellular localisation of a protein, immuno-EM can be technically challenging, expensive, and require rigorous optimisation of tissue fixation and processing methods. Protein biotinylation in vivo was proposed to alleviate the problems caused by frequent incompatibility of antibody staining with fixation protocols that better preserve cell morphology.
Methodological overview
In immunostaining methods, an antibody is used to detect a specific protein epitope. These antibodies can be monoclonal or polyclonal. Detection of this first or primary antibody can be accomplished in multiple ways.
The primary antibody can be directly labeled using an enzyme or fluorophore.
The primary antibody can be labeled using a small molecule which interacts with a high affinity binding partner that can be linked to an enzyme or fluorophore. The biotin-streptavidin is one commonly used high affinity interaction.
The primary antibody can be probed for using a broader species-specific secondary antibody that is labeled using an enzyme, or fluorophore.
In the case of electron microscopy, antibodies are linked to a heavy metal particle (typically gold nanoparticles in the range 5-15nm diameter).
As previously described, enzymes such as horseradish peroxidase or alkaline phosphatase are commonly used to catalyse reactions that give a coloured or chemiluminescent product. Fluorescent molecules can be visualised using fluorescence microscopy or confocal microscopy.
Applications
The applications of immunostaining are numerous, but are most typically used in clinical diagnostics and laboratory research.
Clinically, IHC is used in histopathology for the diagnosis of specific types of cancers based on molecular markers.
In laboratory science, immunostaining can be used for a variety of applications based on investigating the presence or absence of a protein, its tissue distribution, its sub-cellular localisation, and of changes in protein expression or degradation.
See also
Cutaneous conditions with immunofluorescence findings
Immunostaining protocol
List of histologic stains that aid in diagnosis of cutaneous conditions
References
Immunology
Flow cytometry
Protein methods |
```java
/*
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.shardingsphere.sql.parser.statement.opengauss.ddl;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.FetchStatement;
import org.apache.shardingsphere.sql.parser.statement.opengauss.OpenGaussStatement;
/**
* OpenGauss fetch statement.
*/
public final class OpenGaussFetchStatement extends FetchStatement implements OpenGaussStatement {
}
``` |
Kennelly is a surname. Notable people with the surname include:
Ardyth Kennelly (1912–2005), American novelist
Arthur E. Kennelly (1861–1939), American engineer
Barbara B. Kennelly (born 1936), Connecticut Representative
Brendan Kennelly (1936–2021), Irish poet and novelist
Jerry Kennelly, Irish photojournalist, founder of Stockbyte and Tweak.com
Joan Kennelly (died 2007), Irish photojournalist
Keala Kennelly (born 1978), American surfer
Martin H. Kennelly (1887–1961), mayor of Chicago
Matt Kennelly (Mathew Luke Kennelly; born 1989), Australian baseball player
Matthew F. Kennelly (born 1956), Federal District Court Judge in Illinois
Michael Kennelly (1914–2011), American Jesuit Catholic priest, President of the Loyola University New Orleans (1970–1974)
Noel Kennelly (born 1979), Irish Gaelic football player
Pádraig Kennelly (1929–2011), Irish journalist, editor and photographer
Pat Kennelly (1900–1981), Australian politician
Paul Kennelly (born 1947), Australian rules footballer
Richard Kennelly (born 1965), American Olympic rower
Ryan Kennelly (born 1974), American powerlifter
Sheila Kennelly (born 1927), Australian actress
Tadhg Kennelly (born 1981), Irish Gaelic football player
Tim Kennelly (1954–2005), Irish Gaelic football player
Tim Kennelly (baseball) (born 1986), Australian baseball player
See also
Kennelly–Heaviside layer, a layer of the Earth's ionosphere
Kenneally (disambiguation) |
Olga Algertovna Volozhinskaya (; , born 18 May 1962) is a former ice dancer who competed for the Soviet Union. With Alexander Svinin, she is the 1983 European silver medalist, 1985 Skate Canada International champion, and competed at the 1984 Winter Olympics in Sarajevo.
Personal life
Volozhinskaya was born on 18 May 1962 in Tallinn. She married Russian figure skater Sergey Petrovskiy, with whom she has two sons, Nikita and Anton.
Career
Volozhinskaya competed with Alexander Svinin for the Soviet Union. Winners of the 1980 Grand Prix International St. Gervais, they made their senior ISU Championship debut later that season at the 1981 World Championships, placing fifth. Volozhinskaya/Svinin were fourth at the 1982 European Championships and sixth at the 1982 World Championships. Their best international results came the next year — silver at the 1983 European Championships and fourth at the 1983 World Championships.
Volozhinskaya/Svinin placed fifth at the 1984 European Championships and were assigned to the 1984 Winter Olympics where they placed seventh. Although no longer sent to ISU Championships, they competed for two more seasons, winning gold at the 1984 Skate Canada International, bronze at the 1984 Prize of Moscow News, and silver at the 1985 Skate Canada International. After retiring from competition, they performed in ice shows in England and the United States.
Volozhinskaya is now a choreographer, based in Florida. Her clients have included Alena Leonova, Stacey Pensgen, Daniel Samohin, and Maria Vigalova / Egor Zakroev.
Results
with Svinin
References
Soviet female ice dancers
Olympic figure skaters for the Soviet Union
Figure skaters at the 1984 Winter Olympics
Living people
Figure skaters from Tallinn
1962 births
European Figure Skating Championships medalists
Estonian people of Russian descent |
Borowina is a village in the administrative district of Gmina Józefów, within Biłgoraj County, Lublin Voivodeship, in eastern Poland. It lies approximately north of Józefów, east of Biłgoraj, and south of the regional capital Lublin.
References
Villages in Biłgoraj County |
The Gaels are a European ethnolinguistic group.
Gael or Gaels may also refer to:
People
Gaël (given name), a list of people with the personal name
Anna Gaël, stage name of Hungarian actress Anna Thynn, Marchioness of Bath (born 1943)
Barent Gael (c. 1630–1698), Dutch landscape painter
Josseline Gaël (1917–1995), French film actress born Jeannine Augustine Jeanne Blanleuil
Gael (footballer), Equatoguinean footballer
Sports
Clarington Green Gaels, lacrosse team in Ontario, Canada
Iona Gaels, athletic teams of Iona University in New York
Queen's Golden Gaels, athletic teams of Queen's University at Kingston in Ontario, Canada
Saint Mary's Gaels, athletic teams of Saint Mary's College of California
Other uses
Gaël, a commune in Brittany, France
Gael Airfield, an abandoned World War II military airfield near the commune
Gael (magazine), a monthly women's magazine in Belgium
Iona Gaels, the athletics teams of Iona College, in New Rochelle, New York
PS Gael (1867), a passenger paddle steamer
"The Gael", a 1990 piece of music by Dougie MacLean
See also
Ralph de Gael (before 1042–c. 1096), Earl of East Anglia and Lord of Gaël and Montfort, leader of the last serious revolt against William the Conqueror |
William Ray Price (born January 30, 1952) is a former judge of the Supreme Court of Missouri and its longest-serving Supreme Court member, having served from April 7, 1992, when he was appointed to the Court by then-Governor John Ashcroft, until August 1, 2012, when he retired from the bench. He was retained by a vote of the people of Missouri for twelve-year terms in 1994 and again in 2006. He served two 2-year terms as Chief Justice of the Supreme Court of Missouri from July 1, 1999, to June 30, 2001 and from July 1, 2009, to June 30, 2011. He graduated Phi Beta Kappa and Kappa Sigma from the University of Iowa, attended Yale Divinity School and received his law degree from Washington and Lee University School of Law in 1978. He was in private practice in Kansas City from 1978 to 1992, where he served as a director of Truman Medical Center and president of the Kansas City Board of Police Commissioners. Since retiring from the bench, he has joined the law firm of Armstrong Teasdale LLP in its St. Louis office.
References
External links
William Ray Price Jr. on the Missouri Supreme Court website
1952 births
Living people
20th-century American judges
20th-century American lawyers
21st-century American judges
Chief Justices of the Supreme Court of Missouri
Judges of the Supreme Court of Missouri
People from Fairfield, Iowa
University of Iowa alumni
Washington and Lee University School of Law alumni
Yale Divinity School alumni |
```xml
/*
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
import { BaseEvent, EventQueuer } from '../../base_event';
import { TerminatedStateAccount, terminatedStateSchema } from '../stores/terminated_state';
export class TerminatedStateCreatedEvent extends BaseEvent<TerminatedStateAccount> {
public schema = terminatedStateSchema;
public log(ctx: EventQueuer, chainID: Buffer, data: TerminatedStateAccount): void {
this.add(ctx, data, [chainID]);
}
}
``` |
Beverley Lois Anderson-Manley (born 8 November 1941) is a Jamaican public figure. In the 1970s she emerged as a leader of women's rights advocacy, leading a campaign for a maternity leave. From 1972 to 1993, she was married to Michael Manley, who was Prime Minister of Jamaica from 1972 to 1980. Manley was known for being more radical than her husband and helping him connect with Jamaica's black population. She was a popular figure among the majority of Jamaicans. Manley also co-founded a radio show with Eric Anthony Abrahams in 1992. After divorcing Michael, she published The Manley Memoirs in 2008, and in 2012 she married Donald Keith Duncan.
Early life
Beverley Lois Anderson was born on 8 November 1941, to Esmine Anderson and Eric Anderson, and grew up in "meager" surroundings in a working-class family. She had African ancestry. Her father was a clerk for the Jamaica Railway Corporation. Manley entered careers as a model and a public broadcaster, becoming a popular figure known for favoring Jamaican music over music from other countries. In the 1970s, she attended the University of the West Indies, Mona.
Marriage to Michael Manley
She married Michael Manley in 1972, and they had two children: the first in 1974 and the second in 1980. Michael Manley was 17 years older than her, and she was his fourth wife. He became Prime Minister of Jamaica in 1972, holding the role for eight years. Manley was First Lady of Jamaica for the duration of his term, advocating on behalf of women and children. She was also president of the PNP's women's movement in at least 1979, advocating for maternity leave, and a leader of the movement throughout the 1970s. A law that granted maternity leave was signed in 1979. Biographer Michael Darrell E. Levi wrote in 1989 that Beverley Manley "played a major role in sensitizing her husband to women's concerns". In 1974, she spoke to UNESCO about women's rights. She also visited Moscow and Cuba and was a vocal anti-imperialist, for which she was attacked by The Gleaner newspaper. She was more politically radical than her husband.
Manley also worked to help her husband "connect" with Jamaica's black populationwhile his skin was light, she had dark skin, an Afro reminiscent of the Black Power movement, and often wore "African attire" such as a dashikiand developed a reputation for being involved with gender-related issues. She later said she helped Michael with his public speaking. Manley was not universally accepted by wealthier and more powerful Jamaicans; for instance, some told her to straighten her hair. However, she was widely supported and admired by the general populace. Manley was Jamaica's patron of International Women's Year in 1975 and attended the International Women's Year Conference that year. She sought to establish forms of day care and education for infants. In 1975, Manley was fired upon while she and her husband led a funeral procession for the politician Winston Blake.
Manley has also represented Jamaica in the United Nations Commission on the Status of Women.
Later life
She attended Howard University from 1985 to 1986, working towards a Doctor of Philosophy. Their marriage fell apart after both she and her husband were unfaithful. They divorced in 1993. The year before, Manley and Eric Anthony Abrahams had created a radio show that focused on current events, The Breakfast Club.
She entered into a relationship with Donald Keith Duncan, who had been a minister in her husband's cabinet. In 2008, she published The Manley Memoirs, an autobiography of her childhood and marriage. In a review of the work, Christopher Porter for The Washington Post wrote: "In some ways, Beverley was to Prime Minister Michael Manley what Hillary Clinton was to Bill Clinton — with everything that implies: a strong, smart woman married to a brilliant but human leader, whose philandering caused pain in the marriage... (And she had her own dalliances, too.)" On 21 January 2012, Manley and Duncan were married after a 32-year affair. The two were together until Duncan's death in 2020. Manley is the subject of and appeared in a four-part film documentary titled Beverley Manley Uncensored in July 2022.
References
Bibliography
Living people
1941 births
21st-century memoirists
Howard University alumni
Jamaican radio presenters
Jamaican women radio presenters
Jamaican women activists
Spouses of prime ministers of Jamaica
University of the West Indies alumni |
South Korea's far-right party, the Our Republican Party, has been founded twice historically.
Our Republican Party (2017)
Our Republican Party (2020) |
Bahlul () or Pahlul () is a village near the city of Stepanakert, de facto part of the breakaway Republic of Artsakh, de jure in Azerbaijan.
History
In June 1919, the village and the neighboring villages of Ghaibalishen (Khaibalikend), Jamilli, and Karkijahan were looted and destroyed in the Khaibalikend massacre with 600-700 ethnic Armenians being killed by armed Kurdish irregulars and Azerbaijani soldiers.
References
External links
Stepanakert |
Eley Williams is a British writer. Her debut collection of prose, Attrib. and Other Stories (Influx Press, 2017), was awarded the Republic of Consciousness Prize and the James Tait Black Memorial Prize 2018. With writing anthologised in The Penguin Book of the Contemporary British Short Story (Penguin Classics, 2018), Liberating the Canon (Dostoevsky Wannabe, 2018) and Not Here: A Queer Anthology of Loneliness (Pilot Press, 2017), she is an alumna of the MacDowell workshop and a Fellow of the Royal Society of Literature. She teaches at Royal Holloway, University of London, and supervises Jungftak, a journal for contemporary prose poetry.
Her first novel, The Liar's Dictionary, was published in 2020, described in The Guardian as a "virtuoso performance full of charm... a glorious novel – a perfectly crafted investigation of our ability to define words and their power to define us." Stuart Kelly in a review in The Spectator wrote of the book: "It deals with love as something which cannot be put into words, and dare not speak its name (done neither stridently nor sentimentally). It is, in short, a delight."
Williams' stories "Moderate to Poor, Occasionally Good" (2018) and "Moonlighting" (2019) have been broadcast on BBC Radio 4 under the Short Works strand, and her story "Scrimshaw" was a finalist for the 2020 BBC National Short Story Award. A 10-part radio series Gambits, based around the theme of chess, was broadcast on Radio 4 beginning in November 2021.
Awards and honours
In 2017, Williams received the Society of Authors's Writing Grant, and in 2018, she received a MacDowell Fellowship and Fellowship of Royal Society of Literature.
In 2023, Williams was named on the Granta Best of Young British Novelists list, compiled every 10 years since 1983, identifying the 20 most significant British novelists aged under 40.
Selected bibliography
"In pursuit of the swan at Brentford Ait," essay in An Unreliable Guide to London, edited by Kit Caless and Gary Budden (2016)
Attrib. and Other Stories, short story collection (2017)
Frit, poetry pamphlet (2017)
"Of Père Lachaise, On Business," in We'll Never Have Paris, edited by Andrew Gallix (2019)
"To Plot, Plan, Redress," on the Rebecca Riots 1839, in Resist: Stories of Uprising (2019)
"Scrimshaw," story anthologised in Still Worlds Turning (2019), shortlisted for the BBC National Short Story Award 2020
The Liar's Dictionary, novel (2020)
References
Academics of the University of London
Alumni of Selwyn College, Cambridge
English writers
Fellows of the Royal Society of Literature
James Tait Black Memorial Prize recipients
Living people
Year of birth missing (living people)
21st-century British women writers
21st-century English writers |
Edward Del Castillo is the Founder, Executive President, and Chief Creative Officer of Liquid Entertainment.
Career
Origin Systems
Prior to founding Liquid, he served as Senior Producer for Lord British Studios and Firaxis within Origin Systems. There he created, developed, and produced the first three-dimensional Ultima game, advised on Ultima Online, and produced Sid Meier's Gettysburg!. Within Lord British Studios, he pioneered and managed the transition from two dimensional gaming to three dimensions, including creating the design, art and code pipelines necessary to transition the entire department from two- to three-dimensional gaming.
Westwood Studios
Prior to his work at Origin, Del Castillo worked at Westwood Studios, where he served as the producer on the original Command & Conquer: Tiberian Dawn, and Red Alert, along with several expansions, ports, and other projects. On Command & Conquer and Red Alert, he was the primary creative and managerial force responsible for the creation, design, and production of all aspects of these titles. Under his supervision, these genre creating titles went on to become some of the most well awarded titles in gaming history. Del Castillo's deep understanding of game design has led him to be well published throughout the industry.
Liquid Entertainment
As founder, president and chief creative officer of Liquid Entertainment, Del Castillo's first game was Battle Realms, published by Crave Entertainment and Ubisoft in November 2001 to critical acclaim. Battle Realms is a real-time strategy PC game for Windows that features an unconventional approach to resource management and unit development. It was well received by reviewers, many of whom praised its state-of-the-art 3D engine and East Asian-inspired setting and aesthetics. It was nominated Best PC Strategy game of 2002 by The Academy of Interactive Arts & Sciences, and was chosen for Computer Gaming World's Top 10 Games of E3 2001. Liquid Entertainment has since released multiple next-gen console titles and also mobile, social and casual games to critical success in its 15+ years in business. These titles include intellectual properties of The Lord of the Rings, ABC's Desperate Housewives, Marvel Comics' Thor and the Dungeons & Dragons series.
At the end of 2014, Ed reduced the size of Liquid Entertainment. Liquid continued as an IP holding company and consultancy that benefitted from its games that were available online.
Current Work
In 2016 Ed became the COO of HERO Digital Entertainment, a joint venture funded by India company, JetSynthesys. Working with a US and India office he installed an efficient and world-class development and production process.
Beginning in 2018, Ed became a full-time consultant. He offers management advice on production methodologies.
Personal life
He holds a bachelor's degree in economics from the University of California, San Diego with a double minor in Visual Arts and Psychology. He was born on November 14, 1968 and has two sons with his wife, Carmen.
Games developed
The Keys to Maramon (1990), published by Mindcraft Software, Inc.
Siege (1992), published by Mindcraft Software, Inc.
Tegel's Mercenaries (1992), published by Mindcraft Software, Inc.
Strike Squad (1993), published by Mindcraft Software, Inc.
Bloodstone: An Epic Dwarven Tale (1993), published by Mindcraft Software, Inc.
Ambush at Sorinor (1993), published by Mindcraft Software, Inc.
Command & Conquer (1995), published by Virgin Interactive Entertainment (Europe) Ltd.
Command & Conquer: Red Alert (1996), published by Virgin Interactive Entertainment (Europe) Ltd.
Command & Conquer: The Covert Operations (1996), published by Virgin Interactive Entertainment (Europe) Ltd.
Command & Conquer (Special Gold Edition) (1997), published by Virgin Interactive Entertainment (Europe) Ltd.
Command & Conquer: Red Alert - Counterstrike (1997), published by Virgin Interactive Entertainment (Europe) Ltd.
Westwood Studios 10th Anniversary Collection (1996), published by Virgin Interactive Entertainment (Europe) Ltd.
Sid Meier's Gettysburg! (1997), published by Electronic Arts, Inc.
Sid Meier's Alpha Centauri (1999), published by Electronic Arts, Inc.
Ultima IX: Ascension (1999), published by Electronic Arts
Battle Realms (2001), published by Crave Entertainment and Ubisoft
Battle Realms: Winter of the Wolf (2002), published by Crave Entertainment and Ubisoft
The Lord of the Rings: War of the Ring (2003), published by Sierra Entertainment
Dungeons & Dragons: Dragonshard (2005), published by Atari
Desperate Housewives: The Game (2006), published by Buena Vista Games
Rise of the Argonauts (2008), published by Codemasters
Thor: God of Thunder (2011), published by SEGA
Deadline Hollywood: The Game (2012), published by Paramount Digital Entertainment
Instant Jam: Facebook (2012), published by GarageGames
Dungeons & Dragons: Heroes of Neverwinter (2012), published by Atari
Karateka (2013), published by Karateka, LLC
Cuddle Pets (2013), published by Digital Capital
Paper Galaxy (2014), published by Liquid Entertainment, LLC
Max Steel (2014), published by Mattel
References
External links
Liquid Entertainment Official Site
1968 births
Living people
American video game designers |
Eurovision: You Decide was the most recent name of the BBC TV show broadcast to select the United Kingdom's entry into the Eurovision Song Contest.
Shows of similar formats have previously gone under several other names, including Festival of British Popular Songs, Eurovision Song Contest British Final, A Song For Europe, The Great British Song Contest, Eurovision: Making Your Mind Up and Eurovision: Your Decision. In 2011 the selection process was replaced by an internal BBC decision, but this process ended after 2015 with a revival of a national final for 2016 under a new name. The You Decide format was axed in September 2019 and an internal selection was used for the UK's 2020 participation.
This page lists the contestants for each year of the show; the winners of the contest are in bold-italics.
Competition
In 1957, 1959 and 1960, there were a series of televised heats prior to the final.
Postcard voting was used to choose the winner from 1965 to 1975. This had to be abandoned in 1971 due to a postal strike, with regional juries, made up of ordinary members of the public selecting the winner. Juries did the job from 1957 to 1964 and from 1976 to 1987. From 1988 onwards, with the exception of the internally selected entries (2011–15 and 2020–21), televoting has been organized ostensibly to choose the winner, although this result wasn't always followed. Panels of judges have also played a part in selecting finalists and the winners in various years since 2008.
Festival of British Popular Songs (1957)
1957
Tuesday, 12 February. The King's Theatre Hammersmith, London.
Host: David Jacobs
Each song was performed by two different artists
Voting: 10 regional juries of 12 members with 1 vote each, located in Belfast, Newcastle, Bangor, Edinburgh, Manchester, Nottingham, Cardiff, Birmingham, Glasgow & London.
~ Eliminated in one of three televised heats (Tuesday, 22 January, Tuesday, 29 January & Tuesday, 5 February).
1958 Not Held. No UK Entry at Eurovision Song Contest
Eurovision Song Contest British Final (1959–1960)
1959
Saturday, 7 February. BBC Television Theatre, London.
Host: Pete Murray
Voting: 7 regional juries from South of England, English Midlands, Northern England, Northern Ireland, Scotland, Wales & West of England, with 14 persons in each jury.
~ Eliminated in one of two televised heats (Monday, 2 February & Thursday, 5 February).
1960
Saturday, 6 February. BBC Television Theatre, London.
Host: David Jacobs
Voting: 7 Regional Juries, with 15 people in each jury. Juries: South of England, English Midlands, North of England, Scotland, Wales, West of England and Northern Ireland.
~ Eliminated in one of two televised heats (Tuesday, 2 February & Thursday, 4 February).
A Song For Europe (1961–1995)
1961
Wednesday, 15 February. BBC Television Theatre, London.
Hostess: Katie Boyle
Voting: 12 Regional Juries of 10 jurors with 1 vote each, located in Aberdeen, Glasgow, Belfast, Leeds, Bangor, Manchester, Norwich, Birmingham, Cardiff, London, Bristol & Southampton.
1962
Sunday, 11 February. BBC Television Theatre, London.
Host: David Jacobs
Voting: 14 Regional Juries in Aberdeen, Edinburgh, Glasgow, Belfast, Newcastle, Leeds, Manchester, Nottingham, Birmingham, Cardiff, London, Plymouth, Southampton and Bristol.
1963
Saturday, 23 February. BBC Television Theatre, London.
Host: David Jacobs
Voting: 16 Regional Juries in Aberdeen, Edinburgh, Glasgow, Belfast, Newcastle, Leeds, Manchester, Nottingham, Norwich, Birmingham, Cardiff, London North, London South, Plymouth, Southampton & Bristol. 12 persons in each jury, awarding 3 points to their favourite, 2 points to the second and 1 point to the third.
1964
Friday, 7 February. BBC Television Theatre, London.
Host: David Jacobs
All Songs Performed by Matt Monro
Voting: 16 Regional Juries.
1965
Friday, 29 January. BBC Television Theatre, London.
Host: David Jacobs
All Songs Performed by Kathy Kirby on "The Kathy Kirby Show"
Result broadcast Friday, 12 February.
Voting: Viewers cast votes via postcard for their favourite song.
1966
Thursday, 27 January. BBC Television Theatre, London.
Host: David Jacobs
All Songs Performed by Kenneth McKellar on "Kenneth McKellar's Song For Everyone" (BBC1) and "The Light Programme" (BBC Radio)
Result broadcast Thursday, 3 February.
Voting: Viewers cast votes via postcard for their favourite song.
1967
Saturday, 25 February. BBC Television Theatre, London.
Host: Rolf Harris
All Songs Performed by Sandie Shaw on "The Rolf Harris Show"
Result broadcast Saturday, 4 March.
Voting: Viewers cast votes via postcard for their favourite song.
1968
Tuesday, 5 March. BBC Television Theatre, London.
Hostess: Cilla Black
All Songs Performed by Cliff Richard on "Cilla"
Result broadcast Tuesday, 12 March.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Tom Sloan.
1969
Saturday, 22 February. BBC Television Theatre, London.
Host: Michael Aspel
All Songs Performed by Lulu on "Lulu"
Result broadcast Saturday, 1 March.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Tom Sloan.
1970
Saturday, 7 March. BBC Television Theatre, London.
Host: Cliff Richard
All Songs Performed by Mary Hopkin on "It's Cliff Richard!"
Result broadcast Saturday, 14 March.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Bill Cotton.
1971
Saturday, 20 February. BBC Television Theatre, London.
Host: Cliff Richard
All Songs Performed by Clodagh Rodgers on "It's Cliff Richard!" (BBC1) and "The Acker Bilk Show" (BBC Radio 2)
Result broadcast Saturday, 27 February.
Voting: 8 Regional Juries in Belfast, Birmingham, Bristol, Cardiff, Glasgow, London, Manchester & Norwich, each with 10 jurors who could award 1 vote to their favourite song. Results announced by Bill Cotton.
1972
Saturday, 12 February. BBC Television Theatre, London.
Host: Cliff Richard
All Songs Performed by The New Seekers on "It's Cliff Richard!" (BBC1) and "Pete Murray's Open House" (BBC Radio 2)
Result broadcast Saturday, 19 February.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Bill Cotton.
1973
Saturday, 24 February. BBC Television Theatre, London.
Hostess: Cilla Black
All Songs Performed by Cliff Richard on "Cilla" (BBC1) and "Pete Murray's Open House" (BBC Radio 2)
Result broadcast Saturday, 3 March.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Bill Cotton.
1974
Saturday, 23 February. BBC Television Theatre, London.
Host: Jimmy Savile
All Songs Performed by Olivia Newton-John on "Clunk, Click... As It Happens" (BBC1) and "Pete Murray's Open House" (BBC Radio 2)
Result broadcast Saturday, 2 March.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Bill Cotton.
1975
Saturday, 15 February. BBC Television Theatre, London.
Hostess: Lulu
All Songs Performed by The Shadows on "Lulu" (BBC1) and "Pete Murray's Open House" (BBC Radio 2)
Result broadcast Saturday, 22 February.
Voting: Viewers cast votes via postcard for their favourite song. Results announced by Bill Cotton.
1976
Wednesday, 25 February. The Royal Albert Hall, London.
Host: Michael Aspel
Voting: 14 Regional Juries located in Bristol, Bangor, Leeds, Norwich, Newcastle, Aberdeen, Birmingham, Manchester, Belfast, Cardiff, Plymouth, Glasgow, Southampton and London. Each jury ranked the songs 1-12, awarding 12 points for their favourite down to 1 point for their least preferred. Trophies presented by Jimmy Gilbert.
Although all the regional scores were announced in turn by a spokesman (there were no female announcers), and many were recognisable to viewers; none of the voices was identified either by the spokesman or host Michael Aspel.
1977
Wednesday, 9 March. The New London Theatre, London.
Host: Terry Wogan
Voting: 14 Regional Juries located in Belfast, Bristol, Aberdeen, Bangor, Leeds, London, Birmingham, Cardiff, Glasgow, Norwich, Newcastle, Manchester, Plymouth and Southampton. Each jury ranked the songs 1-12, awarding 12 points for their favourite down to 1 point for their least preferred.
(Show not televised due to strike action)
1978
Friday, 31 March. The Royal Albert Hall, London.
Host: Terry Wogan
Voting: 14 Regional Juries located in Belfast, Bristol, Aberdeen, Bangor, Leeds, London, Birmingham, Cardiff, Glasgow, Norwich, Newcastle, Manchester, Plymouth and Southampton. Each jury ranked the songs 1-12, awarding 12 points for their favourite down to 1 point for their least preferred. Trophies presented by Jimmy Gilbert.
Voting Spokespersons
1979
Thursday, 8 March. The Royal Albert Hall, London.
Host: Terry Wogan
Voting: 14 Regional Juries located in Belfast, Bristol, Aberdeen, Bangor, Leeds, London, Birmingham, Cardiff, Glasgow, Norwich, Newcastle, Manchester, Plymouth and Southampton. Each jury ranked the songs 1-12, awarding 12 points for their favourite down to 1 point for their least preferred based on audio recordings of the songs. At the time, Manchester's votes were not included in the final tally as the jury could not be contacted and songs 6 & 12 were declared joint 2nd. The scores and places were adjusted later once the Manchester scores had been confirmed.
(Show abandoned due to strike action)
1980
Wednesday, 26 March. BBC Television Theatre, London.
Host: Terry Wogan
Voting: 14 Regional Juries located in Belfast, Bristol, Aberdeen, Bangor, Leeds, London, Birmingham, Cardiff, Glasgow, Norwich, Newcastle, Manchester, Plymouth and Southampton. Each jury ranked the songs 1-12, awarding 12 points for their favourite down to 1 point for their least preferred. Each jury then awarded 1 vote for the top two songs to break a tie. Trophies presented by Jimmy Gilbert.
Voting Spokespersons
1981
Wednesday, 11 March. BBC Television Theatre, London.
Host: Terry Wogan
Voting: 7 Regional Juries located in Birmingham, Cardiff, Manchester, Belfast, Edinburgh, London and Bristol. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh and 5 to their least preferred.
Voting Spokespersons
1982
Wednesday, 24 March. BBC Television Centre, London.
Host: Terry Wogan
Voting: 7 Regional Juries located in Glasgow, Birmingham, Bristol, Manchester, Belfast, London, Manchester and Cardiff. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh and 5 to their least preferred.
Voting Spokespersons
1983
Thursday, 24 March. BBC Television Theatre, London.
Host: Terry Wogan
Voting: 8 Regional Juries located in Birmingham, Cardiff, Manchester, Belfast, Edinburgh, London, Norwich and Bristol. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh and 5 to their least preferred.
Voting Spokespersons
1984
Wednesday, 4 April. BBC Television Centre, London.
Host: Terry Wogan
Voting: 8 Regional Juries located in Edinburgh, Norwich, Belfast, London, Cardiff, Manchester, Bristol and Birmingham. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh and 5 to their least preferred.
Voting Spokespersons
1985
Friday, 5 April. BBC Television Centre, London.
Host: Terry Wogan
Voting: 9 Regional Juries located in Belfast, Birmingham, Cardiff, Glasgow, London, Norwich, Bristol, Manchester and Plymouth. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh and 5 to their least preferred.
Voting Spokespersons
1986
Wednesday, 2 April. BBC Television Centre, London.
Host: Terry Wogan
Voting: 11 Regional Juries located in Birmingham, Manchester, Bristol, Norwich, Newcastle, Cardiff, London, Leeds, Glasgow, Plymouth & Belast. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh and 5 to their least preferred. The final scores accord with the announced scores during the broadcast, whereas the scoreboard used in the telecast was incorrect due to a technical issue.
Voting Spokespersons
1987
Friday, 10 April. BBC Television Centre, London.
Host: Terry Wogan
Voting: 9 Regional Juries located in Belfast, Birmingham, Bristol, Edinburgh, Cardiff, Manchester, London, Newcastle and Norwich. Juries ranked the songs internally and awarded 15 points to their favourite, 12 to the second, 10 to the third, 9 to the fourth, 8 to the fifth, 7 to the sixth, 6 to the seventh, 5 to the eighth, 3 to the ninth and 1 to their least preferred.
Voting Spokespersons
1988
Friday, 25 March. BBC Television Centre, London.
Host: Terry Wogan
With guest commentators: Gloria Hunniford, Bruce Welch, Mike Batt & George Martin
Voting: Viewers voted by telephone for their favourite song. Scores announced by Gordon Robson.
1989
Friday, 24 March. BBC Television Centre, London.
Host: Terry Wogan
With guest commentators: Lulu, Deke Arlon, Leslie Bricusse & Gary Davies
Voting: Viewers voted by telephone for their favourite song. Scores announced by Gordon Robson.
1990
Friday, 30 March. BBC Television Centre, London.
Host: Terry Wogan
With guest commentators: Gloria Hunniford, Cathy McGowan, Tim Rice & Carl Davis
Voting: Viewers voted by telephone for their favourite song. Scores announced by Gordon Robson.
1991
Friday, 29 March. BBC Television Centre, London.
Host: Terry Wogan
Voting: Viewers voted by telephone for their favourite song. Scores announced by Gordon Robson.
1992
Friday, 3 April. BBC Television Centre, London.
Host: Terry Wogan
All Songs Performed by Michael Ball
Voting: Viewers voted by telephone for their favourite song. Scores announced by Gordon Robson.
1993
Friday, 9 April. BBC Television Centre, London.
Host: Terry Wogan
All Songs Performed by Sonia
Voting: Viewers voted by telephone for their favourite song. Scores announced by Gordon Robson.
1994
Friday, 18 March. BBC Television Centre, London.
Host: Terry Wogan
With guest commentators: Richard O'Brien & Jonathan King
All Songs Performed by Frances Ruffelle
Voting: Viewers voted by telephone for their favourite song. Scores announced by Mike Anderries.
1995
Friday, 31 March. BBC Television Centre, London.
Host: Terry Wogan with Mark Goodier presenting a Top of the Pops preview show
With guest commentators: Tony Mortimer, Ian Dury, Cheryl Baker, Mike Read, Let Loose, Jonathan King, Scarlet & Bruno Brookes
Voting: Viewers voted by telephone for their favourite song. Scores announced by Mike Anderries.
The Great British Song Contest (1996–1999)
1996
Friday, 8 March. BBC Television Centre, London.
Host: Terry Wogan
Voting: Viewers voted by telephone for their favourite song.
~ Eliminated in a televised heat hosted by Nicky Campbell.
1997
Sunday, 9 March. BBC Television Centre, London.
Host: Dale Winton
Result broadcast Saturday, 15 March.
Voting: Viewers voted by telephone for their favourite song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
1998
Sunday, 15 March. BBC Television Centre, London.
Host: Terry Wogan
Result broadcast Saturday, 21 March.
Voting: Viewers voted by telephone for their favourite song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
1999
Sunday, 7 March. BBC Elstree Studios, Borehamwood.
Hostess: Ulrika Jonsson
Result broadcast Friday, 12 March.
Voting: Viewers voted by telephone for their favourite song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
A Song For Europe (2000–2003)
2000
Sunday, 20 February. BBC Elstree Studios, Borehamwood.
Hostess: Katy Hill
Voting: Viewers voted by telephone for their favourite song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
2001
Sunday, 11 March. BBC Elstree Studios, Borehamwood.
Hostess: Katy Hill
Voting: Viewers voted by telephone for their favourite song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
2002
Sunday, 3 March. BBC Elstree Studios, Borehamwood.
Hosts: Christopher Price & Claire Sweeney
Voting: Viewers voted by telephone for their favourite song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
2003
Sunday, 2 March. BBC Television Centre, London.
Host: Terry Wogan
Voting: Viewers voted by telephone for their favourite song. The votes were then divided into 6 regions: Scotland, Southern England, Northern Ireland, English Midlands, Northern England and Wales, with 12 points given to the highest scoring song in each region, 10 to the second, 9 to the third and 0 to the fourth placed song.
* Eliminated in a radio only heat hosted by Terry Wogan & Ken Bruce.
"Now And Forever" was performed in the radio only semi final by Esther Hart and was titled "Wait for the Moment". Hart withdrew when she qualified for the Dutch National Final. Her replacement was the group 'United Colours of Sound', who also withdrew before the televised final; being replaced in turn by Simon Chapman.
Voting Spokespersons
Eurovision: Making Your Mind Up! (2004–2007)
2004
Saturday, 28 February. BBC Television Centre, London.
Hosts: Terry Wogan & Gaby Roslin with Paddy O'Connell on BBC Three
With Panellists: Carrie Grant, Harry Hill & Lorraine Kelly
Voting: Viewers voted by telephone for their favourite song. The votes were then divided into 7 regions: South West England, Wales, Northern Ireland, English Midlands, South East England, Northern England and Scotland, with 12 points given to the highest scoring song in each region, 8 to the second, 6 to the third, 4 to the fourth, 2 to the fifth and 0 to the lowest ranked song. Votes given by SMS (regardless of location) were separately allocated as a percentage of the vote received and added to the regional scores.
Voting spokespersons
2005
Saturday, 5 March. BBC Television Centre, London.
Hosts: Terry Wogan & Natasha Kaplinsky
With Panellists: Jonathan Ross, Bruno Tonioli, Paddy O'Connell & Natalie Cassidy
Voting: Viewers voted by telephone for their favourite song. The votes were then divided into 8 regions: South West England, South East England, Wales, Northern Ireland, English Midlands, Northern England, Scotland and any votes cast via the Internet (regardless of location), with 12 points given to the highest scoring song in each region, 8 to the second, 6 to the third, 4 to the fourth and 2 to the lowest ranked song. Votes given by SMS were separately allocated as a percentage of the vote received and added to the regional scores. Trophies presented by Sandie Shaw.
Voting spokespersons
2006
Saturday, 4 March. BBC Television Centre, London.
Hosts: Terry Wogan & Natasha Kaplinsky
With Panellists: Jonathan Ross, Bruno Tonioli, Fearne Cotton & Kelly Osbourne
Voting: Viewers voted by telephone for their favourite song. The votes were then divided into 8 regions: Northern England, South East England, Scotland, English Midlands, Northern Ireland, Wales, South West England and any votes cast via the Internet (regardless of location), with 12 points given to the highest scoring song in each region, 8 to the second, 6 to the third, 4 to the fourth, 2 to the fifth and 0 to the lowest ranked song. Votes given by SMS were separately allocated as a percentage of the vote received and added to the regional scores. Trophies presented by Elena Paparizou.
Voting spokespersons
2007
Saturday, 17 March. Maidstone Studios, Maidstone, Kent.
Hosts: Terry Wogan & Fearne Cotton
With Panellists: John Barrowman & Mel Giedroyc
Voting: Viewers voted by phone for their favourite song. Following an initial round of voting, the top two songs were performed again and voted on a second time. No details of the scores were given.
Eurovision: Your Decision (2008)
2008
Saturday, 1 March. BBC Television Centre, London.
Hosts: Terry Wogan & Claudia Winkleman
With Panellists/Judges: John Barrowman & Carrie Grant
Voting: LoveShy, Rob McVeigh and Andy Abraham were eliminated by judges John Barrowman & Carrie Grant. Andy Abraham was then 'saved' by Terry Wogan and reinstated. Viewers voted by phone for their favourite of the four remaining songs. Following an initial round of voting, the top two songs were performed again and voted on a second time. No details of the scores were given.
Eurovision: Your Country Needs You (2009–2010)
2009
Saturday, 31 January. BBC Television Centre, London.
Host: Graham Norton
With Panellists: Andrew Lloyd Webber, Lulu, Diane Warren, Duncan James, Arlene Phillips, Emma Bunton & Alesha Dixon
Voting: Viewers voted by telephone for their favourite act each week. The bottom 2 acts were then judged by Andrew Lloyd Webber who chose to 'save' one of the 2. On the final show, viewers voted by telephone for their favourite of the three remaining acts. No details of the scoring was given.
Colour key
Act received the most public votes
Act was in the "danger zone"
Act was eliminated by Andrew Lloyd Webber
2010
Friday, 12 March. BBC Television Centre, London.
Host: Graham Norton
With Judge: Pete Waterman and Panellists: Bruno Tonioli, Jade Ewen & Mike Stock
Voting: Three singing acts - Miss Fitz, Uni5 and Karen Harding - were eliminated by judge Pete Waterman. Viewers voted by telephone for their favourite of the three remaining acts. No details of the scoring was given.
Internal selections (2011–2015)
There was no televised national selection procedure for the UK Eurovision entrant from 2011 to 2015.
2011
Blue were selected to represent Britain in the Eurovision Song Contest 2011 internally by the BBC, with the song "I Can", written by Duncan James, Lee Ryan, Ciaron Bell, Ben Collier, Ian Hope, Liam Keenan and 'StarSign'. In place of a national final, a one-hour documentary following the groups preparations for Germany, entitled Eurovision: Your Country Needs Blue was broadcast by BBC One on 16 April 2011.
2012
Engelbert Humperdinck was selected internally by the BBC to perform "Love Will Set You Free". The song was written by Grammy award-winning producer Martin Terefe and Ivor Novello winner Sacha Skarbek, who co-wrote the James Blunt hit "You're Beautiful".
2013
An internal selection followed again in 2013, with Bonnie Tyler being chosen to represent the UK with the song "Believe in Me", written and composed by Desmond Child, Lauren Christy and Chris Braide.
2014
Another internal selection followed in 2014, with Molly being chosen to represent the UK with the song "Children of the Universe", co-written by herself and Swedish producer Anders Hansson. However, Smitten-Downes was a relatively unknown artist who was discovered through the BBC Introducing platform.
2015
A fifth internal selection took place in 2015, although the BBC accepted submissions from the public and song writing community. Electro Velvet were chosen to represent the UK with the song "Still in Love With You", co-written by Adrian Bax White and David Mindel, who had written many previous songs for the UK heats, his best result being two joint 2nd songs in 1982.
Eurovision: You Decide (2016–2019)
2016
Friday, 26 February. The O2 Forum, Kentish Town, London.
Hostess: Mel Giedroyc
With Panellists: Carrie Grant, Katrina Leskanich & Jay Revell
Voting: Viewers voted by telephone and/or online for their favourite song. No details of the scores or places were given.
2017
Friday, 27 January. Eventim Apollo, Hammersmith, London.
Hostess: Mel Giedroyc
With Panellists: Bruno Tonioli, Sophie Ellis-Bextor & CeCe Sammy
Voting: Viewers voted by telephone and/or online for their favourite song. The panel of experts, which formed part of the eight-member jury panel, also voted during the show. No details of the scores or places were given.
2018
Wednesday, 7 February. Brighton Dome, Brighton.
Hosts: Mel Giedroyc & Måns Zelmerlöw
With Panellists: Rylan, Rochelle Humes & Tom Fletcher
Voting: Viewers voted by telephone and/or online for their favourite song, combined with the votes from the eight-member jury, to select the winner. The panel of experts did not vote this year and no details of the scores or places were given.
2019
Friday, 8 February. Dock10, MediaCityUK, Salford, Greater Manchester.
Hosts: Mel Giedroyc & Måns Zelmerlöw
With Panellists: Rylan, Marvin Humes & Mollie King
Voting: Three songs competed in three "song-offs", where each song was performed in two musically different styles by two different artists, with one artist from each pair (chosen by the expert panel) going through to a final public vote. Following this, viewers then voted by telephone and/or online for their favourite song to select the winner. No details of the scores or places were given.
Internal selection (2020–present)
There was no televised national selection procedure for the UK Eurovision entry.
2020
On 27 February 2020, BBC announced that James Newman would represent the United Kingdom in the Eurovision Song Contest 2020 with the song, "My Last Breath". The Eurovision Song Contest 2020 was eventually cancelled.
2021
On 19 February 2021, BBC confirmed that Newman would represent the United Kingdom in the 2021 contest with the song "Embers". The BBC also announced the renewed collaboration between BBC Studios and record label BMG in finding the song. The song was released and published by BMG after being revealed in March 2021.
2022
On 10 March 2022, BBC revealed that Sam Ryder would represent the UK at the Eurovision Song Contest 2022 in Turin, Italy, with the song "Space Man".
2023
Mae Muller was announced as the chosen entrant with her song "I Wrote a Song" on 9 March 2023.
List of multiple contestants
Excludes internally selected entrants with no multi-artist national selection participations, uncredited backing singers and musicians, but includes members of groups named as such.
See also
UK national selection for the Eurovision Song Contest
UK Eurovision Song Contest entries discography
Notes and references
Notes
References
United Kingdom in the Eurovision Song Contest |
In geometry, the exsphere of a face of a regular polyhedron is the sphere outside the polyhedron which touches the face and the planes defined by extending the adjacent faces outwards. It is tangent to the face externally and tangent to the adjacent faces internally.
It is the 3-dimensional equivalent of the excircle.
The sphere is more generally well-defined for any face which is a regular
polygon and delimited by faces with the same dihedral angles
at the shared edges. Faces of semi-regular polyhedra often
have different types of faces, which define exspheres of different size with each type of face.
Parameters
The exsphere touches the face of the regular polyedron at the center
of the incircle of that face. If the exsphere radius is denoted , the radius of this incircle
and the dihedral angle between the face and the extension of the
adjacent face , the center of the exsphere
is located from the viewpoint at the middle of one edge of the
face by bisecting the dihedral angle. Therefore
is the 180-degree complement of the
internal face-to-face angle.
Tetrahedron
Applied to the geometry of the Tetrahedron of edge length ,
we have an incircle radius (derived by dividing twice the face area through the
perimeter ), a dihedral angle , and in consequence .
Cube
The radius of the exspheres of the 6 faces of the Cube
is the same as the radius of the inscribed
sphere, since and its complement are the same, 90 degrees.
Icosahedron
The dihedral angle applicable to the Icosahedron is derived by
considering the coordinates of two triangles with a common edge,
for example one face with vertices
at
the other at
where is the golden ratio. Subtracting vertex coordinates
defines edge vectors,
of the first face and
of the other. Cross products of the edges of the first face and second
face yield (not normalized) face normal vectors
of the first and
of the second face, using .
The dot product between these two face normals yields the cosine
of the dihedral angle,
For an icosahedron of edge length , the incircle radius of the triangular faces is , and finally the radius of the 20 exspheres
See also
Insphere
External links
Geometry |
Titilagarh (), is a Municipality located in the Indian state of Odisha. It is a known summer hotspot in India due its extreme heatwaves.
Geography and Climate
Titilagarh is located at . It has an average elevation of 215 metres (705 feet).
Demographics
India census, Titilagarh had a population of 27,756. Males constitute 52% of the population and females 48%. Titilagarh has an average literacy rate of 67%, higher than the national average of 59.5%: male literacy is 75%, and female literacy is 57%. In Titilagarh, 12% of the population is under 6 years of age.
Transport
Titilagarh Junction railway station is a junction on the Jharsuguda - Vizianagaram line and Raipur - Vizianagaram line. Through this it is connected to all major cities of India. It was one of the major railway stations in the Sambalpur Railway Division under East Coast Railway Zone.
Titilagarh is near to NH-59 (previously known as NH-217), which runs between Gopalpur in Odisha and Raipur in Chhattisgarh. There is a state highway between Titilagarh and Balangir district via Saintala and between Titilagarh to Bhawanipatana via Sindhekela.
Notable people
Uday Chand Agarwal - IAS, Ex-Secretary, Dept. of Personnel, Ex, Chief Vigilance Commissioner, Government of India.
Sam Pitroda - Padma Bhushan awardee, Telecom engineer, inventor and entrepreneur.
Asit Tripathy - IAS, Chief Secretary, Govt of Odisha.
Jitendra Mishra - Film maker.
Om Prakash Agarwal - IAS, served in World Bank (USA).
Capt. Chandrahas Behera - Indian Army Corps of EME.
Justice Balkrishna Behera - Judge, High Court (Odisha).
Dr. Balkishan Agarwal - Medical Specialist, Edinburgh (UK).
Ritesh Agarwal - CEO of OYO Rooms.
Humane Sagar - Playback Singer.
Saswat Joshi - Internationally acclaimed Odissi dancer.
References
External links
Bolangir District Website
S Odisha Government Website
Odisha Tourism
Titilagarh Municipality Website
Cities and towns in Bolangir district
Balangir district |
```smalltalk
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading.Tasks;
using Certify.Config;
using Certify.Models;
using Certify.Models.API;
using Certify.Models.Config;
using Certify.Models.Config.Migration;
using Certify.Models.Providers;
using Certify.Providers;
using Certify.Shared;
namespace Certify.Management
{
public interface ICertifyManager
{
Task Init();
void SetStatusReporting(IStatusReporting statusReporting);
Task<bool> IsServerTypeAvailable(StandardServerTypes serverType);
Task<Version> GetServerTypeVersion(StandardServerTypes serverType);
Task<List<ActionStep>> RunServerDiagnostics(StandardServerTypes serverType, string siteId);
Task<ManagedCertificate> GetManagedCertificate(string id);
Task<List<ManagedCertificate>> GetManagedCertificates(ManagedCertificateFilter filter = null);
Task<ManagedCertificateSearchResult> GetManagedCertificateResults(ManagedCertificateFilter filter = null);
Task<Certify.Models.Reporting.StatusSummary> GetManagedCertificateSummary(ManagedCertificateFilter filter = null);
Task<ManagedCertificate> UpdateManagedCertificate(ManagedCertificate site);
Task DeleteManagedCertificate(string id);
Task<ImportExportPackage> PerformExport(ExportRequest exportRequest);
Task<List<ActionStep>> PerformImport(ImportRequest importRequest);
Task<List<SimpleAuthorizationChallengeItem>> GetCurrentChallengeResponses(string challengeType, string key = null);
Task<List<AccountDetails>> GetAccountRegistrations();
Task<ActionResult> AddAccount(ContactRegistration reg);
Task<ActionResult> UpdateAccountContact(string storageKey, ContactRegistration contact);
Task<ActionResult> RemoveAccount(string storageKey, bool includeAccountDeactivation = false);
Task<ActionResult<AccountDetails>> ChangeAccountKey(string storageKey, string newKeyPEM = null);
Task<List<StatusMessage>> TestChallenge(ILog log, ManagedCertificate managedCertificate, bool isPreviewMode, IProgress<RequestProgressState> progress = null);
Task<List<StatusMessage>> PerformChallengeCleanup(ILog log, ManagedCertificate managedCertificate, IProgress<RequestProgressState> progress = null);
Task<List<ActionResult>> PerformServiceDiagnostics();
Task<List<DnsZone>> GetDnsProviderZones(string providerTypeId, string credentialsId);
Task<ActionResult> UpdateCertificateAuthority(CertificateAuthority certificateAuthority);
Task<List<CertificateAuthority>> GetCertificateAuthorities();
Task<StatusMessage> RevokeCertificate(ILog log, ManagedCertificate managedCertificate);
Task<CertificateRequestResult> PerformDummyCertificateRequest(ManagedCertificate managedCertificate, IProgress<RequestProgressState> progress = null);
Task<ActionResult> RemoveCertificateAuthority(string id);
Task<List<SiteInfo>> GetPrimaryWebSites(StandardServerTypes serverType, bool ignoreStoppedSites, string itemId = null);
Task<List<CertificateRequestResult>> RedeployManagedCertificates(ManagedCertificateFilter filter, IProgress<RequestProgressState> progress = null, bool isPreviewOnly = false, bool includeDeploymentTasks = false);
Task<CertificateRequestResult> DeployCertificate(ManagedCertificate managedCertificate, IProgress<RequestProgressState> progress = null, bool isPreviewOnly = false, bool includeDeploymentTasks = false);
Task<CertificateRequestResult> PerformCertificateRequest(ILog log, ManagedCertificate managedCertificate, IProgress<RequestProgressState> progress = null, bool resumePaused = false, bool skipRequest = false, bool failOnSkip = false, bool skipTasks = false, bool isInteractive = false, string reason = null);
Task<List<DomainOption>> GetDomainOptionsFromSite(StandardServerTypes serverType, string siteId);
Task<List<CertificateRequestResult>> PerformRenewAll(RenewalSettings settings, ConcurrentDictionary<string, Progress<RequestProgressState>> progressTrackers = null);
Task<bool> PerformRenewalTasks();
Task<bool> PerformDailyMaintenanceTasks();
Task PerformCertificateCleanup();
Task<List<ActionResult>> PerformCertificateMaintenanceTasks(string managedItemId = null);
Task<List<ActionStep>> GeneratePreview(ManagedCertificate item);
void ReportProgress(IProgress<RequestProgressState> progress, RequestProgressState state, bool logThisEvent = true);
Task<List<ActionStep>> PerformDeploymentTask(ILog log, string managedCertificateId, string taskId, bool isPreviewOnly, bool skipDeferredTasks, bool forceTaskExecution);
Task<List<DeploymentProviderDefinition>> GetDeploymentProviders();
Task<List<ActionResult>> ValidateDeploymentTask(ManagedCertificate managedCertificate, DeploymentTaskConfig taskConfig);
Task<DeploymentProviderDefinition> GetDeploymentProviderDefinition(string id, DeploymentTaskConfig config);
Task<LogItem[]> GetItemLog(string id, int limit = 1000);
Task<string[]> GetServiceLog(string logType, int limit = 10000);
ICredentialsManager GetCredentialsManager();
IManagedItemStore GetManagedItemStore();
Task ApplyPreferences();
Task<List<ProviderDefinition>> GetDataStoreProviders();
Task<List<DataStoreConnection>> GetDataStores();
Task<List<ActionStep>> CopyDateStoreToTarget(string sourceId, string destId);
Task<List<ActionStep>> SetDefaultDataStore(string dataStoreId);
Task<List<ActionStep>> UpdateDataStoreConnection(DataStoreConnection dataStore);
Task<List<ActionStep>> RemoveDataStoreConnection(string dataStoreId);
Task<List<ActionStep>> TestDataStoreConnection(DataStoreConnection connection);
Task<ActionResult> TestCredentials(string storageKey);
Task<Core.Management.Access.IAccessControl> GetCurrentAccessControl();
}
}
``` |
Woman of Fire () is a 1971 South Korean film directed by Kim Ki-young. This was the second film in Kim's Housemaid trilogy followed by Woman of Fire '82. The film is a remake of the classical The Housemaid.
Plot
In South Korea, a man named Dong-sik and a woman named Myeong-ja are found dead near a poultry farm with multiple stab wounds. The police assume it is a robbery but also find Jeong-suk, the wife of Dong-sik as a person of interest. While a robber is suspected (owing to a confession from a crazed man), attention soon turns to Jeong-suk, particularly when discrepancies come to light such as a letter apparently from the dead woman. Throughout the film, the story of the two dead people come to light, which involves Myeong-ja having come to work for free at the farm of the family (as run by the wife) while recovering from trauma involving an attacker that had seen her leave her rural roots; unlike the wife, she is comfortable dealing with pests such as rats, with her at one point squashing a rat with her shoe. In fact, she doesn't want a great amount of pay, merely wanting to find a suitable husband. Dong-sik is a songwriter under the constant pressure of female would-be suitors such as Hye-suk, and when Jeong-suk has to go on business, she tasks Myeong-ja to guard him. Push comes to shove when Myeong-ja prevents Hye-suk from making advances on Dong-sik only to find herself in the arms of a drunken rape by him when he mistakes her for Hye-suk. The result is that she becomes pregnant, but when Jeong-suk finds out, she forces her to have an abortion.
Unfortunately, Myeong-ja finds revenge by taking revenge on their child and trapping them with the knowledge for blackmail. Another person happens to be tangled in their web when he is found dead by blunt force trauma. Eventually, tired of the game, Dong-sik goes with Myeong-ja to drink rat poison together, but he manages to make his way to the arms of his wife in order to tell her to make it look like he was stabbed to death. In the end, the last sequence of the film shows the wife out of the police station collapsing before losing a shoe as it washes away in a gutter.
Production and analysis
There are considerable similarities between The Housemaid and Woman of Fire, which each have the women being the breadwinner of the family before the introduction of a maid to the equation. His later films in Insect Woman (1972) and Beasts of Prey (1985) have been thought to have touched upon similar dynamics within their portrayal of weak-willed men engaging in affairs that result in trouble. When Kim was asked about similarities between his films, he stated the following: “A carpenter builds homes relying on his talent and insight. A carpenter who is talented in handling wood builds a wooden house; one who’s good with bricks builds a brick house. It’s the same with me. Starting with ‘The Housemaid,’ and going through ‘Woman of Fire’ and ‘Insect Woman,’ the films that saw success were those about demon-like femme fatales who, for their own reasonings, destroy domestic peace. What is success? People flock to theaters because the films are well-made. So my calculation is that I’m proficient in this kind of genre.”
This was the feature film debut for Youn Yuh-jung, who appeared in both two further films with Kim. Decades later, when she won the Academy Award for Best Supporting Actress in 2021, she gave thanks to Kim for their work together.
Release
Woman of Fire was rescreened in South Korean cinemas on May 1, 2021.
Cast
Namkoong Won as Dong-shik
Jeon Gye-hyeon as Jeong-suk
Youn Yuh-jung as Myeong-ja
Choi Moo-ryong as Detective
Kim Ju-mi-hye
O Yeong-a as Hye-ok
Hwang Baek
Chu Seok-yang as Ki-ja
Lee Hoon
Lee Ji-yeon
Awards
Festival de Cine de Sitges
Special Mention Best Actress (Youn Yuh-jung)
Blue Dragon Film Awards
Best Director (Kim Ki-young)
Notes
Bibliography
External links
Maids in films
1970s Korean-language films
Films directed by Kim Ki-young
South Korean romantic thriller films
South Korean erotic films
Remakes of South Korean films |
C. John "Jack" Collins is an American academic and professor of Old Testament at Covenant Theological Seminary, where he has served since 1993.
He received a BS and MS (computer science and systems engineering) from the Massachusetts Institute of Technology, an M.Div. from Faith Evangelical Lutheran Seminary, and a Ph.D. in Biblical Hebrew linguistics from the School of Archaeology and Oriental Studies, University of Liverpool.
Collins was Old Testament Chairman for the ESV Study Bible, served as ESV Text Editor for The English-Greek Reverse Interlinear New Testament (Crossway, 2006), and is Old Testament Editor of the English Standard Version Study Bible.
He has published numerous articles in technical journals, as well as The New International Dictionary of Old Testament Theology and Exegesis. In 2000 his book on the theological and exegetical aspects of divine action, entitled The God of Miracles, was published by Crossway. It was also carried by InterVarsity Press in the UK the following year. His next book, Science and Faith: Friends or Foes? was also published by Crossway in 2003, followed by Genesis 1-4: A Linguistic, Theological, and Literary Commentary, published by P&R (2006).
Collins' recent book Did Adam and Eve Really Exist?: Who They Were and Why You Should Care (Crossway, 2011), in which he highlights the importance to Christian theology of believing that the biblical period fall of man was a historical event, and explores whether such a belief can be compatible with a Darwinian view of human origins. Collins has been a prominent voice in recent discussion among evangelicals on this topic.
Works
Thesis
Books
Edited by
References
Living people
MIT School of Engineering alumni
Alumni of the University of Liverpool
Covenant Theological Seminary faculty
Year of birth missing (living people) |
Nanahimik ang Gabi (A Silent Night) is a 2022 Philippine suspense thriller film starring Ian Veneracion, Heaven Peralejo, and Mon Confiado. It was directed by Shugo Praico under Rein Entertainment.
Cast
Ian Veneracion as Chief: A corrupt and abusive police officer who plays a role of "sugar daddy" in his relationship to Me-Ann. Veneracion found Chief to be very different than himself personality-wise.
Heaven Peralejo as Me-Ann: The "sugar baby" of Chief. Peralejo was offered the role three to four times. She initially hesitated to accept the role due to feeling unready to fulfill some scenes for the film. She described Me-Ann as being different than herself, an independent woman who is a provider for her family. Me-Ann on the other hand is happily willing to rely on Chief despite his abusive behavior since she ultimately benefits from their relationship.
Mon Confiado: Plays the antagonist of the film. Confiado devised method acting in preparation for his role of a character capable of killing. He isolated himself in the mountains for four days for his role since the film is set in a secluded house. Director Praico described the casting for Confiado's role as "tricky" with around 15 actors were considered to portray the character.
Production
Nanahimik ang Gabi was produced under Rein Entertainment with Shugo Praico as its director and writer. It is a suspense thriller film which has both sexual and violent content. The film revolves around the covert relationship of a woman with a corrupt police officer and "sugar daddy." Principal photography began in July 2022 in Tagaytay.
Release
Nanahimik ang Gabi was released on cinemas in the Philippines on December 25, 2022 as one of the eight official entries of the 2022 Metro Manila Film Festival.
References
Philippine thriller films |
is a passenger railway station located in the city of Sanuki, Kagawa Prefecture, Japan, operated by Shikoku Railway Company (JR Shikoku). It is numbered "T17".
Lines
Zōda Station is served by the Kōtoku Line, and lies 21.3 km from the starting point of the line at Takamatsu Station.
Station layout
The station consists of two side platforms serving two tracks. The platforms are linked by a footbridge.
Platforms
History
Zōda Station opened on 21 March 1926. With the privatization of Japanese National Railways (JNR) on 1 April 1987, the station came under the control of JR Shikoku.
The station became unstaffed from 1 September 2010.
A new station building was built adjoining the original structure, opening for use on 10 February 2017.
Surrounding area
Zōda Elementary School
See also
List of railway stations in Japan
References
External links
Zoda Station timetable
Railway stations in Kagawa Prefecture
Stations of Shikoku Railway Company
Railway stations in Japan opened in 1926
Sanuki, Kagawa |
```java
package home.smart.fly.animations.recyclerview.customitemdecoration.sticky;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
/**
* Created by cpf on 2018/1/16.
*/
public class StickyItemDecoration extends RecyclerView.ItemDecoration {
/**
* itemView
*/
private View mStickyItemView;
/**
* itemView
*/
private int mStickyItemViewMarginTop;
/**
* itemView
*/
private int mStickyItemViewHeight;
/**
* view
*/
private StickyView mStickyView;
/**
* UIview
*/
private boolean mCurrentUIFindStickView;
/**
* adapter
*/
private RecyclerView.Adapter<RecyclerView.ViewHolder> mAdapter;
/**
* viewHolder
*/
private RecyclerView.ViewHolder mViewHolder;
/**
* position list
*/
private List<Integer> mStickyPositionList = new ArrayList<>();
/**
* layout manager
*/
private LinearLayoutManager mLayoutManager;
/**
* position
*/
private int mBindDataPosition = -1;
/**
* paint
*/
private Paint mPaint;
public StickyItemDecoration() {
mStickyView = new ExampleStickyView();
initPaint();
}
/**
* init paint
*/
private void initPaint() {
mPaint = new Paint();
mPaint.setAntiAlias(true);
}
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
super.onDrawOver(c, parent, state);
if (parent.getAdapter().getItemCount() <= 0) return;
mLayoutManager = (LinearLayoutManager) parent.getLayoutManager();
mCurrentUIFindStickView = false;
for (int m = 0, size = parent.getChildCount(); m < size; m++) {
View view = parent.getChildAt(m);
/**
* view
*/
if (mStickyView.isStickyView(view)) {
mCurrentUIFindStickView = true;
getStickyViewHolder(parent);
cacheStickyViewPosition(m);
if (view.getTop() <= 0) {
bindDataForStickyView(mLayoutManager.findFirstVisibleItemPosition(), parent.getMeasuredWidth());
} else {
if (mStickyPositionList.size() > 0) {
if (mStickyPositionList.size() == 1) {
bindDataForStickyView(mStickyPositionList.get(0), parent.getMeasuredWidth());
} else {
int currentPosition = getStickyViewPositionOfRecyclerView(m);
int indexOfCurrentPosition = mStickyPositionList.lastIndexOf(currentPosition);
if (indexOfCurrentPosition >= 1) bindDataForStickyView(mStickyPositionList.get(indexOfCurrentPosition - 1), parent.getMeasuredWidth());
}
}
}
if (view.getTop() > 0 && view.getTop() <= mStickyItemViewHeight) {
mStickyItemViewMarginTop = mStickyItemViewHeight - view.getTop();
} else {
mStickyItemViewMarginTop = 0;
View nextStickyView = getNextStickyView(parent);
if (nextStickyView != null && nextStickyView.getTop() <= mStickyItemViewHeight) {
mStickyItemViewMarginTop = mStickyItemViewHeight - nextStickyView.getTop();
}
}
drawStickyItemView(c);
break;
}
}
if (!mCurrentUIFindStickView) {
mStickyItemViewMarginTop = 0;
if (mLayoutManager.findFirstVisibleItemPosition() + parent.getChildCount() == parent.getAdapter().getItemCount() && mStickyPositionList.size() > 0) {
bindDataForStickyView(mStickyPositionList.get(mStickyPositionList.size() - 1), parent.getMeasuredWidth());
}
drawStickyItemView(c);
}
}
/**
* View
* @param parent
* @return
*/
private View getNextStickyView(RecyclerView parent) {
int num = 0;
View nextStickyView = null;
for (int m = 0, size = parent.getChildCount(); m < size; m++) {
View view = parent.getChildAt(m);
if (mStickyView.isStickyView(view)) {
nextStickyView = view;
num++;
}
if (num == 2) break;
}
return num >= 2 ? nextStickyView : null;
}
/**
* StickyView
* @param position
*/
private void bindDataForStickyView(int position, int width) {
if (mBindDataPosition == position || mViewHolder == null) return;
mBindDataPosition = position;
mAdapter.onBindViewHolder(mViewHolder, mBindDataPosition);
measureLayoutStickyItemView(width);
mStickyItemViewHeight = mViewHolder.itemView.getBottom() - mViewHolder.itemView.getTop();
}
/**
* view position
* @param m
*/
private void cacheStickyViewPosition(int m) {
int position = getStickyViewPositionOfRecyclerView(m);
if (!mStickyPositionList.contains(position)) {
mStickyPositionList.add(position);
}
}
/**
* viewRecyclerView position
* @param m
* @return
*/
private int getStickyViewPositionOfRecyclerView(int m) {
return mLayoutManager.findFirstVisibleItemPosition() + m;
}
/**
* viewHolder
* @param recyclerView
*/
private void getStickyViewHolder(RecyclerView recyclerView) {
if (mAdapter != null) return;
mAdapter = recyclerView.getAdapter();
mViewHolder = mAdapter.onCreateViewHolder(recyclerView, mStickyView.getStickViewType());
mStickyItemView = mViewHolder.itemView;
}
/**
* itemView
* @param parentWidth
*/
private void measureLayoutStickyItemView(int parentWidth) {
if (mStickyItemView == null || !mStickyItemView.isLayoutRequested()) return;
int widthSpec = View.MeasureSpec.makeMeasureSpec(parentWidth, View.MeasureSpec.EXACTLY);
int heightSpec;
ViewGroup.LayoutParams layoutParams = mStickyItemView.getLayoutParams();
if (layoutParams != null && layoutParams.height > 0) {
heightSpec = View.MeasureSpec.makeMeasureSpec(layoutParams.height, View.MeasureSpec.EXACTLY);
} else {
heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
}
mStickyItemView.measure(widthSpec, heightSpec);
mStickyItemView.layout(0, 0, mStickyItemView.getMeasuredWidth(), mStickyItemView.getMeasuredHeight());
}
/**
* itemView
* @param canvas
*/
private void drawStickyItemView(Canvas canvas) {
if (mStickyItemView == null) return;
int saveCount = canvas.save();
canvas.translate(0, -mStickyItemViewMarginTop);
mStickyItemView.draw(canvas);
canvas.restoreToCount(saveCount);
}
}
``` |
The women's lightweight competition in sumo at the 2017 World Games took place on 22 July 2017 at the Orbita Hall in Wrocław, Poland.
Competition format
A total of 15 athletes entered the competition. They fought in the cup system with repechages.
Results
Main draw
Repechages
Semifinals
Finals
References
2017 World Games |
Biconnecta is a genus of flies belonging to the family Lesser Dung flies.
Species
B. mirabilis Papp, 2008
References
Sphaeroceridae
Diptera of Asia
Sphaeroceroidea genera |
Aslim Taslam () is a phrase meaning "submit (to God, i.e., by accepting Islam) and you will get salvation", taken from the letters sent by the Islamic prophet Muhammad to various kings and rulers in which he urged them to convert to Islam.
Letters of Muhammad
Muhammad, according to the usually told Islamic historiography, sent ambassadors with such letters to Heraclius the emperor of Eastern Roman Empire, Chosroes II the emperor of Persia, the Negus of Ethiopia, Muqawqis the ruler of Egypt, Harith Gassani the governor of Syria and Munzir ibn Sawa the ruler of Bahrain.
Muhammad's Letter to the King of Oman, Jaifer, and his Brother Abd Al-Jalandi -
In the Name of Allah, the Most Beneficent, the Most Merciful:
From Muhammad bin ‘Abdullah to Jaifer and ‘Abd Al-Jalandi - Peace be upon him who follows true guidance; thereafter I invite both of you to the Call of Islam. Embrace Islam. Allah has sent me as a Prophet to all His creatures in order that I may instill fear of Allah in the hearts of His disobedient creatures so that there may be left no excuse for those who deny Allah. If you two accept Islam, you will remain in command of your country; but if you refuse my Call, then all your possessions are perishable. My horsemen will appropriate your land, and my Prophethood will assume control over your kingship.
The account as transmitted by Muslim historians of the letter to Heraclius reads as follows
Western Translation
Arabic original
Similar Letters of Leaders from Muslim countries
On September 17, 2006, in response to the Pope Benedict XVI Islam controversy, characterized by Gazan clerics as "the result of his hatred for Islam and not the result of ignorance." one of them, Sheikh Imad Hamato, called on the pope to "repent and ask for forgiveness" and said: "We want to use the words of the Prophet Muhammad and tell the pope: aslim taslam."
In May 2006, Mahmoud Ahmadinejad, President of the Islamic Republic of Iran, sent a similar letter to former US President George W. Bush saying aslim taslam.
Osama bin Laden sent a handful of such letters both to USA and Europe saying aslim taslam
Adam Gadahn, an American-born Muslim convert from Al Qaeda, sent a video to the American people and said aslim taslam.
Egyptian Cleric Hassan Abu Al-Ashbal issued a similar statement aslim taslam to President Barack Obama.
Hizb ut-Tahrir Indonesia spokesperson, Ismail Yusanto said to Nikolas van Dam, the Dutch ambassador for Indonesia that the Dutch government is responsible for the Fitna (film) of Geert Wilders and said aslim taslam.
Critical responses
In response to the aslim taslam invitation to submit to God by Islam, the Italian author and journalist Oriana Fallaci asserted the rejoinder "lan astaslem" () meaning "I will never surrender/I will never submit/I will never be a Muslim".
Michelle Malkin has taken up this slogan as a response to the WTC terrorist attacks
See also
Dawah
WikiBook: Learn Arabic
Dictionary of Modern Written Arabic
Glossary of Islamic terms in Arabic
References
Arabic words and phrases
Islam and other religions
Life of Muhammad
Conversion to Islam
Islamic terminology |
```python
`Dictionary` view objects
The fundamental `tuples`
When `range` comes in handy
`bytearray` objects
`queue`s and threads
``` |
```xml
import { getMetadataArgsStorage } from "../../globals"
import { TableMetadataArgs } from "../../metadata-args/TableMetadataArgs"
import { DiscriminatorValueMetadataArgs } from "../../metadata-args/DiscriminatorValueMetadataArgs"
/**
* Special type of the table used in the single-table inherited tables.
*/
export function ChildEntity(discriminatorValue?: any): ClassDecorator {
return function (target: Function) {
// register a table metadata
getMetadataArgsStorage().tables.push({
target: target,
type: "entity-child",
} as TableMetadataArgs)
// register discriminator value if it was provided
if (typeof discriminatorValue !== "undefined") {
getMetadataArgsStorage().discriminatorValues.push({
target: target,
value: discriminatorValue,
} as DiscriminatorValueMetadataArgs)
}
}
}
``` |
Angenstein Castle ( or simply Angenstein) is a castle in the municipality of Duggingen in the canton of Basel-Land in Switzerland. It is a Swiss heritage site of national significance.
The Jura Railway passes through a tunnel under Angenstein Castle on its route between Basel and Delémont.
A Scoutsgroup and few other organisations and companies are named after the castle.
See also
List of castles in Switzerland
References
External links
Cultural property of national significance in Basel-Landschaft
Castles in Basel-Landschaft |
Caldwell is the given name of:
Caldwell Hart Colt (1858–1894), American inventor and yachtsman and son of Samuel Colt
Caldwell Edwards (1841-1922), U.S. Representative from Montana
Caldwell Esselstyn (born 1933), American cardiologist and former Olympic rowing champion
Caldwell Jones (born 1950), American retired basketball player
Caldwell Stewart (1907-1967), Canadian politician and lawyer
Middle names
M. Caldwell Butler (1925-2014), former U.S. Representative from Virginia
Velma Caldwell Melville (1852-1924), American writer and poet |
Waking the Dead is the fourth studio album by The Clay People, released on May 27, 2007 by Overit Records.
Track listing
Personnel
Adapted from the Waking the Dead liner notes.
Clay People
John Delehanty – vocals, guitar, synthesizer, production, engineering, recording, mixing (4–6, 8–10)
Dan Dinsmore – drums, executive-producer
Brian McGarvey – vocals, production
Daniel Neet – lead vocals, synthesizer, production
Additional performers
Eric Schwanke – bass guitar
Production and design
Andrew Ehrlich – recording assistant, engineering
Neil Kernon – mixing (1–3, 7, 11–15)
Philip Montelone – cover art, design
Release history
References
External links
Waking the Dead at Bandcamp
Waking the Dead at Discogs (list of releases)
2007 albums
The Clay People albums |
American Inquisition is the thirteenth studio album by the band Christian Death. The album was released on Season of Mist on October 15, 2007, worldwide, and on October 23, 2007, in USA and Canada in an exclusive digipak complete with embossing and spot lacquering. The catalogue number is SOM166.
It was previously thought that the next Christian Death album would be called Ten Excuses for Suicide as announced on the official site back in 2003, but this has proved not to be the case.
Track listing
"Water into Wine" – 5:54
"Stop Bleeding on Me" – 4:00
"Narcissus Metamorphosis Of" – 5:38
"Victim X" – 5:50
"To Disappear" – 4:23
"Dexter Said No to Methadone" – 4:18
"Angels and Drugs" – 4:57
"Seduction Thy Destruction" – 5:06
"Worship Along the Nile" – 4:17
"See You in Hell" – 5:08
"Surviving Armageddon" – 5:34
"Last Thing" – 4:44
"XIII" – 9:50
Personnel
Valor Kand - vocals, guitars, acoustic strings, synths, drums, percussion
Maitri - vocals, bass, percussion
Nate Hassan - drums
Tila - acoustic keyboards
Additional musicians
Juan "Punchy" Gonzalez - power guitar on "Stop Bleeding on Me"
Coyote - additional guitar on "Narcissus Metamorphosis Of"
Adeline Bellart - French monologue
References
2007 albums
Christian Death albums
Season of Mist albums |
```c
/*
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <pcap-types.h>
#include <ctype.h>
#include <memory.h>
#include <stdio.h>
#include <string.h>
#include "pcap-int.h"
#include <pcap/namedb.h>
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
#endif
static inline int skip_space(FILE *);
static inline int skip_line(FILE *);
/* Hex digit to integer. */
static inline u_char
xdtoi(u_char c)
{
if (isdigit(c))
return (u_char)(c - '0');
else if (islower(c))
return (u_char)(c - 'a' + 10);
else
return (u_char)(c - 'A' + 10);
}
static inline int
skip_space(FILE *f)
{
int c;
do {
c = getc(f);
} while (isspace(c) && c != '\n');
return c;
}
static inline int
skip_line(FILE *f)
{
int c;
do
c = getc(f);
while (c != '\n' && c != EOF);
return c;
}
struct pcap_etherent *
pcap_next_etherent(FILE *fp)
{
register int c, i;
u_char d;
char *bp;
size_t namesize;
static struct pcap_etherent e;
memset((char *)&e, 0, sizeof(e));
for (;;) {
/* Find addr */
c = skip_space(fp);
if (c == EOF)
return (NULL);
if (c == '\n')
continue;
/* If this is a comment, or first thing on line
cannot be Ethernet address, skip the line. */
if (!isxdigit(c)) {
c = skip_line(fp);
if (c == EOF)
return (NULL);
continue;
}
/* must be the start of an address */
for (i = 0; i < 6; i += 1) {
d = xdtoi((u_char)c);
c = getc(fp);
if (c == EOF)
return (NULL);
if (isxdigit(c)) {
d <<= 4;
d |= xdtoi((u_char)c);
c = getc(fp);
if (c == EOF)
return (NULL);
}
e.addr[i] = d;
if (c != ':')
break;
c = getc(fp);
if (c == EOF)
return (NULL);
}
/* Must be whitespace */
if (!isspace(c)) {
c = skip_line(fp);
if (c == EOF)
return (NULL);
continue;
}
c = skip_space(fp);
if (c == EOF)
return (NULL);
/* hit end of line... */
if (c == '\n')
continue;
if (c == '#') {
c = skip_line(fp);
if (c == EOF)
return (NULL);
continue;
}
/* pick up name */
bp = e.name;
/* Use 'namesize' to prevent buffer overflow. */
namesize = sizeof(e.name) - 1;
do {
*bp++ = (u_char)c;
c = getc(fp);
if (c == EOF)
return (NULL);
} while (!isspace(c) && --namesize != 0);
*bp = '\0';
/* Eat trailing junk */
if (c != '\n')
(void)skip_line(fp);
return &e;
}
}
``` |
A miter gauge is a device used for holding workpieces at a set angle while being cut on table saws, band saws or sanded on stationary disk sanders. The miter gauge slides in a slot on the worktable (known as a miter slot) on the machine being used. Typically, the miter gauge and the workpiece are held together by hand and moved across the worktable making the cut (or sanded edge). There are more sophisticated miter gauges which have the ability to clamp the workpiece or have adjustable stops for repetitive machining of workpieces.
References
Saws |
David H. Goodman is an American television writer and producer.
He is known for his work on the CBS drama Without a Trace and the FOX science fiction series Fringe. He currently serves as writer and executive producer on the ABC fantasy series Once Upon a Time.
Career
In 1997, Goodman became a script coordinator for the Sci-Fi television series The Visitor. The series was cancelled after its first season and Goodman became script coordinator for the supernatural drama series Buffy the Vampire Slayer. He joined the crew of Buffy mid-way through the second season in 1998. Goodman left the show with the close of the sixth season in 2002.
While working on Buffy, his writing debut was for Bruce Campbell vehicle Jack of All Trades with the second season episode "Croquey in the Pokey" in 2001. He wrote two episodes for the third season of Angel - "Dad" in 2001 and "Double or Nothing" in 2002.
In 2002, he became a story editor and writer for action series Fastlane, scripting the first season episode "Dosed". He also wrote for the Batman spin-off Birds of Prey and contributed two episodes, "Three Birds and a Baby" in 2002 and "Gladiatrix" in 2003.
In 2003, he became involved with Without a Trace as a story editor for the second season. He wrote the second season episodes "Moving On" (2003) and "Risen" (2004). He became an executive story editor for the third season and contributed two more episodes "Trials" (2004) and "Transitions" (2005). He joined the production team for the fourth season, initially as a co-producer. He wrote the episodes "Lost Time" and "Odds or Evens". He was promoted to producer mid-season and wrote a third episode, "Shattered". He became a supervising producer for the fifth season and wrote the episodes "Win Today" (2006), "Eating Away" (2007), "Connections" (2007) and the season finale "The Beginning" (2007). He became a co-executive producer for the sixth season and wrote the episodes "Fight/Flight" (2007) and "A Dollar and a Dream" (2008). He left the show in Spring 2008 having written thirteen episodes in total.
Goodman is a 1995 graduate of Wesleyan University.
Fringe
In 2008, he joined the crew on the first season of the FOX science fiction thriller Fringe, as a writer and co-executive producer. After completing the season, Goodman left the series. He, along with the rest of the writing staff, was nominated for the Writers Guild of America Award for Best New Series at the February 2009 ceremony for his work on the first season. Episodes Goodman co-wrote include:
"The Ghost Network" (1.03) (co-written by supervising producer J.R. Orci)
"The Equation" (1.08) (co-written by Orci)
"Safe" (1.08) (co-written by consulting producer Jason Cahill)
"The No-Brainer" (1.12) (co-written by co-producer Brad Caleb Kane)
"Ability" (1.14) (Goodman wrote a teleplay, based on a story by executive story editors Robert Chiappetta and Glen Whitman)
"Unearthed" (2.11) (co-written by co-executive producer Andrew Kreisberg)
Once Upon a Time
In Summer 2011, Goodman was brought on to the ABC fantasy drama Once Upon a Time, as a writer and co-executive producer. Episodes Goodman has contributed to include:
"The Price of Gold" 1.04
"True North" 01.09 (co-written with Liz Tigelaar)
"What Happened to Frederick" 1.13
"Hat Trick" 1.17 (co-written with Vladimir Cvetko)
"An Apple Red as Blood" 1.21 (co-written with Jane Espenson)
"The Crocodile" 2.04 (co-written with Robert Hull)
"The Cricket Game" 2.10 (co-written with Robert Hull)
"The Queen is Dead" 2.15 (co-written with Daniel T. Thomsen)
"Nasty Habits" 3.04 (co-written with Robert Hull)
"Think Lovely Thoughts" 3.08 (co-written with Robert Hull)
"The Jolly Roger" 3.17
"Snow Drifts" 3.21 (co-written with Robert Hull)
"Rocky Road" 4.03 (co-written with Jerome Schwartz)
"Smash the Mirror" 4.08 (co-written with Jerome Schwartz)
"Enter the Dragon" 4.14 (co-written with Jerome Schwartz)
"Sympathy for the De Vil" 4.18 (co-written with Jerome Schwartz)
"The Broken Kingdom" 5.04 (co-written with Jerome Schwartz)
"Birth" 5.08 (co-written with Jerome Schwartz)
"The Brothers Jones" 5.15 (co-written with Jerome Schwartz)
"Sisters" 5.19 (co-written with Brigitte Hales)
"Only You" 5.22 (co-written with Andrew Chambliss)
"Strange Case" 6.04 (co-written with Nelson Soler)
"Changelings" 6.09 (co-written with Brian Ridings)
"Page 23" 6.14 (co-written with Brigitte Hales)
"Where Bluebirds Fly" 6.18 (co-written with Brigitte Hales)
"The Song in Your Heart" 6.20 (co-written with Andrew Chambliss)
"The Garden of Forking Paths" 7.03 (co-written with Brigitte Hales)
References
External links
American television producers
American television writers
American male television writers
Living people
Wesleyan University alumni
Place of birth missing (living people)
Year of birth missing (living people) |
A garden railway or garden railroad is a model railway system set up outdoors in a garden. While G is the most popular scale for garden railroads, 16 mm scale has a dedicated and growing following especially in the UK. Model locomotives in this scale are often live steam scale models of British narrow gauge prototypes. 16 mm scale (which runs on ) track, the same gauge as O gauge is probably now more popular in the UK than G scale.
A garden railway's scale tends to be in the range of 1/32 (Gauge 1) to 1/12 (1:12), running on either or gauge track. 1/32 scale (1:32) is also called "three-eighths scale" meaning 3/8 of an inch on the model represents one foot on the real thing. For similar reasons, 1/24 scale (1:24) is also called "half-inch scale". Other popular scales are 1:29, 1:20.3 (representing gauge prototypes on track, 16 mm (1:19). They are smaller than the Backyard railroad, or what is commonly called a miniature railway, and would not provide a ride-on facility, being intended instead as a display railway. Smaller scales and gauges are used in the garden, but in general garden railway is used to refer to the medium scale sizes which would be impractical to use indoors.
Function
At its most basic level, a garden railway works just like an indoor railway, including turnouts and turntables. However, special considerations must be taken for everything from sunlight, wind and rain, to dirt and leaves, and even wildlife. The distance covered also means that electrical resistance in and between sections is much higher, and electrical power will tend to drop off at the far end.
To eliminate this power issue, some are rigged to use RC car parts such as rechargeable batteries. Others even use live steam and run as a real steam locomotive would. The steam can be generated from a variety of sources, ranging from messy solid pellet (i.e. methenamine) or sterno-type fuel, through clean-burning butane gas, to prototypical coal burners. Live steam is particularly widespread amongst 16 mm scale garden railway enthusiasts.
Many trains also have digital audio on board, so they sound like a real train. They can also use Digital Command Control or other similar systems, though dirty outdoor track can cause less of a problem with signal than with simple DC power. This is because DCC puts the full voltage on the rails at all times. There are many benefits of DCC when compared to DC analog systems.
Design
Plants are usually an integral part of a garden railway, and dwarf varieties along with pruning are often used to keep them in proper proportion. Some go so far as to use bonsai techniques, though this can be very time-consuming for large areas.
Buildings are also often used in a garden railway, though they too must be constructed to withstand the weather. Train stations and freight depots are popular, some even building whole towns trackside. The loco shed is a common place to store a locomotive (or the whole train) when not in use.
Other geographic features are used, such as a small pond to represent a lake, rocks for boulders, or tunnels through "mountains" or under stairways. Tunnels can be a particular challenge, because everything from cats to raccoons and more like to hide in them, particularly to get out of the rain or heat, sometimes even to sleep, nest, or hibernate. A derailment inside a tunnel can also be permanent if careful planning is not done to ensure that it can be reached by access panels (trapdoors) or at arm's length from either end.
A frequent theme is the railway in an idealised urban or rural environment, so it is often found in the context of a model village. Some garden railways work opposite to the model village style and opt more for a railway in the garden, where the railways runs amongst normal plants, not in scale with the railway. These sort of railway designs allow for large scale planting and many gardeners have the railway as a secondary hobby to gardening.
Display
Numerous garden rail societies have been formed around the world. Members often invite others over for social gatherings, as well as rotating club meetings around each month. A large setup was on public display at the Atlanta Botanical Garden during the summer and early fall of 2005, including replicas of downtown Atlanta skyscrapers made from wood, bark, and other natural materials.
In Milwaukee, Wisconsin, the Mitchell Park Horticultural Conservatory features an extensive Garden Railway display put on with the cooperation of many Wisconsin Model Railroad club members. The "Domes" as they are known locally, schedules the indoor Garden Railway Show during the cold winter months. It has become one of the most popular displays each year and one of the largest temporary Garden Railway displays in the Midwest.
A notable example in England is Bekonscot which is the oldest model village in the world and has an extensive railway running through a mythical 1930s England. This is well known to be one of the largest, and oldest, garden railways in the UK open to the public.
Many owners name their railways, similar to real railroad lines; some with natural-sounding names, others with playful or fanciful names.
Technical
Scales
For historical reasons, the situation is complex.
'G' track width is . If used to represent track, this corresponds to a scale of 1:32. This gauge, but not the scale, is derived from the standard gauge 'Gauge 1' in UK (originally using a scale of 10mm to 1 foot).
The same gauge of , if used to represent a track, a commonly used Narrow Gauge
in many countries i.e. Australia, Africa, corresponds to a scale of 1:24.
The same gauge of , if used to represent a track, corresponds to a scale of 1:22.5 (IIm).
The same gauge of , if used to represent a track, corresponds to a scale of 1:20.3 .
The same gauge of , if used to represent a track, corresponds to a scale of 1:13.5 SE scale, near 1:12 or 1 inch to the foot. This larger scale is increasing in popularity.
A track gauge of , if used to represent a track of , or just under, corresponds to a scale of 1:19. Sometimes, the 1:19 rolling stock, and particularly live steam locomotives, is equipped for a track of ('G' track). This scale is also called 16 mm in UK, where it is mainly found, because it represents 16 mm for 1 ft.
The same gauge of , if used to represent a track, corresponds to a scale of 1:13.5, and this larger scale is increasing in popularity.
The same gauge of , if used to represent a track, corresponds to a scale of 1:12. This combination is not common but has a small number of dedicated followers.
A US manufacturer (Aristocraft) decided to create a new scale of 1:29 for standard gauge trains on 45 mm track; filling the need for mass-produced American prototypes in a market otherwise dominated by European outline trains. At the time (1988), 45mm track was the most common track worldwide. The choice of 1:29 was an attempt to create cars and engines that would compare favorably in size with existing LGB rolling stock which dominated the hobby, and to increase the "wow" factor by making the trains 30% larger by volume than standard 1:32 scale trains. In addition 1:29 is exactly three times the size of HO scale making it easier to enlarge existing scale model drawings for consumer construction of accessories and scratch-built engines and rolling stock. Since this original venture, at least two other major companies have joined in the 1:29th market (USA Trains and AML/American Mainline) as well as some other smaller companies creating a wide range of rolling stock and locomotives. Early releases in this scale were more toy like, complete with brass railings and other decorations. Since that time there has been a steady move toward more and more realism with recent releases in live steam radio controlled engines. 1:29 is predominantly American mainline although some locomotives and rolling stock are made for the European market.
If one will represent a modern epoch, there is need for road cars and trucks which are only offered in 1:18, 1:24 and 1:32 scale. Modellers are making compromises and 1:22.5 trains are commonly associated with 1:24 accessories (figures, animals, cars, etc.)
There is a conflict on the designation of 'G' scale (created by LGB), the NMRA was initially willing to use it only for scale 1:22.5 but manufacturers hoping to benefit from the notoriety of the 'G' naming continue using this reference for scales 1:20.3, 1:24, 1:29, and 1:32. All these scales would more correctly fall under the name of G gauge, referencing the width of the track, rather than G scale, as there are so many scales now claiming to be G. A recent move has been made to separate all the G gauge scales, the primary one being the use of F scale for 1:20.3.
In short:
(width while on scale -> width effectively used)
Scale 1:22.5 is mainly used for narrow gauge equipment and propose a large choice of trains, buildings and accessories (American or European) and allow low radiuses curves, locomotives and cars being shorts.
Scale G64 (), which is the proper width for standard gauge trains at scale 1:22.5 began to develop in UK, but only with UK trains. Large radiuses are required due to the length of cars.
American or European quality equipment can be found at scale 1:32, at a cost.
There exists a few garden trains at a smaller scale but maintenance is more difficult.
And the scale '0' with standard gauge run on a track of and is actually at scale of 1:43.5 in France & UK, 1:45 in Germany and 1:48 in the USA...
Common radio control methods
Common switches and accessories control methods
See also
Rail transport modelling scales
Backyard railroad — outdoor railways that are large enough to ride on and often cover many acres.
Ridable miniature railways
Children's railway
Gauge 1
G scale
16 mm scale model trains
SE scale
Bekonscot Model Village
Railway of the Prince Imperial
References
External links
Family Garden Trains' Free Articles for Beginners
Large Scale Central
Garden Railways Magazine
GIRR Many tips about garden railways construction
Greg Elmassian Likewise many tips as above
DCC outdoors DCCWiki article on Garden Railroads with links to using DCC in the garden.
Roundhouse Engineering Co Ltd Manufacturer of live steam locomotives for Garden Railways
Garden railroads
Elmtree Line Garden Railway
The Train Garden - English version of Gartenzug
Andy's Garden Railway
Guildford Model Engineering Society 16mm Track
Miniature railways
Railway |
Gridiron Secret Society is a collegiate secret society at the University of Georgia. Gridiron has been called "the highest honor a male student may receive on the University of Georgia campus.". It has also been recognized as one of the "Top 10 Secret Member's Clubs" in the world.
History
The Gridiron Secret Society was founded in 1908 at the University of Georgia. The organization is thought to have connections with certain structures and historic sites around the State of Georgia and the rest of the Southern United States (Warm Springs, Georgia Guidestones, Georgia Capitol building), but its members do not publish any information.
The organization is believed to be associated with other secret organizations, which operate around the world under different names including Yale University's Skull and Bones. Observers have noted that University of Georgia's first president Abraham Baldwin was a Yale graduate and likely a member of Skull and Bones.
Symbols and traditions
The society's name is believed to be about the playing field on which football is played, however "qualifications for membership and activities are known only to members."
Activities
The organization has extensive alumni participation, with well-attended banquets held in Athens twice each year, but its purposes and activities remain a closely guarded secret.
Membership
Gridiron is believed to draw most of its membership from students, faculty, and alumni of the university. Several members have no known association with the university, however. Student members are drawn from various disciplines university-wide including the law school, Ag Hill, the Greek system, and UGA athletics. Honorary members are usually prominent leaders in government, law, medicine, or business, mostly from and associated with the State of Georgia.
Membership
Known members include every governor and United States senator from Georgia since the 1930s, including Jimmy Carter, Richard B. Russell Jr., Herman Talmadge, Zell Miller, Ellis Arnall, Ernest Vandiver, Carl Sanders, Joe Frank Harris, George Busbee, Roy Barnes, Sonny Perdue, Sam Nunn, Mack Mattingly, Max Cleland, Johnny Isakson, Saxby Chambliss, and Brian Kemp, as well numerous other political, civic and business leaders. Current members serving under the Gold Dome include House Speaker David Ralston, Senate President Pro Tempore Butch Miller, and Chairman of the Georgia Democratic Party Dubose Porter, and former Atlanta Mayor Kasim Reed.
University of Georgia head football coach Kirby Smart is a member as was former football coach Vince Dooley. Other noteworthy members include Atlanta Olympics organizer Billy Payne, former U.S. Ambassador David I. Adelman, Olympic Swim Coach Jack Bauerle, John Flythe, athletic booster Sonny Seiler, Charles S. Sanford Jr., humorist Lewis Grizzard, sportscaster Skip Caray, film and television producer Patrick N. Millsaps, professional golfers Hudson Swafford, Keith Mitchell, and Kevin Kisner, and football greats Stetson Bennett, Herschel Walker, two-time Super Bowl champion David Andrews, David Greene, Jon Stinchcomb, Matt Stinchcomb, Aaron Murray, and Fran Tarkenton. [Max Richardson]
Other identified members include Atlanta Mayor William B. Hartsfield, Dean Rusk,Duncan Johnson Jr, U.S. Representative Jack Kingston, John Barrow, Griffin Bell, Pat Swindall, Richard Russell Jr., Lewis Massey, Pete Theodocion, Thurbert Baker, Bernard Ramsey, Harold G. Clarke, Frank Sinkwich, Dan Amos, H. E. Nichols.
References
University of Georgia
1908 establishments in Georgia (U.S. state)
Collegiate secret societies
Secret societies in the United States |
ROH Supercard of Honor is a pay-per-view professional wrestling event annually presented by the U.S. based promotion Ring of Honor (ROH), and primarily takes place during the weekend of WrestleMania - the flagship event of WWE and considered to be the biggest wrestling event of the year.
Supercard of Honor has been a yearly tradition since 2006. The shows are sometimes two-day events, traditionally taking place on Friday nights and/or Saturday afternoons, and are held either in or nearby the same city as that year's WrestleMania. The only deviations so far have been the 2010 and 2011 Supercards, which were held about a month after WrestleMania weekend. The 2019 event used the modified "G1 Supercard" name as it was co-produced with New Japan Pro-Wrestling.
After annually running from 2006 to 2019 (with the exception of 2012), the event took a two-year hiatus, as Supercard of Honor XIV had been scheduled to take place on April 4, 2020, with some matches having already been announced, but was cancelled due to the COVID-19 pandemic, and no Supercard of Honor event took place in 2021 because of the lingering pandemic. The event returned in 2022 with Supercard of Honor XV.
Dates and venues
See also
ROH annual events
References
External links
Ring of Honor's official website |
"Accidentally on Purpose" is a ballad by George Jones. It was composed by Jones and Darrell Edwards and released it as the B-side to "Sparkling Brown Eyes" on Mercury Records in 1960. In the song, the narrator accuses a former lover of marrying another man just to spite him. The song made the top 20, peaking at No. 16 on the Billboard country singles chart. Johnny Cash recorded the song in 1962 for his LP The Sound of Johnny Cash.
Chart performance
References
George Jones songs
1960 singles
1960 songs
Songs written by George Jones
Mercury Records singles
Song recordings produced by Pappy Daily |
William Ofori Atta (10 October 1910 – 14 July 1988), popularly called "Paa Willie", was a founding member of the United Gold Coast Convention (UGCC) and one of the founding fathers of Ghana as one of "The Big Six" detained by the British colonial government in the then Gold Coast. He later became a Minister for Foreign Affairs in Ghana's second republic between 1971 and 1972.
Early life
Nana William Ofori Atta was the son of Nana Sir Ofori Atta I who was the Omanhene (King) of Akyem Abuakwa between 1912 and 1943. He was thus a nobleman of royal lineage of the Ofori-Atta dynasty, although the fact that the Akan people (to which he belonged) are traditionally matrilineal meant that he was not a dynastic prince. William Ofori Atta attended Mfantsipim School, but was withdrawn to Achimota School where he was among the first batch of students to sit for the Cambridge School Certificate. Some of his school mates included Komla Agbeli Gbedemah and Edward Akufo-Addo. His batch of students also pioneered the intermediate degree programs. He was also the first ever school prefect of the School. This arrangements went on to form the nucleus of the University of Ghana. He attended Queens' College, University of Cambridge from 1935 to 1938. He became a lawyer in 1956. His sister was Susan Ofori-Atta, the first Ghanaian woman to become a physician.
Politics
William Ofori Atta was a founding member of the United Gold Coast Convention after joining in 1947. He won one of the Akim Abuakwa seats during the 1951 Gold Coast election. He later became the leader of the United Party in opposition to Dr Kwame Nkrumah. Ofori Atta was detained by Nkrumah during the first republic under the Preventive Detention Act. During the second republic, he represented the people of Akwatia as a member of the 1st Parliament of the Second Republic, he was also the Minister for Education and then Minister for Foreign Affairs in the Progress Party government of Dr. Busia.
He was an active member of the People's Movement for Freedom and Justice (PMFJ) which campaigned against the 'Union Government' concept by General I. K. Acheampong, then Head of state of Ghana and Chairman of the Supreme Military Council (SMC). This was an attempt by the military regime to extend military rule instead of handing back power to civilians. After the fall of the SMC, he stood for president in the 1979 Ghanaian presidential election on the ticket of the United National Convention coming third with 17.41% of the popular vote. Eventually, he became chairman of the Council of State for the Third Republic.
Later life
William Ofori Atta became a devout Christian and played various roles in Christian circles. He was one of the founders of the Accra Chapel Trust, (now the Korle-Bu Community Chapel) an independent evangelical church at the Korle Bu Teaching Hospital in Accra in 1967.
Ofori Atta delivered the J. B. Danquah Memorial Lectures organised by the Ghana Academy of Arts and Sciences in 1985. His topic was – "Ghana, A Nation in Crisis". He died in 1988 and was given a state burial.
William Ofori-Atta Memorial Lectures
The William Ofori-Atta Memorial Lectures were instituted in his memory after his death.
Literature
Sawyer, Harry, William Ofori Atta, Harry Sawyer, 1979
Ghana, a Nation in Crisis
The vision of an independent State of Ghana
See also
The Big Six
Minister for Foreign Affairs (Ghana)
United Gold Coast Convention
Notes
Publications
1910 births
1988 deaths
Ghanaian MPs 1951–1954
Akan people
Alumni of Queens' College, Cambridge
Alumni of the University of Cambridge
20th-century Ghanaian lawyers
Ghanaian MPs 1969–1972
Ghanaian Presbyterians
Alumni of Achimota School
Mfantsipim School alumni
Culture ministers of Ghana
Education ministers of Ghana
Foreign ministers of Ghana
Sports ministers of Ghana
United Party (Ghana) politicians
Progress Party (Ghana) politicians
United National Convention politicians
United Gold Coast Convention politicians
Candidates for President of Ghana
William
University of Ghana alumni
Ghanaian independence activists |
Philippe Saive is a male former international table tennis player from Belgium.
Table tennis career
He won a silver medal at the 2001 World Table Tennis Championships in the Swaythling Cup (men's team event) with Martin Bratanov, Marc Closset, Andras Podpinka, and Jean-Michel Saive (his brother) for Belgium.
He competed in three Olympic Games in 1992, 1996, and 2000.
Personal life
He is the younger brother of retired professional table tennis player Jean-Michel Saive.
See also
List of table tennis players
List of World Table Tennis Championships medalists
References
1971 births
Living people
Belgian male table tennis players
Olympic table tennis players for Belgium
Table tennis players at the 1992 Summer Olympics
Table tennis players at the 1996 Summer Olympics
Table tennis players at the 2000 Summer Olympics
Sportspeople from Liège
World Table Tennis Championships medalists |
```go
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package bcc
import (
"fmt"
"regexp"
"sync"
"unsafe"
)
/*
#cgo CFLAGS: -I/usr/include/bcc/compat
#cgo LDFLAGS: -lbcc
#include <bcc/bcc_common.h>
#include <bcc/libbpf.h>
#include <bcc/bcc_syms.h>
extern void foreach_symbol_callback(char*, uint64_t);
*/
import "C"
type symbolAddress struct {
name string
addr uint64
}
//symbolCache will cache module lookups
var symbolCache = struct {
cache map[string][]*symbolAddress
currentModule string
lock *sync.Mutex
}{
cache: map[string][]*symbolAddress{},
currentModule: "",
lock: &sync.Mutex{},
}
type bccSymbol struct {
name *C.char
demangleName *C.char
module *C.char
offset C.ulonglong
}
type bccSymbolOption struct {
useDebugFile int
checkDebugFileCrc int
useSymbolType uint32
}
// resolveSymbolPath returns the file and offset to locate symname in module
func resolveSymbolPath(module string, symname string, addr uint64, pid int) (string, uint64, error) {
if pid == -1 {
pid = 0
}
modname, offset, err := bccResolveSymname(module, symname, addr, pid)
if err != nil {
return "", 0, fmt.Errorf("unable to locate symbol %s in module %s: %v", symname, module, err)
}
return modname, offset, nil
}
func bccResolveSymname(module string, symname string, addr uint64, pid int) (string, uint64, error) {
symbol := &bccSymbol{}
symbolC := (*C.struct_bcc_symbol)(unsafe.Pointer(symbol))
moduleCS := C.CString(module)
defer C.free(unsafe.Pointer(moduleCS))
symnameCS := C.CString(symname)
defer C.free(unsafe.Pointer(symnameCS))
res, err := C.bcc_resolve_symname(moduleCS, symnameCS, (C.uint64_t)(addr), C.int(pid), nil, symbolC)
if res < 0 {
return "", 0, fmt.Errorf("unable to locate symbol %s in module %s: %v", symname, module, err)
}
return C.GoString(symbolC.module), (uint64)(symbolC.offset), nil
}
func bccResolveName(module, symname string, pid int) (uint64, error) {
symbol := &bccSymbolOption{}
symbolC := (*C.struct_bcc_symbol_option)(unsafe.Pointer(symbol))
pidC := C.int(pid)
cache := C.bcc_symcache_new(pidC, symbolC)
defer C.bcc_free_symcache(cache, pidC)
moduleCS := C.CString(module)
defer C.free(unsafe.Pointer(moduleCS))
nameCS := C.CString(symname)
defer C.free(unsafe.Pointer(nameCS))
var addr uint64
addrC := C.uint64_t(addr)
res := C.bcc_symcache_resolve_name(cache, moduleCS, nameCS, &addrC)
if res < 0 {
return 0, fmt.Errorf("unable to locate symbol %s in module %s", symname, module)
}
return addr, nil
}
// getUserSymbolsAndAddresses finds a list of symbols associated with a module,
// along with their addresses. The results are cached in the symbolCache and
// returned
func getUserSymbolsAndAddresses(module string) ([]*symbolAddress, error) {
symbolCache.lock.Lock()
defer symbolCache.lock.Unlock()
// return previously cached list if it exists
if _, ok := symbolCache.cache[module]; ok {
return symbolCache.cache[module], nil
}
symbolCache.cache[module] = []*symbolAddress{}
symbolCache.currentModule = module
if err := bccForeachSymbol(module); err != nil {
return nil, err
}
return symbolCache.cache[module], nil
}
func matchUserSymbols(module, match string) ([]*symbolAddress, error) {
r, err := regexp.Compile(match)
if err != nil {
return nil, fmt.Errorf("invalid regex %s : %s", match, err)
}
matchedSymbols := []*symbolAddress{}
symbols, err := getUserSymbolsAndAddresses(module)
if err != nil {
return nil, err
}
for _, sym := range symbols {
if r.MatchString(sym.name) {
matchedSymbols = append(matchedSymbols, sym)
}
}
return matchedSymbols, nil
}
// foreach_symbol_callback is a gateway function that will be exported to C
// so that it can be referenced as a function pointer
//export foreach_symbol_callback
func foreach_symbol_callback(symname *C.char, addr C.uint64_t) {
symbolCache.cache[symbolCache.currentModule] =
append(symbolCache.cache[symbolCache.currentModule], &symbolAddress{C.GoString(symname), (uint64)(addr)})
}
func bccForeachSymbol(module string) error {
moduleCS := C.CString(module)
defer C.free(unsafe.Pointer(moduleCS))
res := C.bcc_foreach_function_symbol(moduleCS, (C.SYM_CB)(unsafe.Pointer(C.foreach_symbol_callback)))
if res < 0 {
return fmt.Errorf("unable to list symbols for %s", module)
}
return nil
}
``` |
Çiftlikköy (also: Çiftlik) is a village in the Dazkırı District, Afyonkarahisar Province, Turkey. Its population is 229 (2021).
References
Villages in Dazkırı District |
This is a list of all tornadoes that were confirmed by local offices of the National Weather Service in the United States in October 2010.
United States yearly total
October
Note: 3 tornadoes were confirmed in the final totals, but do not have a listed rating.
October 6 event
October 7 event
October 18 event
October 21 event
October 23 event
October 24 event
October 25 event
October 26 event
October 27 event
October 28 event
See also
Tornadoes of 2010
References
10
2010, 10
Tornadoes |
```c++
//
// file LICENSE_1_0.txt or copy at path_to_url
#include <iostream>
#include <boost/pfr/traits.hpp>
#include <type_traits> // for std::true_type, std::false_type and std::is_aggregate
namespace boost { namespace pfr {
struct boost_fusion_tag;
struct boost_json_tag;
}}
struct Aggregate {};
using Nonaggregate = int;
#if defined(__cpp_lib_is_aggregate)
static_assert(std::is_aggregate<Aggregate>::value && !std::is_aggregate<Nonaggregate>::value, "");
#endif
using Reflectable = short;
struct Nonrefrectable {};
using ReflectableBoostFusion = short;
struct NonrefrectableBoostFusion {};
using ReflectableBoostJson = short;
struct NonrefrectableBoostJson {};
namespace boost { namespace pfr {
template<class All> struct is_reflectable<Reflectable, All> : std::true_type {};
template<class All> struct is_reflectable<Nonrefrectable, All> : std::false_type {};
template<> struct is_reflectable<ReflectableBoostFusion, boost_fusion_tag> : std::true_type {};
template<> struct is_reflectable<NonrefrectableBoostFusion, boost_fusion_tag> : std::false_type {};
template<> struct is_reflectable<ReflectableBoostJson, boost_json_tag> : std::true_type {};
template<> struct is_reflectable<NonrefrectableBoostJson, boost_json_tag> : std::false_type {};
}}
#if BOOST_PFR_ENABLE_IMPLICIT_REFLECTION
template<class T, class Tag>
void assert_reflectable() {
static_assert(boost::pfr::is_implicitly_reflectable_v<T, Tag>, "");
static_assert(boost::pfr::is_implicitly_reflectable_v<const T, Tag>, "");
static_assert(boost::pfr::is_implicitly_reflectable_v<volatile T, Tag>, "");
static_assert(boost::pfr::is_implicitly_reflectable_v<const volatile T, Tag>, "");
}
template<class T, class Tag>
void assert_non_reflectable() {
static_assert(!boost::pfr::is_implicitly_reflectable_v<T, Tag>, "");
static_assert(!boost::pfr::is_implicitly_reflectable_v<const T, Tag>, "");
static_assert(!boost::pfr::is_implicitly_reflectable_v<volatile T, Tag>, "");
static_assert(!boost::pfr::is_implicitly_reflectable_v<const volatile T, Tag>, "");
}
#endif // #if BOOST_PFR_ENABLE_IMPLICIT_REFLECTION
int main() {
#if BOOST_PFR_ENABLE_IMPLICIT_REFLECTION
std::cout << "Implicit reflection is available in this platform.." << std::endl;
{
using tag = boost::pfr::boost_json_tag;
assert_reflectable<Aggregate, tag>();
assert_non_reflectable<Nonaggregate, tag>();
assert_reflectable<Reflectable, tag>();
assert_non_reflectable<Nonrefrectable, tag>();
assert_reflectable<ReflectableBoostJson, tag>();
assert_non_reflectable<NonrefrectableBoostJson, tag>();
}
{
using tag = boost::pfr::boost_fusion_tag;
assert_reflectable<Aggregate, tag>();
assert_non_reflectable<Nonaggregate, tag>();
assert_reflectable<Reflectable, tag>();
assert_non_reflectable<Nonrefrectable, tag>();
assert_reflectable<ReflectableBoostFusion, tag>();
assert_non_reflectable<NonrefrectableBoostFusion, tag>();
}
#endif // #if BOOST_PFR_ENABLE_IMPLICIT_REFLECTION
}
``` |
This is a list of seasons played by Hereford United in English football from their formation in 1924 until their liquidation in 2014.
Seasons
(* ) combined stats from the Keys Cup (finished 9th) and the League Cup (finished 5th).
3 points deducted from season 2010–11; season 2014–15 records and statistics expunged on 5 January 2015
Key
Pos = Final position
P = Played
W = Games won
D = Games drawn
L = Games lost
F = Goals for
A = Goals against
Pts = Points
Second = Football League Second Division
Third = Football League Third Division
FL1 = Football League One
Fourth = Football League Fourth Division
Div 3 = Football League Division Three
FL2 = Football League Two
Conf = Conference National
SFL-P = Southern League Premier Division
SFL-1 = Southern League Division One
SFL-R = Southern League Regional North-West
SFL = Southern League
BHML = Birmingham & District League
BHMC = Birmingham Combination
EX = Extra preliminary round
PR = preliminary round
1Q = First qualifying round
2Q = Second qualifying round
3Q = Third qualifying round
4Q = Fourth qualifying round
R1 = First round
R2 = Second round
R3 = Third round
R4 = Fourth round
R5 = Fifth round
QF = Quarter-finals
SF = Semi-finals
AF = Area final
F = Final
Hereford United
Seasons
Herefordshire F.C. |
Constance Keene (9 February 192124 December 2005) was an American pianist, who was renowned for her 1964 recording of Sergei Rachmaninoff's Preludes and won critical acclaim for her recordings of the works of Johann Nepomuk Hummel, Carl Maria von Weber and Felix Mendelssohn, as well as Rachmaninoff's Études-Tableaux, Op. 33 and Études-Tableaux, Op. 39.
She was raised in Brooklyn, New York City. One of her teachers was Abram Chasins. She won the Naumburg Piano Competition in 1943. In 1946, she stood in for Vladimir Horowitz when he was unavailable for a concert, and she asserted that she was the only female pianist ever to have been given this honor. She also appeared with Benny Goodman and his orchestra in a performance of Gershwin's Rhapsody in Blue. In 1949 she married Chasins, who died in 1987. They performed and recorded music for piano duo.
Through her husband, who had himself studied with pianist Josef Hofmann, she met other concert pianists, including Vladimir Horowitz. She and Chasins regularly socialized and played bridge with Horowitz and his wife Wanda Toscanini Horowitz during Horowitz's 12-year retirement from the concert stage. As a teen she met Hofmann, Godowsky, and Rachmaninoff; as an adult she and Chasins helped Van Cliburn before his rise to fame. She was close to William Kapell, Abbey Simon, and other pianists. Later in life she often hosted rising young pianists such as Evgeny Kissin and Lang Lang at her Upper West Side home.
She later became an accomplished teacher herself. Her pupils included the children of Arthur Rubinstein, who said of her performances of Rachmaninoff's Preludes that he was "flabbergasted by the colour, sweep and imagination and ... incredible technique. I cannot imagine anybody, including Rachmaninoff, playing the piano so beautifully".
Pianist Peter Nero was one of Constance's pupils as a young man. Despite being a prodigy and winning piano contests in the New York City area, when he started studying with her, Mr. Nero claimed, "She changed my whole life" in regards to piano technique. "I owe it all to Constance", he claimed in later life.
For many years, she was on the faculty of the Manhattan School of Music, served as the chair of the Piano Department, and was a member of its board of trustees. She was also sought out as a piano competition adjudicator.
Notes
External links
Constance Keene at World Concert Artist Directory
John Bell Young. Legendary generosity. Remembering Constance Keene
1921 births
2005 deaths
American classical pianists
American women classical pianists
Classical piano duos
Musicians from Brooklyn
Manhattan School of Music faculty
Piano pedagogues
20th-century classical pianists
20th-century American pianists
20th-century American women pianists
Classical musicians from New York (state)
American music educators
American women music educators
American women academics
21st-century American women
Jewish classical pianists |
The Netezi is a right tributary of the river Topolița in Romania. It flows into the Topolița near Grumăzești. Its length is and its basin size is .
References
Rivers of Romania
Rivers of Neamț County |
Isabel Selena Godoy Monárdez (born 1967) is a Qulla activist and politician in Chile. A former political prisoner during the Chilean military dictatorship, Godoy was elected in 2021 to represent the Qulla people at the Constitutional Convention.
Godoy is considered an ally of 2021 Chilean presidential candidate Daniel Jadue of the Communist Party.
Biography
Godoy was born in 1967 to a Qulla family. At the age of 17, Godoy was assaulted by a police officer while protesting the Augusto Pinochet dictatorship and was put in prison for her social activism. Godoy is an accountant by profession and is currently studying to receive a degree in social work.
Godoy has served as a member of the National Council of the Qulla People. Additionally, Godoy has served as president of the Kolla Flora indigenous community.
Constitutional Convention
In the 2021 Constitutional Convention election, Godoy ran to represent a reserved seat for the Qulla people in the Atacama Region. She was elected after receiving 631 votes (29.53%) out of 2,137 votes cast. During her campaign, Godoy indicated she supported the establishment of a plurinational state in Chile inclusive of indigenous nations, and stated that the new constitution should safeguard the legal right to water.
Following her election to the body, Godoy chose to run for President of the Constitutional Convention. In the first round of the election, Godoy received 35 votes, but in the second round lost to Mapuche activist Elisa Loncón, who won with 96 votes in her favor. Godoy has stated that she believes Mapuche leaders consider members of other native nations such as the Qulla, who are smaller in population, as "little brothers" whose autonomy isn't respected.
Godoy is a staunch critic of conservative President of Chile Sebastián Piñera and has called for his resignation, arguing that he has hindered the work of the Constitutional Convention to the point where "we have no choice but to request the resignation of the President".
Political views
Godoy has praised the plurinational model of Bolivia and has called for a similar system to be implemented in Chile to safeguard the rights of indigenous peoples. Godoy has called for an end to what she considers the "militarization" of indigenous areas in Chile.
References
Chilean socialists
Members of the Chilean Constitutional Convention
People from Atacama Region
1967 births
Living people |
In 2014, an outbreak of Ebola virus disease in the Democratic Republic of the Congo (DRC) occurred. Genome sequencing has shown that this outbreak was not related to the 2014–15 West Africa Ebola virus epidemic, but was of the same EBOV species. It began in August 2014 and was declared over in November of that year, after 42 days without any new cases. This is the 7th outbreak there, three of which occurred during the period of Zaire.
Epidemiology
Index patient
The outbreak was traced to a woman living in Ikanamongo Village in the remote northern Équateur province who fell ill after handling bushmeat. Despite treatment in a local clinic, the woman died on 11 August 2014. At the time of her death, her diagnosis was hemorrhagic fever of unknown etiology. Subsequent laboratory studies confirmed she had died of Ebola virus disease.
Response
Medecins Sans Frontieres/Doctors without Borders (MSF) deployed a team of 50 staff to the area and opened two EVD treatment centers with a combined capacity of 50 beds. MSF, together with the country's Ministry of Health and the World Health Organization (WHO) worked to heighten public awareness and ensure that surveillance, contact tracing, and follow-up activities were carried out in order to limit the spread of the disease. There are no roads to the affected area, which made working conditions difficult.
Subsequent cases
By 18 August, 13 people, including three health care workers, were reported to have died of Ebola-like symptoms in Équateur province, a province that lies about north of the capital Kinshasa. On 26 August, the Équateur Province Ministry of Health confirmed an outbreak of Ebola to the WHO.
On 2 September, the WHO said that there were currently 31 deaths in the Northern Boende area in the province of Équateur and 53 confirmed, suspected or likely cases.
On 9 September, the WHO raised the number of cases to 62 and the death toll to 35 from possible or confirmed Ebola cases. Included in this number were 9 health-care workers with 7 deaths among them. In total, 386 contacts were listed and 239 contacts were being followed. The outbreak was still contained in Jeera county in the Boende region.
As of 28 October, there had been 66 cases reported. In total, 49
deaths had been reported, including eight among health care workers.
No new reported contacts were being followed and twenty days had passed since the last reported case tested
negative for the second time and was discharged. It was stated that the DRC would therefore be
declared free of Ebola disease 42 days after the date of the second negative test if no new cases were reported. The outbreak was declared over on 15 November 2014.
Subsequent findings
In October 2014, it was reported that more recent findings suggested that there may have been several previous cases. The woman's husband believed to have been the index case told an investigation team that shortly before she became ill ,she had visited two women who later died from Ebola-like symptoms. Other village residents also told the team that all the pigs in the village had died just before the illness hit the village and they had eaten the pigs. According to the research team, "it was the third time, after 2007 and 2012, that widespread pig deaths had preceded Ebola outbreaks in humans in the DR Congo...and it has been established that the pigs that died in 2012 carried the Ebola virus." Pig to human transmission has never been proven in previous outbreaks, but villagers have been told to avoid eating them and the investigation is ongoing.
Virology
Results from virus sequencing of samples from the Ebola outbreak in the Democratic Republic of Congo have shown that the virus is the Zaire species in a lineage most closely related to a virus from the 1995 Ebola outbreak in Kikwit.
The Zaire species of the virus is indigenous to the area. When the outbreak was first reported there were fears that an ongoing epidemic in West Africa may have spread to the DRC, however results from virus characterization, together with findings from the epidemiological investigation, showed that the outbreak in DRC is a distinct and independent event, with no relationship to the outbreak in West Africa.
History of Ebola outbreaks in the DRC
Multiple documented outbreaks of Ebola virus disease have occurred in the DRC since 1976, which are summarised in the table below.
The first case of Ebola disease ever recorded occurred in August 1976 in Yambuku, a small village in Mongala District in northern Democratic Republic of the Congo (then known as Zaire). The first victim of the disease was the village school headmaster, who had toured an area near the Central African Republic border along the Ebola river in mid-August. On 8 September, he died of what would become known as Ebola virus disease. Subsequently, a number of other cases were reported, almost all centered on the Yambuku mission hospital or having close contact with other cases. A total of 318 cases and 280 deaths (an 88% fatality rate) resulted from this outbreak, which, along with an outbreak in Sudan that had begun a few weeks previously, were the first outbreaks of Ebola ever recorded.
The virus responsible for the initial outbreak, named after the nearby Ebola river, was first thought to be Marburg virus but was later identified as a new type of virus related to Marburg.
See also
2017 Democratic Republic of the Congo Ebola virus outbreak
2018 Équateur province Democratic Republic of the Congo Ebola virus outbreak
2018 Kivu Democratic Republic of the Congo Ebola virus outbreak
References
Further reading
External links
ICTV Files and Discussions — Discussion forum and file distribution for the International Committee on Taxonomy of Viruses
Genomic data on Ebola virus isolates and other members of the Filoviridae family
Ebola Hemorrhagic Fever — CDC.gov
The Ebola Virus 3D model of the Ebola virus, prepared by Visual Science, Moscow.
ICTV Files and Discussions — Discussion forum and file distribution for the International Committee on Taxonomy of Viruses
FILOVIR — scientific resources for research on filoviruses
2014 in the Democratic Republic of the Congo
2014 disease outbreaks
Disease outbreaks in the Democratic Republic of the Congo
Democratic Republic of the Congo |
```objective-c
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GL_GL_IMPLEMENTATION_H_
#define UI_GL_GL_IMPLEMENTATION_H_
#include <string>
#include <vector>
#include "base/native_library.h"
#include "build/build_config.h"
#include "ui/gl/gl_export.h"
#include "ui/gl/gl_switches.h"
namespace gfx {
class GLContext;
// The GL implementation currently in use.
enum GLImplementation {
kGLImplementationNone,
kGLImplementationDesktopGL,
kGLImplementationDesktopGLCoreProfile,
kGLImplementationOSMesaGL,
kGLImplementationAppleGL,
kGLImplementationEGLGLES2,
kGLImplementationEGLGLES2SwiftShader,
kGLImplementationMockGL
};
struct GL_EXPORT GLWindowSystemBindingInfo {
GLWindowSystemBindingInfo();
std::string vendor;
std::string version;
std::string extensions;
bool direct_rendering;
};
void GL_EXPORT
GetAllowedGLImplementations(std::vector<GLImplementation>* impls);
#if defined(OS_WIN)
typedef void*(WINAPI* GLGetProcAddressProc)(const char* name);
#else
typedef void* (*GLGetProcAddressProc)(const char* name);
#endif
// Initialize a particular GL implementation.
GL_EXPORT bool InitializeStaticGLBindings(GLImplementation implementation);
// Initialize function bindings that depend on the context for a GL
// implementation.
GL_EXPORT bool InitializeDynamicGLBindings(GLImplementation implementation,
GLContext* context);
// Initialize Debug logging wrappers for GL bindings.
void InitializeDebugGLBindings();
// Initialize stub methods for drawing operations in the GL bindings. The
// null draw bindings default to enabled, so that draw operations do nothing.
void InitializeNullDrawGLBindings();
// TODO(danakj): Remove this when all test suites are using null-draw.
GL_EXPORT bool HasInitializedNullDrawGLBindings();
// Filter a list of disabled_extensions from GL style space-separated
// extension_list, returning a space separated list of filtered extensions, in
// the same order as the input.
GL_EXPORT std::string FilterGLExtensionList(
const char* extension_list,
const std::vector<std::string>& disabled_extensions);
// Once initialized, instantiating this turns the stub methods for drawing
// operations off allowing drawing will occur while the object is alive.
class GL_EXPORT DisableNullDrawGLBindings {
public:
DisableNullDrawGLBindings();
~DisableNullDrawGLBindings();
private:
bool initial_enabled_;
};
GL_EXPORT void ClearGLBindings();
// Set the current GL implementation.
GL_EXPORT void SetGLImplementation(GLImplementation implementation);
// Get the current GL implementation.
GL_EXPORT GLImplementation GetGLImplementation();
// Does the underlying GL support all features from Desktop GL 2.0 that were
// removed from the ES 2.0 spec without requiring specific extension strings.
GL_EXPORT bool HasDesktopGLFeatures();
// Get the GL implementation with a given name.
GLImplementation GetNamedGLImplementation(const std::string& name);
// Get the name of a GL implementation.
const char* GetGLImplementationName(GLImplementation implementation);
// Add a native library to those searched for GL entry points.
void AddGLNativeLibrary(base::NativeLibrary library);
// Unloads all native libraries.
void UnloadGLNativeLibraries();
// Set an additional function that will be called to find GL entry points.
// Exported so that tests may set the function used in the mock implementation.
GL_EXPORT void SetGLGetProcAddressProc(GLGetProcAddressProc proc);
// Find an entry point in the current GL implementation. Note that the function
// may return a non-null pointer to something else than the GL function if an
// unsupported function is queried. Spec-compliant eglGetProcAddress and
// glxGetProcAddress are allowed to return garbage for unsupported functions,
// and when querying functions from the EGL library supplied by Android, it may
// return a function that prints a log message about the function being
// unsupported.
void* GetGLProcAddress(const char* name);
// Return information about the GL window system binding implementation (e.g.,
// EGL, GLX, WGL). Returns true if the information was retrieved successfully.
GL_EXPORT bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info);
// Helper for fetching the OpenGL extensions from the current context.
// This helper abstracts over differences between the desktop OpenGL
// core profile, and OpenGL ES and the compatibility profile. It's
// intended for users of the bindings, not the implementation of the
// bindings themselves. This is a relatively expensive call, so
// callers should cache the result.
GL_EXPORT std::string GetGLExtensionsFromCurrentContext();
// Helper for the GL bindings implementation to understand whether
// glGetString(GL_EXTENSIONS) or glGetStringi(GL_EXTENSIONS, i) will
// be used in the function above.
GL_EXPORT bool WillUseGLGetStringForExtensions();
} // namespace gfx
#endif // UI_GL_GL_IMPLEMENTATION_H_
``` |
Ronald M. Anton (born c. 1942) is a Canadian retired curler. He played as third on the Hec Gervais rink that won the 1961 Brier and 1974 Brier.
In 1975 he was inducted into Canadian Curling Hall of Fame.
Anton also coached the 1967 Canadian Schoolboy Championship team.
References
External links
Ronald Anton – Curling Canada Stats Archive
Video: (YouTube-channel «Curling Canada»)
1940s births
Living people
Brier champions
Canadian male curlers
Curlers from Alberta
Canadian curling coaches
20th-century Canadian people |
Chembaruthi () is a 1992 Indian Tamil-language romantic drama film written and directed by R. K. Selvamani and produced by Kovai Thambi. The film stars Prashanth and Roja (in her Tamil debut), while Mansoor Ali Khan, Nassar, Radha Ravi, and Bhanumathi play supporting roles. The film was partially re-shot in Telugu as Chamanti. The music was composed by Ilaiyaraaja, while editing was done by V. Udhayashankar and cinematography by Ravi Yadav. The film released on 17 April 1992 and was a super hit at the box office. It was remade in Hindi as Aao Pyaar Karen (1994).
Plot
The film is a story about the love of two teenagers from different social classes. Raja is the grandson of a rich businesswoman and is settled in London. He comes to a village in India to see his grandmother. Chembaruthi is the sister of a poor fisherman Pandy, who works in Raja's grandmother's house. The couple first sees each other during Raja's birthday party, and it is love at first sight for Raja. They meet often, and their love grows by leaps and bounds. Raja's grandmother wants him to marry Pinky, the daughter of a rich seafood exporter named Murugan. At the party, they announce Raja's interest in Pinky. Raja realizes that his relationship with the daughter of a poor fisherman is not taken kindly by his eccentric grandmother, and when she discovers Raja's love for Chembaruthi, she accuses Pandy of using his sister's beauty and charm to trap Raja for his money. She even offers Pandy cash to have Chembaruthi stop seeing Raja. Pandy feels very humiliated by this accusation and reciprocates by insulting Raja's grandmother. Their conversation enters a deadlock, spelling doom for Raja and Chembaruthi's tender love.
Raja's grandmother then engages him to be married to Pinky in order to establish business ties with her rich father. Murugan also has his sister betrothed to a fisherman named Kumar, but Raja and Chembaruthi run away from home. Raja's grandmother announces a reward for anyone who can help find her grandson. Murugan decides that he wants the money. He and his goons find the lovers, abduct them, and lock them up in a boat. Raja fights for Chembaruthi and saves her from drowning in the sea. Raja's grandmother then realizes that their love is very strong, and she does not want to stand in the way of their happiness. She and Pandy accept their love and give their blessings to the union.
Cast
Soundtrack
The music was composed by Ilaiyaraaja. The lyrics were written by Vaali, Muthulingam and Piraisoodan. Ilayaraja completed the soundtrack within 40 minutes. The film had a song "Pudhu Naal Idhuve" sung by Singer's ArunMozhi and Minmini, which was not part of soundtrack but was included only in film.
Reception
The Indian Express wrote the film is "akin to formula Hindi film" and praised the performances, music and cinematography. Supraja Sridharan of Kalki praised the director for conveying tender romantic feelings in an entertaining manner in big screen while also praising the cinematography, editing and music.
References
External links
1990s Tamil-language films
1992 films
1992 romantic drama films
Films directed by R. K. Selvamani
Films scored by Ilaiyaraaja
Indian romantic drama films
Tamil films remade in other languages |
Ceville is a humorous graphic adventure video game developed by the German game studio Realmforge Studios and published by Kalypso Media. Despite the game's use of 3D environments and models, the gameplay is very true to the graphical point-and-click adventure tradition of gameplay, immortalized by game series like Monkey Island from LucasArts and the King's Quest series from Sierra Online.
Plot
The evil and sarcastic tyrant King Ceville is thrown from power by an angry mob and must find a way to reclaim the crown of the fantasy realm Faeryanis. Together with his sidekick Lilly he travels all over the land and encounters a variety of odd and lovable characters including a Dark Knight who smokes too much and The Good Fairy (character from the classic folk tale Cinderella) who runs a rehabilitation clinic for former archvillains.
Reception
Nowgamer praised the game as resembling Monkey Island and for being a step in the revival of adventure games.
The game was criticized for having a few technical issues, most notably a habit of crashing for no obvious reason. The Norwegian radio program Hardcore praised the game in its review for its elegance and charm.
German Gamestar Magazine gave 86% and two Awards, PC Games 80% and PC Action 81%. Gamestar Hungary rating is 83%. IGN gave the game a triumphant 9.0 grade. IT Reviews hailed it as "a welcome return to the Golden Age of animated adventure gaming."
See also
Monkey Island series
Runaway: A Twist of Fate
References
External links
Official Ceville website at Kalypso Media
Kalypso Media Official website
2009 video games
Adventure games
Point-and-click adventure games
Fantasy video games
Focus Entertainment games
Kalypso Media games
Realmforge Studios games
Video games developed in Germany
Windows games |
```javascript
import React, { Component } from 'react';
import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
import createHashtagPlugin from '@draft-js-plugins/hashtag';
import editorStyles from './editorStyles.module.css';
import hashtagStyles from './hashtagStyles.module.css';
const hashtagPlugin = createHashtagPlugin({ theme: hashtagStyles });
const plugins = [hashtagPlugin];
const text =
'In this editor, we can even apply our own styles #design #theme';
export default class CustomHashtagEditor extends Component {
state = {
editorState: createEditorStateWithText(text),
};
onChange = (editorState) => {
this.setState({
editorState,
});
};
focus = () => {
this.editor.focus();
};
render() {
return (
<div className={editorStyles.editor} onClick={this.focus}>
<Editor
editorState={this.state.editorState}
onChange={this.onChange}
plugins={plugins}
ref={(element) => {
this.editor = element;
}}
/>
</div>
);
}
}
``` |
Jean Couzy (9 July 1923 – 2 November 1958) was a French mountaineer. He studied aeronautical engineering at the École Polytechnique. At age 27, he was a member of Maurice Herzog's 1950 expedition to Annapurna. Prior to this, his usual climbing partner was Marcel Schatz, another member of the expedition. On the 1955 French Makalu expedition Couzy made the first ascent of Makalu with Lionel Terray on 15 May 1955.
In the Alps, Jean Couzy was the first to ascend the following routes:
Aiguille de l'M near Chamonix, a classical Severe (D) route named "la Couzy"
An Extremely Severe (ED) route on the north-west face of the Olan.
The Couzy route on the North Face of the Cima Ovest, Dolomites.
On 2 November 1958 he was hit on the head by a rock fall in the southern face of crête des Bergers (southern rim of the Bure plateau) in the Dévoluy Mountains. He is buried in Montmaur cemetery, at the foot of the mountain where his accident occurred.
References
External links
http://www.britannica.com/EBchecked/topic/141002/Jean-Couzy
French mountain climbers
People from Nérac
1932 births
1958 deaths
Mountaineering deaths
Sportspeople from Lot-et-Garonne
Sport deaths in France
École Polytechnique alumni
20th-century French people |
Zsolt Szabó may refer to:
Zsolt Szabó (referee) (born 1972), Hungarian football referee
Zsolt Szabó (politician) (born 1963), Hungarian agronomist and politician
Zsolt Szabó (racing driver) (born 1995), Hungarian racing driver
Zsolt Szabó (footballer) (born 1986), Hungarian footballer |
```javascript
let Steps=[];
if ($("#linkedInFeeds").find(".noLinkedInDiv").length === 0) {
Steps = [
{
intro: 'Welcome to LinkedIn Pages feeds Page: This page shows the posts(feeds) of LinkedIn page accounts.'
},
{
element: document.querySelector('.selectAccountsDiv'),
intro: 'From here you can select LinkedIn Page accounts of which You want to look for Feeds.'
},
{
element: document.querySelector('.rating-css'),
intro: 'From here you can change the rating of your Social Account.'
},
{
element: document.querySelector('.reSocioButtonClass'),
intro: 'From here you can Share Post to Multiple Social Media Accounts.'
},
{
element: document.querySelector('.postLinkClassDiv'),
intro: 'Clicking here will redirect to the original post on the LinkedIn page.'
},
];
}else{
Steps = [
{
intro: 'Welcome to LinkedIn Pages feeds Page: This page shows the posts(feeds) of LinkedIn page accounts.'
},
];
}
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.