All pastes #248747 Raw Edit

Miscellany

public text v1 · immutable
#248747 ·published 2006-11-14 23:25 UTC
rendered paste body
            if (ns != null)
            {
                string text;

                if (this.Name != null)
                {
                    if (m_Amount > 1)
                    {
                        text = string.Format("{0} {1}s", m_Amount.ToString(), this.Name);

                        ns.Send(new AsciiMessage(m_Serial, m_ItemID, MessageType.Label, 906, 3, text, text));
                    }
                    else
                        ns.Send(new AsciiMessage(m_Serial, m_ItemID, MessageType.Label, 906, 3, this.Name, this.Name));

                }
                else
                {
                    string[] temp;
                    text = this.GetType().ToString();
                    temp = text.Split('.');

                    text = temp[temp.Length-1];

                    temp[0] = "";
                    for(int i =0; i < text.Length-1; i++)
                    {
                        if (char.IsUpper(text[i]) && i != 0)
                            temp[0] += " " + text[i];
                        else
                            temp[0] += text[i];
                    }

                    text = temp[0];


                    ns.Send(new AsciiMessage(m_Serial, m_ItemID, MessageType.Label, 906, 3, text, text));
                }
            }