/// <summary> /// Copy the items given in the list (tables and graphs) to a folder, which is selected by the user via a dialog box. /// </summary> /// <param name="list">List of items to delete.</param> /// <param name="areDocumentsFromOneFolder">If true, the list contains objects origination from only one project folder (or from subfolders of that folder). In this case the paramenter <c>originalSourceFolder</c> contains the original project folder from which the items should be copied.</param> /// <param name="originalSourceFolder">Original folder from which the items originate (only valid if <c>areDocumentsFromOneFolder</c> is true.</param> public static void CopyDocuments(IList <object> list, bool areDocumentsFromOneFolder, string originalSourceFolder) { var names = Current.Project.Folders.GetSubfoldersAsDisplayFolderNameStringListSorted(ProjectFolder.RootFolderName, true); names.Insert(0, rootFolderDisplayName); var choices = new TextChoice(names.ToArray(), 0, true) { Description = "Choose or enter the folder to copy the items into:" }; if (!Current.Gui.ShowDialog(ref choices, "Folder choice", false)) { return; } string newFolderName = rootFolderDisplayName == choices.Text ? ProjectFolder.RootFolderName : ProjectFolder.ConvertDisplayFolderNameToFolderName(choices.Text); DocNodePathReplacementOptions relocateOptions = null; if (areDocumentsFromOneFolder) { var relocateData = Current.Gui.YesNoCancelMessageBox("Do you want to relocate the references in the copied plots so that they point to the destination folder?", "Question", null); if (null == relocateData) { return; } if (true == relocateData) { relocateOptions = new DocNodePathReplacementOptions(); relocateOptions.AddPathReplacementsForAllProjectItemTypes(originalSourceFolder, newFolderName); } } Current.Project.Folders.CopyItemsToFolder(list, newFolderName, null != relocateOptions ? relocateOptions.Visit : (DocNodeProxyReporter)null, false); }
public ReactionText(BinaryReader br, UInt32 mapVersion) { Type = br.ReadByte(); TargetType = br.ReadByte(); Main = br.ReadLengthedString(); var numParams = br.ReadUInt32(); for (var i = 0U; i < numParams; ++i) TextParams.Add(TextParam.Read(br, mapVersion)); var numChoices = br.ReadUInt32(); for (var i = 0U; i < numChoices; ++i) { var tChoice = new TextChoice { TriggerCOID = br.ReadUInt64(), Text = br.ReadLengthedString(), TextParams = new List<TextParam>() }; var numChoiceParams = br.ReadUInt32(); for (var j = 0U; j < numChoiceParams; ++j) tChoice.TextParams.Add(TextParam.Read(br, mapVersion)); } }
void OnMouseDown() { if (isVisible) { if (typeWritterEffect.effectEnded && typeWritterEffect.fullText.Length == 0) { TextChoice mTextChoiceP = getItemByID(textToShow); if (mTextChoiceP.child.Capacity == 1) { mChoice1.SetActive(false); mChoice2.SetActive(false); mChoice3.SetActive(false); TextChoice mTextChoice = getItemByID(mTextChoiceP.child[0]); if (mTextChoice.choice != -1) { //text after choice typeWritterEffect.fullText = mTextChoice.text; typeWritterEffect.startEffect = true; typeWritterEffect.effectEnded = false; textToShow = mTextChoice.id; } else { //conversation text typeWritterEffect.fullText = mTextChoice.text; typeWritterEffect.startEffect = true; typeWritterEffect.effectEnded = false; textToShow = mTextChoice.id; } } else if (mTextChoiceP.child.Capacity == 3) { //choice options TextChoice mTextChoice1 = getItemByID(mTextChoiceP.child[0]); TextChoice mTextChoice2 = getItemByID(mTextChoiceP.child[1]); TextChoice mTextChoice3 = getItemByID(mTextChoiceP.child[2]); textToShow = mTextChoice2.id; mChoice1.SetActive(true); mChoice2.SetActive(true); mChoice3.SetActive(true); typeWritterEffect.fullText = " "; typeWritterEffect.startEffect = true; typeWritterEffect.effectEnded = false; mChoice1.GetComponent <Text>().text = mTextChoice1.text; mChoice2.GetComponent <Text>().text = mTextChoice2.text; mChoice3.GetComponent <Text>().text = mTextChoice3.text; } } } }
/// <summary> /// Move the items given in the list (tables and graphs) to a new location. The new location is ask for in a dialog. /// </summary> /// <param name="list">List of items to move.</param> public static void MoveDocuments(IList <object> list) { var names = Current.Project.Folders.GetSubfoldersAsDisplayFolderNameStringListSorted(ProjectFolder.RootFolderName, true); names.Insert(0, rootFolderDisplayName); var choices = new TextChoice(names.ToArray(), 0, true) { Description = "Choose or enter the folder to move the items into:" }; if (!Current.Gui.ShowDialog(ref choices, "Folder choice", false)) { return; } string newFolderName = rootFolderDisplayName == choices.Text ? ProjectFolder.RootFolderName : ProjectFolder.ConvertDisplayFolderNameToFolderName(choices.Text); Current.Project.Folders.MoveItemsToFolder(list, newFolderName); }
public void SetEvent(TextChoice choice, MultipleChoiceEventProcessor viewProcessor) { _choice = choice; _owner = viewProcessor; }
public TextChoiceViewModel(TextChoice model) : base(model) { _model = model; }