void UpdateComboBox()
        {
            LinkComboBox?.RemoveAll();

            string mostRecentDocument = RecentStore.SharedRecentStore.GetMostRecent();
            var    recentDocuments    = RecentStore.SharedRecentStore.GetRecents();

            if (!string.IsNullOrEmpty(mostRecentDocument))
            {
                LinkComboBox.StringValue = mostRecentDocument;
            }

            if (recentDocuments != null)
            {
                LinkComboBox.Completes            = true;
                LinkComboBox.MaximumNumberOfLines = 12;

                foreach (NSString link_id in recentDocuments.Keys)
                {
                    var title = (NSString)recentDocuments.ValueForKey(link_id);

                    if (!string.IsNullOrWhiteSpace(title.ToString()))
                    {
                        LinkComboBox.Add(title);
                    }
                    else
                    {
                        LinkComboBox.Add(link_id);
                    }
                }
            }
        }
        void PopulateLinkComboBox()
        {
            string[] recents = GetRecents();

            if (recents != null)
            {
                foreach (string recent_item in GetRecents())
                {
                    LinkComboBox.Add(new NSString(recent_item));
                }
            }

            LinkComboBox.StringValue = "" + NSUserDefaults.StandardUserDefaults.StringForKey(LAST_DOCUMENT_KEY);
        }
예제 #3
0
        void ReleaseDesignerOutlets()
        {
            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (LinkComboBox != null)
            {
                LinkComboBox.Dispose();
                LinkComboBox = null;
            }

            if (OpenButton != null)
            {
                OpenButton.Dispose();
                OpenButton = null;
            }

            if (OpenLocationWindow != null)
            {
                OpenLocationWindow.Dispose();
                OpenLocationWindow = null;
            }

            if (TokenTextField != null)
            {
                TokenTextField.Dispose();
                TokenTextField = null;
            }

            if (TokenStatusTextField != null)
            {
                TokenStatusTextField.Dispose();
                TokenStatusTextField = null;
            }
        }