本文整理汇总了C#中ISegment.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# ISegment.Clone方法的具体用法?C# ISegment.Clone怎么用?C# ISegment.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISegment
的用法示例。
在下文中一共展示了ISegment.Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NumberVerifierMessageUI
public NumberVerifierMessageUI(MessageEventArgs messageEventArgs, IBilingualDocument bilingualDocument, ISegment sourceSegment, ISegment targetSegment)
{
MessageEventArgs = messageEventArgs;
BilingualDocument = bilingualDocument;
SourceSegment = sourceSegment;
TargetSegment = targetSegment;
InitializeComponent();
_sourceSegmentControl.Dock = DockStyle.Fill;
_sourceSegmentControl.IsReadOnly = false;
_sourceSegmentControl.ReplaceDocumentSegment(sourceSegment.Clone() as ISegment);
panel_Source.Controls.Add(_sourceSegmentControl);
_sourceSegmentControl.ReplaceDocumentSegment(sourceSegment);
_targetSegmentControl.Dock = DockStyle.Fill;
_targetSegmentControl.IsReadOnly = false;
_targetSegmentControl.ReplaceDocumentSegment(targetSegment.Clone() as ISegment);
panel_Target.Controls.Add(_targetSegmentControl);
_targetSegmentControl.ReplaceDocumentSegment((ISegment)targetSegment.Clone());
_targetSegmentControl.SegmentContentChanged += OnSegmentContentChanged;
_hasSegmentChanged = false;
UpdateMessage(messageEventArgs);
}
示例2: CustomMessageControl
/// <summary>
/// Constructor that takes the given message event args, bilingual document, source segment and target segment.
/// </summary>
/// <param name="messageEventArgs">message event arguments</param>
/// <param name="bilingualDocument">bilingual document</param>
/// <param name="sourceSegment">source segment</param>
/// <param name="targetSegment">target segment</param>
public CustomMessageControl(MessageEventArgs messageEventArgs, IBilingualDocument bilingualDocument, ISegment sourceSegment, ISegment targetSegment)
{
MessageEventArgs = messageEventArgs;
BilingualDocument = bilingualDocument;
SourceSegment = sourceSegment;
TargetSegment = targetSegment;
InitializeComponent();
_sourceSegmentControl.Dock = DockStyle.Fill;
_sourceSegmentPanel.Controls.Add(_sourceSegmentControl);
_targetSegmentControl.Dock = DockStyle.Fill;
_targetSegmentPanel.Controls.Add(_targetSegmentControl);
UpdateMessage(messageEventArgs);
UpdateSourceSegment(sourceSegment);
UpdateTargetSegment((ISegment)targetSegment.Clone());
UpdateProblemDescription(messageEventArgs);
UpdateSuggestions(messageEventArgs);
// make the target segment editable
_targetSegmentControl.IsReadOnly = false;
_suggestionsList.SelectedIndexChanged += _suggestionsList_SelectedIndexChanged;
}
示例3: UpdateTargetSegment
/// <summary>
/// Updates the source segment using the given target segment.
/// </summary>
/// <param name="targetSegment">target segment</param>
private void UpdateTargetSegment(ISegment targetSegment)
{
// don't listen for events when contents are reset
_targetSegmentControl.SegmentContentChanged -= OnSegmentContentChanged;
// show target segment in segment control
_targetSegmentControl.ReplaceDocumentSegment((ISegment)targetSegment.Clone());
_hasSegmentChanged = false;
// make the target segment editable
_targetSegmentControl.IsReadOnly = false;
// start listening to changes again
_targetSegmentControl.SegmentContentChanged += OnSegmentContentChanged;
_suggestionsList.Enabled = true;
}