コード例 #1
0
        private void Add_Common(CopyPasteCode code, ISectionHeader header, IScreenItem screenItem)
        {
            if (screenItem != null)
            {
                var wasCode = screenItem.CopyPasteCode;
                EnsureRemoved(screenItem);

                // apply the code to the screenItem as a toggle. If the item CopyPasteCode
                // is the same as code being added, then remove the code. Do not add.
                if (wasCode.CompareEqual(code) != true)
                {
                    // mark the screen item with the action.
                    if (this.IsGlobalList == true)
                    {
                        screenItem.CopyPasteCode = code;
                    }

                    // add to this pending action list.
                    var cpItem = new CopyPasteItem(code, screenItem, header);
                    this.Add(cpItem);
                }
            }
        }
コード例 #2
0
 public CopyPasteItem(CopyPasteCode code, IScreenItem item, ISectionHeader header)
 {
     this.CopyPasteCode = code;
     this.ScreenItem    = item;
     this.SectionHeader = header;
 }