예제 #1
0
            public static FormattedParts AddSelectionHighlight(FormattedParts orig)
            {
                FormattedParts newParts = Clone(orig);

                newParts.HasAddrLabelHighlight = true;
                return(newParts);
            }
예제 #2
0
 public void Insert(int index, FormattedParts item)
 {
     ((IList <FormattedParts>)mList).Insert(index, item);
     OnPropertyChanged(CountString);
     OnPropertyChanged(IndexerName);
     OnCollectionChanged(NotifyCollectionChangedAction.Add, item, index);
 }
예제 #3
0
 public void Add(FormattedParts item)
 {
     ((IList <FormattedParts>)mList).Add(item);
     OnPropertyChanged(CountString);
     OnPropertyChanged(IndexerName);
     OnCollectionReset();
 }
예제 #4
0
            public static FormattedParts CreateVisualizationSet(VisualizationSet visSet)
            {
                FormattedParts parts = new FormattedParts();

                if (visSet.Count == 0)
                {
                    // should not happen
                    parts.Comment       = "!EMPTY VSET!";
                    parts.IsLongComment = true;
                }
                else
                {
                    string fmt;
                    if (visSet.Count == 1)
                    {
                        fmt = Res.Strings.VIS_SET_SINGLE_FMT;
                    }
                    else
                    {
                        fmt = Res.Strings.VIS_SET_MULTIPLE_FMT;
                    }
                    parts.Comment            = string.Format(fmt, "Bitmap", visSet[0].Tag, visSet.Count - 1);
                    parts.VisualizationSet   = visSet.ToArray();
                    parts.IsVisualizationSet = true;
                }
                return(parts);
            }
예제 #5
0
            public static FormattedParts RemoveSelectionAddrHighlight(FormattedParts orig)
            {
                FormattedParts newParts = Clone(orig);

                newParts.HasAddrLabelHighlight = false;
                return(newParts);
            }
예제 #6
0
            public static FormattedParts AddSelectionOperHighlight(FormattedParts orig)
            {
                FormattedParts newParts = Clone(orig);

                newParts.HasOperandHighlight = true;
                return(newParts);
            }
예제 #7
0
            public static FormattedParts SetFlagsModified(FormattedParts orig)
            {
                FormattedParts newParts = Clone(orig);

                newParts.HasModifiedFlags = true;
                return(newParts);
            }
예제 #8
0
            public static FormattedParts RemoveSelectionOperHighlight(FormattedParts orig)
            {
                FormattedParts newParts = Clone(orig);

                newParts.HasOperandHighlight = false;
                return(newParts);
            }
예제 #9
0
        protected override void InsertItem(int index, FormattedParts item)
        {
            base.InsertItem(index, item);

            OnPropertyChanged(CountString);
            OnPropertyChanged(IndexerName);
            OnCollectionChanged(NotifyCollectionChangedAction.Add, item, index);
        }
예제 #10
0
            public static FormattedParts CreatePreLabelDirective(string addrStr, string labelStr)
            {
                FormattedParts parts = new FormattedParts();

                parts.Addr  = addrStr;
                parts.Label = labelStr;
                return(parts);
            }
예제 #11
0
            public static FormattedParts CreateLongComment(string comment)
            {
                FormattedParts parts = new FormattedParts();

                parts.Comment       = comment;
                parts.IsLongComment = true;
                return(parts);
            }
예제 #12
0
 public bool Remove(FormattedParts item)
 {
     // NotifyCollectionChangedAction.Remove wants an index.  We can find the index
     // of the first matching item and then do a RemoveAt, but this call just isn't
     // all that interesting for us, so it's easier to ignore it.
     //return ((IList<FormattedParts>)mList).Remove(item);
     throw new NotSupportedException();
 }
예제 #13
0
            public static FormattedParts CreateDirective(string opstr, string operandStr)
            {
                FormattedParts parts = new FormattedParts();

                parts.Opcode  = opstr;
                parts.Operand = operandStr;
                return(parts);
            }
예제 #14
0
        protected override void SetItem(int index, FormattedParts item)
        {
            FormattedParts originalItem = this[index];

            base.SetItem(index, item);

            OnPropertyChanged(IndexerName);
            OnCollectionChanged(NotifyCollectionChangedAction.Replace, originalItem, item, index);
        }
예제 #15
0
            public static FormattedParts Create(string longComment)
            {
                FormattedParts parts = new FormattedParts();

                parts.Comment      = longComment;
                parts.IsSingleLine = true;

                return(parts);
            }
