本文整理汇总了C#中Note.SetXmlContent方法的典型用法代码示例。如果您正苦于以下问题:C# Note.SetXmlContent方法的具体用法?C# Note.SetXmlContent怎么用?C# Note.SetXmlContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note.SetXmlContent方法的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 {
//.........这里部分代码省略.........