当前位置: 首页>>代码示例>>C#>>正文


C# ISegment.Clone方法代码示例

本文整理汇总了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);


        }
开发者ID:desautel,项目名称:Sdl-Community,代码行数:28,代码来源:NumberVerifierMessageUI.cs

示例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;
        }
开发者ID:desautel,项目名称:Sdl-Community,代码行数:32,代码来源:CustomMessageControl.cs

示例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;
        }
开发者ID:desautel,项目名称:Sdl-Community,代码行数:22,代码来源:CustomMessageControl.cs


注:本文中的ISegment.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。