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


C# Note.SetTitle方法代码示例

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


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

示例1: onCreate

        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            if(!this.Intent.HasExtra("datediff")) {
                TLog.v(TAG, "no date diff");
                Finish();
                return;
            }
            TLog.v(TAG, "starting CompareNotes");

            SetContentView(Resource.Layout.note_compare);

            Bundle extras = this.Intent.Extras;

            remoteNote = new Note();
            remoteNote.SetTitle(extras.GetString("title"));
            remoteNote.SetGuid(extras.GetString("guid"));
            remoteNote.SetLastChangeDate(extras.GetString("date"));
            remoteNote.SetXmlContent(extras.GetString("content"));
            remoteNote.SetTags(extras.GetString("tags"));

            ContentValues values = new ContentValues();
            values.Put(Note.TITLE, extras.GetString("title"));
            values.Put(Note.FILE, extras.GetString("file"));
            values.Put(Note.GUID, extras.GetString("guid"));
            values.Put(Note.MODIFIED_DATE, extras.GetString("date"));
            values.Put(Note.NOTE_CONTENT, extras.GetString("content"));
            values.Put(Note.TAGS, extras.GetString("tags"));

            dateDiff = extras.GetInt("datediff");
            noRemote = extras.GetBoolean("noRemote");

            // check if we're comparing two different notes with same title

            differentNotes = Intent.HasExtra("localGUID");
            if(differentNotes) {
                localNote = NoteManager.getNoteByGuid(this, extras.GetString("localGUID"));
                TLog.v(TAG, "comparing two different notes with same title");
            }
            else {
                localNote = NoteManager.getNoteByGuid(this, extras.GetString("guid"));
                TLog.v(TAG, "comparing two versions of the same note");
            }

            bool deleted = localNote.getTags().Contains("system:deleted");

            string message;

            Button localBtn = (Button)FindViewById(Resource.Id.localButton);
            Button remoteBtn = (Button)FindViewById(Resource.Id.remoteButton);
            Button copyBtn = (Button)FindViewById(Resource.Id.copyButton);

            TextView messageView = (TextView)FindViewById(Resource.Id.message);

            ToggleButton diffLabel = (ToggleButton)FindViewById(Resource.Id.diff_label);
            ToggleButton localLabel = (ToggleButton)FindViewById(Resource.Id.local_label);
            ToggleButton remoteLabel = (ToggleButton)FindViewById(Resource.Id.remote_label);

            EditText localTitle = (EditText)FindViewById(Resource.Id.local_title);
            EditText remoteTitle = (EditText)FindViewById(Resource.Id.remote_title);

            TextView diffView = (TextView)FindViewById(Resource.Id.diff);
            EditText localEdit = (EditText)FindViewById(Resource.Id.local);
            EditText remoteEdit = (EditText)FindViewById(Resource.Id.remote);

            updateTextAttributes(localTitle, localEdit);
            updateTextAttributes(remoteTitle, remoteEdit);

            if(deleted) {
                TLog.v(TAG, "comparing deleted with remote");
                message = GetString(Resource.String.sync_conflict_deleted);

                diffLabel.Visibility = ViewStates.Gone;
                localLabel.Visibility = ViewStates.Gone;
                diffView.Visibility = ViewStates.Gone;
                localEdit.Visibility = ViewStates.Gone;
                localTitle.Visibility = ViewStates.Gone;

                copyBtn.Visibility = ViewStates.Gone;

                // if importing note, offer cancel import option to open main screen
                if(noRemote) {
                    localBtn.SetText(GetString(Resource.String.btnCancelImport));
            //					localBtn.SetOnClickListener( new View.OnClickListener() {
            //						public void onClick(View v) {
            //							finishForResult(new Intent());
            //						}
            //			        });
                }
                else {
                    localBtn.SetText(GetString(Resource.String.delete_remote));
            //					localBtn.SetOnClickListener( new View.OnClickListener() {
            //						public void onClick(View v) {
            //							onChooseDelete();
            //						}
            //			        });
                }
            }
            else {
//.........这里部分代码省略.........
开发者ID:decriptor,项目名称:tomdroid,代码行数:101,代码来源:CompareNotes.cs


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