示例#1
0
 private void ttfTextField_TextElementClicked(object sender, StatusTextElement stElement)
 {
     if (TextElementClicked != null)
     {
         TextElementClicked(this, stElement);
     }
 }
示例#2
0
 private void Status_TextElementClicked(object sender, StatusTextElement stElement)
 {
     if (StatusTextClicked != null)
     {
         StatusTextClicked(this, ((TimelineStatus)sender).StatusObj, stElement);
     }
 }
        private void rtbTextBox_Click(object sender, EventArgs e)
        {
            if (m_stStatusText != null)
            {
                Point             ptCursorLoc = rtbTextBox.PointToClient(Cursor.Position);
                int               iCharIndex  = rtbTextBox.GetCharIndexFromPosition(ptCursorLoc);
                StatusTextElement stElement   = m_stStatusText.FindWord(iCharIndex);

                if ((stElement != null) && (TextElementClicked != null))
                {
                    TextElementClicked(this, stElement);
                }
            }
        }
示例#4
0
        private void tmlTimeline_StatusTextClicked(object sender, Status stStatus, StatusTextElement stElement)
        {
            switch (stElement.Type)
            {
            case StatusTextElement.StatusTextElementType.URL:
                //open browser - let the windows shell handle it
                System.Diagnostics.Process.Start(stElement.Text);
                break;

            case StatusTextElement.StatusTextElementType.Hashtag:
                //show the view for that hashtag
                break;

            case StatusTextElement.StatusTextElementType.ScreenName:
                //show the view for that screen name
                break;
            }
        }
示例#5
0
        public XsollaStatusText(JSONNode statusTextNode)
        {
            this.state          = statusTextNode [ST_STATE];
            this.backUrl        = statusTextNode [ST_BACKURL];
            this.backUrlCaption = statusTextNode [ST_BACKURL_CAPTION];
            textElements        = new List <StatusTextElement> ();
            textElementsMap     = new Dictionary <string, StatusTextElement> ();
            IEnumerable <JSONNode> enumerable = statusTextNode[ST_INFO].Childs;
            IEnumerator <JSONNode> iterator   = enumerable.GetEnumerator();

            while (iterator.MoveNext())
            {
                JSONNode textElement = iterator.Current;
                string   key         = textElement[STE_KEY].Value;
                string   pref        = textElement[STE_PREF].Value;
                string   parameter   = textElement[STE_PARAMETER].Value;
                string   value       = textElement[STE_VALUE].Value;
                string   name        = textElement[STE_NAME].Value;

                if ("time".Equals(key))
                {
                    DateTime dateTime   = DateTime.Parse(value);
                    string   dateString = string.Format("{0:dd/MM/yyyy HH:mm}", dateTime);
                    value = dateString;
                }

                if ("recurrentDateNextCharge".Equals(key))
                {
                    DateTime dateTime   = DateTime.Parse(value);
                    string   dateString = string.Format("{0:dd/MM/yyyy}", dateTime);
                    value = dateString;
                }

                var newSte = new StatusTextElement(key, pref, parameter, value, name);
                AddStatusTextElement(newSte);
            }
        }
示例#6
0
 public void AddStatusTextElement(StatusTextElement textElement)
 {
     textElements.Add(textElement);
     textElementsMap.Add(textElement.GetKey(), textElement);
 }
示例#7
0
 public void AddStatusTextElement(StatusTextElement textElement)
 {
     textElements.Add(textElement);
     textElementsMap.Add (textElement.GetKey(), textElement);
 }
示例#8
0
        public XsollaStatusText(JSONNode statusTextNode)
        {
            this.state = statusTextNode [ST_STATE];
            this.backUrl = statusTextNode [ST_BACKURL];
            this.backUrlCaption = statusTextNode [ST_BACKURL_CAPTION];
            textElements = new List<StatusTextElement> ();
            textElementsMap = new Dictionary<string ,StatusTextElement> ();
            IEnumerable<JSONNode> enumerable = statusTextNode[ST_INFO].Childs;
            IEnumerator<JSONNode> iterator = enumerable.GetEnumerator ();
            while(iterator.MoveNext())
            {
                JSONNode textElement = iterator.Current;
                string key = textElement[STE_KEY].Value;
                string pref = textElement[STE_PREF].Value;
                string parameter = textElement[STE_PARAMETER].Value;
                string value = textElement[STE_VALUE].Value;
                string name = textElement[STE_NAME].Value;

                if("time".Equals(key)) {
                    DateTime dateTime = DateTime.Parse(value);
                    string dateString = string.Format("{0:dd/MM/yyyy HH:mm}", dateTime);
                    value = dateString;
                }

                if("recurrentDateNextCharge".Equals(key)) {
                    DateTime dateTime = DateTime.Parse(value);
                    string dateString = string.Format("{0:dd/MM/yyyy}", dateTime);
                    value = dateString;
                }

                var newSte = new StatusTextElement(key, pref, parameter, value, name);
                AddStatusTextElement(newSte);
            }
        }