public void OpenExternal() { if (PasteType != null) { PasteType.OpenExternal(); } }
public void Initialize(SerializedProperty property) { targetProperty = property; targetObjects = null; pasteType = PasteType.Normal; Object context = property.serializedObject.targetObject; List <SerializedClipboard> clipboardRaw = PasteBinWindow.GetSerializedClipboards(); for (int i = 0; i < clipboardRaw.Count; i++) { object value = clipboardRaw[i].RootValue.GetClipboardObject(context); if (targetProperty.CanPasteValue(value, false)) { clipboard.Add(clipboardRaw[i]); clipboardValues.Add(value); if (!shouldShowSmartPasteButton) { switch (clipboardRaw[i].RootType) { case SerializedClipboard.IPObjectType.Array: case SerializedClipboard.IPObjectType.AssetReference: case SerializedClipboard.IPObjectType.GenericObject: case SerializedClipboard.IPObjectType.ManagedReference: case SerializedClipboard.IPObjectType.SceneObjectReference: shouldShowSmartPasteButton = true; break; } } } } }
public void Initialize(Object[] objects, PasteType pasteType) { targetProperty = null; targetObjects = objects; this.pasteType = pasteType; List <SerializedClipboard> clipboardRaw = PasteBinWindow.GetSerializedClipboards(); for (int i = 0; i < clipboardRaw.Count; i++) { switch (pasteType) { case PasteType.Normal: if (!clipboardRaw[i].CanPasteToObject(objects[0])) { continue; } shouldShowSmartPasteButton = true; break; case PasteType.ComponentAsNew: if (!clipboardRaw[i].CanPasteAsNewComponent((Component)objects[0])) { continue; } shouldShowSmartPasteButton = true; break; case PasteType.CompleteGameObject: if (!clipboardRaw[i].CanPasteCompleteGameObject((GameObject)objects[0])) { continue; } break; case PasteType.AssetFiles: if (!clipboardRaw[i].CanPasteAssetFiles(objects)) { continue; } break; } clipboard.Add(clipboardRaw[i]); clipboardValues.Add(clipboardRaw[i].RootValue.GetClipboardObject(null)); } }
public Paste CreatePaste(string title, string description, PasteType type, int languageId, string createdById) { var newPaste = new Paste { Title = title, Description = description, Type = type, LanguageId = languageId, CreatedOn = DateTime.UtcNow, CreatedById = createdById }; this.pastes.Add(newPaste); this.pastes.SaveChanges(); return newPaste; }
private void rdPlainText_Click(object sender, System.EventArgs e) { this.pictureBox1.Image = ResourceHelper.LoadAssemblyResourceBitmap("Images.PlainTextSample.png"); _chosenFormatting = PasteType.Standard; }
private void rdFormatted_Click(object sender, System.EventArgs e) { this.pictureBox1.Image = ResourceHelper.LoadAssemblyResourceBitmap("Images.KeepFormattingSample.png"); _chosenFormatting = PasteType.KeepFormatting; }
/// <summary> /// 貼り付けタイプとパス情報を指定して PathPasteContext クラスの新しいインスタンスを初期化します。 /// </summary> /// <param name="type">貼り付けタイプ</param> /// <param name="values">貼り付けるパス情報</param> internal PathPasteContext(PasteType type, PathInfo[] values) { this.Type = type; this.Values = values; }
public virtual KindEditorBuilder PasteType(PasteType pasteType) { base.Component._PasteType = pasteType; return(this); }
/// <summary> /// Creates a request to copy the cells in source range and paste them into the destination range. /// <para></para> /// THROWS: ArgumentOutOfRangeException /// </summary> /// <param name="source">The cells to be copied</param> /// <param name="destination">The cell to be pasted over</param> /// <param name="pasteType">Specifies how the paste should be handled</param> /// <returns></returns> private static Request requestCopyPaste(GridRange source, GridRange destination, PasteType pasteType = PasteType.Normal) { if (pasteType >= PasteType.Count) { throw new ArgumentOutOfRangeException("pasteType", m_errorInvalidPasteType); } // change =NOW() to a literal value represeting the current time CopyPasteRequest copyPasteRequest = new CopyPasteRequest(); copyPasteRequest.Source = source; copyPasteRequest.Destination = destination; copyPasteRequest.PasteType = m_pasteTypes[(int)pasteType]; Request request = new Request(); request.CopyPaste = copyPasteRequest; return(request); }