Example #1
0
        public object GetData(string format, bool autoConvert)
        {
            object result = null;

            switch (format)
            {
            case Format_ProjectFolder:
                result = FolderName;
                break;

            case Format_ApplicationInstanceGuid:
                result = Current.ApplicationInstanceGuid.ToString();
                break;

            case Format_ItemList:
            {
                var items = new Altaxo.Main.Commands.ProjectItemCommands.ProjectItemClipboardList(ItemList, FolderName);
                var stb   = Altaxo.Serialization.Clipboard.ClipboardSerialization.SerializeToStringBuilder(items);
                result = stb.ToString();
                ItemListWasRendered = true;
            }
            break;

            case Format_ItemReferenceList:
            {
                var itemReferenceList = new List <Altaxo.Main.DocNodeProxy>(ItemList.Select(x => new Altaxo.Main.DocNodeProxy(x)));
                var items             = new Altaxo.Main.Commands.ProjectItemCommands.ProjectItemReferenceClipboardList(itemReferenceList, FolderName);
                var stb = Altaxo.Serialization.Clipboard.ClipboardSerialization.SerializeToStringBuilder(items);
                result = stb.ToString();
            }
            break;

            default:
                result = null;
                break;
            }

            return(result);
        }
		public object GetData(string format, bool autoConvert)
		{
			object result = null;
			switch (format)
			{
				case Format_ProjectFolder:
					result = FolderName;
					break;

				case Format_ApplicationInstanceGuid:
					result = Current.ApplicationInstanceGuid.ToString();
					break;

				case Format_ItemList:
					{
						var items = new Altaxo.Main.Commands.ProjectItemCommands.ProjectItemClipboardList(ItemList, FolderName);
						var stb = Altaxo.Serialization.Clipboard.ClipboardSerialization.SerializeToStringBuilder(items);
						result = stb.ToString();
						ItemListWasRendered = true;
					}
					break;

				case Format_ItemReferenceList:
					{
						var itemReferenceList = new List<Altaxo.Main.DocNodeProxy>(ItemList.Select(x => new Altaxo.Main.DocNodeProxy(x)));
						var items = new Altaxo.Main.Commands.ProjectItemCommands.ProjectItemReferenceClipboardList(itemReferenceList, FolderName);
						var stb = Altaxo.Serialization.Clipboard.ClipboardSerialization.SerializeToStringBuilder(items);
						result = stb.ToString();
					}
					break;

				default:
					result = null;
					break;
			}

			return result;
		}