예제 #16
0
        public void RemoveAt(int index)
        {
            FormattedParts removed = mList[index];

            ((IList <FormattedParts>)mList).RemoveAt(index);
            OnPropertyChanged(CountString);
            OnPropertyChanged(IndexerName);
            OnCollectionChanged(NotifyCollectionChangedAction.Remove, removed, index);
        }
예제 #17
0
        protected override void RemoveItem(int index)
        {
            FormattedParts removedItem = this[index];

            base.RemoveItem(index);

            OnPropertyChanged(CountString);
            OnPropertyChanged(IndexerName);
            OnCollectionChanged(NotifyCollectionChangedAction.Remove, removedItem, index);
        }
예제 #18
0
        /// <summary>
        /// Retrieves the Nth element.
        /// </summary>
        private FormattedParts GetEntry(int index)
        {
            FormattedParts parts = mList[index];

            if (parts == null)
            {
                parts           = mList[index] = ListGen.GetFormattedParts(index);
                parts.ListIndex = index;
            }
            return(parts);
        }
예제 #19
0
            public static FormattedParts CreateFullDirective(string label, string opstr,
                                                             string operandStr, string comment)
            {
                FormattedParts parts = new FormattedParts();

                parts.Label   = label;
                parts.Opcode  = opstr;
                parts.Operand = operandStr;
                parts.Comment = comment;
                return(parts);
            }
예제 #20
0
            /// <summary>
            /// Clones the specified object.
            /// </summary>
            private static FormattedParts Clone(FormattedParts orig)
            {
                FormattedParts newParts = FormattedParts.Create(orig.Offset, orig.Addr,
                                                                orig.Bytes, orig.Flags, orig.Attr, orig.Label, orig.Opcode, orig.Operand,
                                                                orig.Comment, orig.mPartFlags);

                newParts.IsLongComment         = orig.IsLongComment;
                newParts.HasAddrLabelHighlight = orig.HasAddrLabelHighlight;

                newParts.ListIndex = orig.ListIndex;
                return(newParts);
            }
예제 #21
0
            public static FormattedParts CreateNote(string comment, Color color)
            {
                FormattedParts parts = new FormattedParts();

                parts.Comment       = comment;
                parts.IsLongComment = true;
                if (color != NoColor)
                {
                    parts.HasBackgroundColor = true;
                    parts.BackgroundBrush    = new SolidColorBrush(color);
                }
                return(parts);
            }
예제 #22
0
 /// <summary>
 /// Retrieves the Nth element.
 /// </summary>
 private FormattedParts GetEntry(int index)
 {
     Debug.WriteLine("GEN " + index);
     if ((index % 10) != 0)
     {
         return(FormattedParts.Create("off" + index, "addr" + index, "12 34",
                                      "vncidmx", "", "yup:", "LDA", "$1234", "a & b"));
     }
     else
     {
         return(FormattedParts.Create("yup: This is a long comment line"));
     }
 }
예제 #23
0
 // For IList<T>.
 public FormattedParts this[int index] {
     get {
         FormattedParts parts = mList[index];
         if (parts == null)
         {
             parts = mList[index] = GetEntry(index);
         }
         return(parts);
     }
     set {
         FormattedParts orig = mList[index];
         mList[index] = value;
         OnPropertyChanged(IndexerName);
         OnCollectionChanged(NotifyCollectionChangedAction.Replace, orig, value, index);
     }
 }
예제 #24
0
            public static FormattedParts Create(string offset, string addr, string bytes,
                                                string flags, string attr, string label, string opcode, string operand,
                                                string comment)
            {
                FormattedParts parts = new FormattedParts();

                parts.Offset        = offset;
                parts.Addr          = addr;
                parts.Bytes         = bytes;
                parts.Flags         = flags;
                parts.Attr          = attr;
                parts.Label         = label;
                parts.Opcode        = opcode;
                parts.Operand       = operand;
                parts.Comment       = comment;
                parts.IsLongComment = false;

                return(parts);
            }
예제 #25
0
            public static FormattedParts CreateBlankLine()
            {
                FormattedParts parts = new FormattedParts();

                return(parts);
            }
예제 #26
0
 public int IndexOf(FormattedParts item)
 {
     return(((IList <FormattedParts>)mList).IndexOf(item));
 }
예제 #27
0
 public bool Contains(FormattedParts item)
 {
     return(((IList <FormattedParts>)mList).Contains(item));
 }