当前位置: 首页>>代码示例>>C#>>正文


C# ICursor.GetColumnIndexOrThrow方法代码示例

本文整理汇总了C#中ICursor.GetColumnIndexOrThrow方法的典型用法代码示例。如果您正苦于以下问题:C# ICursor.GetColumnIndexOrThrow方法的具体用法?C# ICursor.GetColumnIndexOrThrow怎么用?C# ICursor.GetColumnIndexOrThrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICursor的用法示例。


在下文中一共展示了ICursor.GetColumnIndexOrThrow方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditNote

 /// <summary>
 /// Create an intent to start the WikiNoteEditor using the current title
 /// and body information (if any).
 /// </summary>
 public void EditNote(string mNoteName, ICursor cursor)
 {
     // This intent could use the android.intent.action.EDIT for a wiki note
     // to invoke, but instead I wanted to demonstrate the mechanism for invoking
     // an intent on a known class within the same application directly. Note
     // also that the title and body of the note to edit are passed in using the extras bundle.
     Intent i = new Intent(_context, typeof(WikiNoteEditor));
     i.PutExtra(WikiNote.Notes.TITLE, mNoteName);
     String body;
     if (cursor != null)
     {
         body = cursor.GetString(cursor.GetColumnIndexOrThrow(WikiNote.Notes.BODY));
     }
     else
     {
         body = string.Empty;
     }
     i.PutExtra(WikiNote.Notes.BODY, body);
     _context.StartActivityForResult(i, ACTIVITY_EDIT);
 }
开发者ID:CBSAdvisor,项目名称:cbs-quantum,代码行数:24,代码来源:WikiActivityHelper.cs

示例2: prepareSyncableNotes

        // syncing based on updated local notes only
        protected void prepareSyncableNotes(ICursor localGuids)
        {
            remoteGuids = new List<string>();
            pushableNotes = new List<Note>();
            pullableNotes = new List<Note>();
            comparableNotes = new List<Note[]>();
            deleteableNotes = new List<Note>();
            conflictingNotes = new List<Note[]>();

            localGuids.MoveToFirst();
            do {
                Note note = NoteManager.getNoteByGuid(activity, localGuids.GetString(localGuids.GetColumnIndexOrThrow(Note.GUID)));

                if(!note.getTags().Contains("system:template")) // don't push templates TODO: find out what's wrong with this, if anything
                    pushableNotes.Add(note);
            } while (localGuids.MoveToNext());

            if(cancelled) {
                doCancel();
                return;
            }

            doSyncNotes();
        }
开发者ID:decriptor,项目名称:tomdroid,代码行数:25,代码来源:SyncService.cs

示例3: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            this._noteView = FindViewById<TextView>(Resource.Id.noteview);
            AndroidUri localUri = Intent.Data;

            if ((localUri == null) && (bundle != null))
            {
                localUri = AndroidUri.Parse(bundle.GetString(KEY_URL));
            }

            if ((localUri == null) || (localUri.PathSegments.Count < 2))
            {
                localUri = AndroidUri.WithAppendedPath(WikiNote.Notes.ALL_NOTES_URI, Resources.GetString(Resource.String.start_page));
            }

            ICursor localCursor = ManagedQuery(localUri, WikiNote.WIKI_NOTES_PROJECTION, null, null, null);

            bool newNote = false;
            if ((localCursor == null) || (localCursor.Count == 0))
            {
                try
                {
                    // no matching wikinote, so create it
                    localUri = ContentResolver.Insert(localUri, null);
                    if (localUri == null)
                    {
                        Log.Error("WikiNotes", "Failed to insert new wikinote into " + Intent.Data);
                        Finish();
                        return;
                    }
                    // make sure that the new note was created successfully, and
                    // select it
                    localCursor = ManagedQuery(localUri, WikiNote.WIKI_NOTES_PROJECTION, null, null, null);
                    if ((localCursor == null) || (localCursor.Count == 0))
                    {
                        Log.Error("WikiNotes", "Failed to open new wikinote: " + Intent.Data);
                        Finish();
                        return;
                    }
                    newNote = true;
                }
                catch (Exception ex)
                {
                    Log.Error(WikiNote.LOG_TAG, ex.Message);
                }
            }

            _uri = localUri;
            _cursor = localCursor;
            localCursor.MoveToFirst();
            _helper = new WikiActivityHelper(this);

            // get the note name
            String noteName = _cursor.GetString(_cursor
                .GetColumnIndexOrThrow(WikiNote.Notes.TITLE));
            _noteName = noteName;

            // set the title to the name of the page
            Title = Resources.GetString(Resource.String.wiki_title, noteName);

            // If a new note was created, jump straight into editing it
            if (newNote)
            {
                _helper.EditNote(noteName, null);
            }

            // Set the menu shortcut keys to be default keys for the activity as well
            SetDefaultKeyMode(DefaultKey.Shortcut);
        }
开发者ID:CBSAdvisor,项目名称:cbs-quantum,代码行数:73,代码来源:WikiNotes.cs

示例4: getNoteTitle

 private string getNoteTitle(ICursor item)
 {
     return item.GetString(item.GetColumnIndexOrThrow(Note.TITLE));
 }
开发者ID:decriptor,项目名称:tomdroid,代码行数:4,代码来源:NoteViewShortcutsHelper.cs

示例5: getNoteId

 private int getNoteId(ICursor item)
 {
     return item.GetInt(item.GetColumnIndexOrThrow(Note.ID));
 }
开发者ID:decriptor,项目名称:tomdroid,代码行数:4,代码来源:NoteViewShortcutsHelper.cs

示例6: PopulateFrom

 public void PopulateFrom(ICursor c)
 {
     var nameColumn = c.GetColumnIndexOrThrow(VehicleTable.Columns.VEHICLE);
     _textView.Text = c.GetString(nameColumn);
 }
开发者ID:topgenorth,项目名称:MyTrips,代码行数:5,代码来源:SimpleVehicleListRowHelper.cs


注:本文中的ICursor.GetColumnIndexOrThrow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。