private void EnalbleCopy(CopyType type) { scrollBar.scrollValue = 0; switch (type) { case CopyType.ACTIVITY: title.spriteName = "选择活动"; title.MakePixelPerfect(); activeBtn.SetActive(false); GridActivity.SetActive(true); GridNormal.SetActive(false); break; case CopyType.NORMAL: title.spriteName = "选择副本"; title.MakePixelPerfect(); activeBtn.SetActive(true); GridNormal.SetActive(true); GridActivity.SetActive(false); break; default: break; } curActive = type; StartCoroutine(SetScrollValue()); }
public string GetDestPath(CopyItem ci, CopyType ct) { string path = ""; string dir = ""; if (!String.IsNullOrEmpty(ci.ToDir)) { path = ci.ToDir; dir = ci.ToDir; } else if (!String.IsNullOrEmpty(ci.ToFile)) { path = ci.ToFile; dir = Path.GetDirectoryName(path); } Utils.Exec("mkdir", String.Format("-p {0}/{1}", wipDir, dir)); string dstDir = String.Format("{0}/{1}", wipDir, path); string dstPath = dstDir; if (ct.Equals(CopyType.Http)) { dstPath = String.Format("-o {0}", dstDir); } return(dstPath); }
private void Copy(string source, string dest, CopyType copyType) { string[] paths = null; WaitCallback work; if (copyType == CopyType.Directory) { paths = Directory.GetDirectories(source, "*", SearchOption.AllDirectories); work = CreateDir; } else { paths = Directory.GetFiles(source, "*", SearchOption.AllDirectories); work = CopyFile; } count = paths.Length; Tuple <string, string> couple; foreach (var path in paths) { couple = new Tuple <string, string>(path, path.Replace(source, dest)); ThreadPool.QueueUserWorkItem(work, couple); } }
public void Start() { text = GetComponent <Text>(); if (transform.parent.GetComponent <OmniReceiver>() != null) { type = CopyType.OMNIRECEIVER; copyFrom = transform.parent.GetComponent <OmniReceiver>(); } else if (transform.parent.GetComponent <Transmitter>() != null) { type = CopyType.TRANSMITTER; copyFrom = transform.parent.GetComponent <Transmitter>(); } else if (transform.parent.GetComponent <Receiver>() != null) { type = CopyType.RECEIVER; copyFrom = transform.parent.GetComponent <Receiver>(); } else if (transform.parent.GetComponent <Wire>() != null) { type = CopyType.WIRE; copyFrom = transform.parent.GetComponent <Wire>(); } Update(); }
static void CopyFile(string sourceFileName, string destFileName, CopyType copyType, string typeFile = "") { Console.WriteLine($"{typeFile}cp: {copyType} - {sourceFileName} -> {destFileName}"); switch (copyType) { case CopyType.Always: File.Copy(sourceFileName, destFileName, true); break; case CopyType.IfNewer: if (!File.Exists(destFileName)) { File.Copy(sourceFileName, destFileName); } else { var srcInfo = new FileInfo(sourceFileName); var dstInfo = new FileInfo(destFileName); if (srcInfo.LastWriteTime.Ticks > dstInfo.LastWriteTime.Ticks || srcInfo.Length > dstInfo.Length) { File.Copy(sourceFileName, destFileName, true); } else { Console.WriteLine($" skipping: {sourceFileName}"); } } break; default: File.Copy(sourceFileName, destFileName); break; } }
public static void OnCut(CopyType copyType) { StoreCopiedObject(copyType); ElementSave sourceElement = SelectedState.Self.SelectedElement; if (mCopiedInstances.Any()) { foreach (var clone in mCopiedInstances) { // copied instances is a clone, so need to find by name: var originalForCopy = sourceElement.Instances.FirstOrDefault(item => item.Name == clone.Name); if (sourceElement.Instances.Contains(originalForCopy)) { ElementCommands.Self.RemoveInstance(originalForCopy, sourceElement); } } if (ProjectManager.Self.GeneralSettingsFile.AutoSave) { ProjectManager.Self.SaveElement(sourceElement); } WireframeObjectManager.Self.RefreshAll(true); PropertyGridManager.Self.RefreshUI(); GumCommands.Self.GuiCommands.RefreshElementTreeView(); } // todo: need to handle cut Element saves, but I don't want to do it yet due to the danger of losing valid data... }
void CopyMode_Changed(object sender, SelectionChangedEventArgs e) { CopyType selected = (CopyType)CopyMode.SelectedIndex; if (_copy.CopyMode != selected) { CopyType u = _copy.CopyMode; CopyType r = selected; List <int> path = Track.GetPath(_copy); Program.Project.Undo.Add($"Copy Mode Changed to {((ComboBoxItem)CopyMode.ItemContainerGenerator.ContainerFromIndex((int)r)).Content}", () => { Track.TraversePath <Copy>(path).CopyMode = u; }, () => { Track.TraversePath <Copy>(path).CopyMode = r; }); _copy.CopyMode = selected; } Rate.Enabled = Gate.Enabled = selected != CopyType.Static && selected != CopyType.RandomSingle; Pinch.Enabled = Reverse.IsEnabled = Infinite.IsEnabled = selected == CopyType.Animate || selected == CopyType.Interpolate; for (int i = 1; i < Contents.Count; i++) { ((CopyOffset)Contents[i]).AngleEnabled = selected == CopyType.Interpolate; } }
public void CopyData(CopyType type) { if (EditCtl != null) { EditCtl.Copy(type); } }
public void Copy(CopyType type) { if (type == CopyType.Data) { Clipboard.SetText(DtData.Text); return; } if (type == CopyType.Name) { if (!string.IsNullOrEmpty(TbText.Text)) { Clipboard.SetText(TbText.Text); } return; } if (_Ctl == null) { return; } if (!string.IsNullOrEmpty(_Ctl.SelectedText)) { _Ctl.Copy(); return; } if (!string.IsNullOrEmpty(_Ctl.Text)) { Clipboard.SetText(_Ctl.Text); } }
public void OnPaste(CopyType copyType) { // To make sure we didn't copy one type and paste another if (mCopyType == copyType) { if (mCopyType == CopyType.Instance) { // We need to both duplicate the InstanceSave, but we also need to duplicate all of the variables // that use the copied InstanceSave. if (mCopiedInstances.Count == 0) { // do nothing } else { PasteCopiedInstanceSave(); } } else if (mCopyType == CopyType.State) { if (mCopiedState != null) { PastedCopiedState(); } } } }
public void CopyAtt(CopyType type) { if (_LastView != null) { _LastView.CopyData(type); } }
public void CopyData(CopyType type) { if (_TBox != null) { _TBox.Copy(); } }
public void Copy(CopyType type) { if (type == CopyType.Data) { if (!string.IsNullOrEmpty(TbData.Text)) { Clipboard.SetText(TbData.Text); } return; } if (type == CopyType.Name) { return; } if (!string.IsNullOrEmpty(TbData.SelectedText)) { TbData.Copy(); return; } if (!string.IsNullOrEmpty(TbData.Text)) { Clipboard.SetText(TbData.Text); } }
public Dog GetCopy(Dog other, CopyType isDeepCopy) { Dog clone = isDeepCopy == CopyType.DeepCopy ? DeepCopy(other) : ShallowCopy(other); Console.WriteLine(isDeepCopy + " copy sucessful"); return(clone); }
public void SetCopyMode(CopyType mode) { CopyMode.SelectedIndex = (int)mode; for (int i = 1; i < Contents.Count; i++) { ((CopyOffset)Contents[i]).AngleEnabled = mode == CopyType.Interpolate; } }
public BranchTagTree(IDataElement iRootElement, CopyType eType, string sRootProject, string sURLVersionPath) { m_iRootElement = iRootElement; m_eType = eType; m_sRootProject = sRootProject; m_sURLVersionPath = sURLVersionPath; m_bIgnoreExistingTargets = false; }
public Mp3Writer(IFormatterSettings settings, IAlbumFormatter formatter) { if (!Directory.Exists(settings.OutputDirectoryPath)) { Directory.CreateDirectory(settings.OutputDirectoryPath); } _outFolder = new DirectoryInfo(settings.OutputDirectoryPath); _copyType = settings.CopyOrMove; _fixTag = settings.FixTags; _formatter = formatter; }
/// <summary> /// Копирование точек фигур /// </summary> /// <param name="originalFigure">Оригинальная фигура</param> /// <param name="copyFigure">Новая фигура</param> /// <param name="copyType">Тип копирования</param> private static void CopyPoints(BaseFigure originalFigure, BaseFigure copyFigure, CopyType copyType) { foreach (var point in originalFigure.Points.GetPoints()) { copyFigure.Points.AddPoint(copyType == CopyType.CopyWithOffset ? new PointF(point.X + 15, point.Y) : new PointF(point.X, point.Y)); } }
public void SetCopyMode(CopyType mode) { CopyMode.SelectedIndex = (int)mode; Rate.Enabled = Gate.Enabled = mode.SupportsRate(); Pinch.Enabled = Reverse.IsEnabled = Infinite.IsEnabled = mode.SupportsPinch(); for (int i = 1; i < Contents.Count; i++) { ((CopyOffset)Contents[i]).AngleEnabled = mode.SupportsAngle(); } }
public void Copy(CopyType type) { if (type == CopyType.Data) { if (!string.IsNullOrEmpty(TbData.Text)) { Clipboard.SetText(TbData.Text); } return; } SafeUtil.Copy(TbData.Text); }
void CopyMode_Changed(object sender, SelectionChangedEventArgs e) { CopyType selected = (CopyType)CopyMode.SelectedIndex; if (_copy.CopyMode != selected) { Program.Project.Undo.AddAndExecute(new Copy.CopyModeUndoEntry( _copy, _copy.CopyMode, selected, CopyMode.Items )); } }
public frmCopy(Item item, string path = "", CopyType copyType = CopyType.Copy) { InitializeComponent(); checkedListBox1.Items.Clear(); this.copyType = copyType; sourceItems.Add(item); targetDirectory = path; textBox1.Text = targetDirectory; AddItemsToList(); LanguageChange(); }
public CopyProcess(List <Item> items, string path, CopyType type) { InitializeComponent(); srcItems = items; strdstPath = path; copyType = type; foreach (Item i in srcItems) { if (i.GetType() == typeof(MyFile)) { filesCount += 1; filesSize += long.Parse(i.StrSize); txtTotalSize.Text = getShortenSize(filesSize); itemstoCopy.Add((MyFile)i); strCopyTo.Add(strdstPath + i.StrName + i.StrExt); ListViewItem temp = new ListViewItem(i.strParentPath + i.StrName + i.StrExt); temp.SubItems.Add(strdstPath + i.StrName + i.StrExt); temp.SubItems.Add((long.Parse(i.StrSize).ToString("n0"))); listView1.Items.Add(temp); } else { DirectoryInfo di = new DirectoryInfo(i.strParentPath + i.StrName + "\\"); itemstoCopy.Add((Folder)i); strCopyTo.Add(strdstPath + i.StrName + "\\"); ListViewItem temp = new ListViewItem(i.strParentPath + i.StrName + i.StrExt); temp.SubItems.Add(strdstPath + i.StrName + "\\"); temp.SubItems.Add("<DIR>"); listView1.Items.Add(temp); TraversalTree(di, strdstPath + i.StrName + "\\"); } } wc.DownloadProgressChanged += DownloadProgress; wc.DownloadFileCompleted += DownloadComplete; LanguageChanged(); DoCopy(); }
public void GetCpCommandTest(string from, CopyType expType, string expArgs) { var cp = new UtilCopier(); cp.SetCopyArg(copyArgs); cp.SetCopyCmd(copyCmds); cp.SetWipDir(""); var ci = new CopyItem(); ci.From = from; (CopyType type, string cmd, string args) = cp.GetCpCommand(ci); Assert.AreEqual(expType, type); Assert.AreEqual(expArgs, args); }
private void StoreCopiedObject(CopyType copyType) { mCopyType = copyType; mCopiedInstances.Clear(); mCopiedState.Variables.Clear(); mCopiedState.VariableLists.Clear(); if (copyType == CopyType.Instance) { StoreCopiedInstances(); } else if (copyType == CopyType.State) { StoreCopiedState(); } }
public void GetDestPathTest(string toFile, string toDir, CopyType type, string expValue) { string tmpPath = Path.GetTempPath(); var cp = new UtilCopier(); cp.SetCopyArg(copyArgs); cp.SetCopyCmd(copyCmds); cp.SetWipDir(tmpPath); var ci = new CopyItem(); ci.ToFile = toFile; ci.ToDir = toDir; var dstPath = cp.GetDestPath(ci, type); var expPath = String.Format(expValue, tmpPath); Assert.AreEqual(expPath, dstPath); }
public static string ToFriendlyString(this CopyType copyType) { string r = ""; switch (copyType) { case CopyType.Copy: r = "복사"; break; case CopyType.Move: r = "이동"; break; default: r = "복사"; break; } return(r); }
void CopyMode_Changed(object sender, SelectionChangedEventArgs e) { CopyType selected = (CopyType)CopyMode.SelectedIndex; if (_copy.CopyMode != selected) { CopyType u = _copy.CopyMode; CopyType r = selected; List <int> path = Track.GetPath(_copy); Program.Project.Undo.Add($"Copy Mode Changed to {((ComboBoxItem)CopyMode.ItemContainerGenerator.ContainerFromIndex((int)r)).Content}", () => { ((Copy)Track.TraversePath(path)).CopyMode = u; }, () => { ((Copy)Track.TraversePath(path)).CopyMode = r; }); _copy.CopyMode = selected; } Rate.Enabled = Gate.Enabled = selected != CopyType.Static && selected != CopyType.RandomSingle; }
public frmCopy(List <Item> items, string path = "", CopyType copyType = CopyType.Copy) { InitializeComponent(); checkedListBox1.Items.Clear(); this.copyType = copyType; if (items.Count == 0) { MessageBox.Show("No file selected"); Close(); } sourceItems = items; targetDirectory = path; textBox1.Text = targetDirectory; AddItemsToList(); LanguageChange(); }
public (CopyType type, string cmd, string args) GetCpCommand(CopyItem ci) { string args = copyArgs[CopyType.Cp]; string cpCmd = copyCmds[CopyType.Cp]; CopyType type = CopyType.Cp; if (httpRegex.IsMatch(ci.From)) { cpCmd = copyCmds[CopyType.Http]; args = copyArgs[CopyType.Http]; type = CopyType.Http; } else if (gsutilRegex.IsMatch(ci.From)) { cpCmd = copyCmds[CopyType.GsUtilCp]; args = copyArgs[CopyType.GsUtilCp]; type = CopyType.GsUtilCp; } return(type, cpCmd, args); }
public void OnCut(CopyType copyType) { StoreCopiedObject(copyType); ElementSave sourceElement = SelectedState.Self.SelectedElement; InstanceSave sourceInstance = SelectedState.Self.SelectedInstance; if (sourceElement.Instances.Contains(sourceInstance)) { ElementCommands.Self.RemoveInstance(sourceInstance, sourceElement); if (ProjectManager.Self.GeneralSettingsFile.AutoSave) { ProjectManager.Self.SaveElement(sourceElement); } WireframeObjectManager.Self.RefreshAll(true); PropertyGridManager.Self.RefreshUI(); GumCommands.Self.GuiCommands.RefreshElementTreeView(); } // todo: need to handle cut Element saves, but I don't want to do it yet due to the danger of losing valid data... }
public void OnCut(CopyType copyType) { StoreCopiedObject(copyType); ElementSave sourceElement = SelectedState.Self.SelectedElement; InstanceSave sourceInstance = SelectedState.Self.SelectedInstance; if (sourceElement.Instances.Contains(sourceInstance)) { // Not sure why we weren't just using // ElementCommands here - maybe an oversight? // This should improve things like //sourceElement.Instances.Remove(sourceInstance); ElementCommands.Self.RemoveInstance(sourceInstance, sourceElement); if (ProjectManager.Self.GeneralSettingsFile.AutoSave) { ProjectManager.Self.SaveElement(sourceElement); } WireframeObjectManager.Self.RefreshAll(true); PropertyGridManager.Self.RefreshUI(); GumCommands.Self.GuiCommands.RefreshElementTreeView(); } }
public static void OnPaste(CopyType copyType) { // To make sure we didn't copy one type and paste another if (mCopyType == copyType) { if (mCopyType == CopyType.InstanceOrElement) { if (mCopiedElement != null) { PasteCopiedElement(); } // We need to both duplicate the InstanceSave, but we also need to duplicate all of the variables // that use the copied InstanceSave. else if (mCopiedInstances.Count != 0) { PasteCopiedInstanceSaves(); } } else if (mCopyType == CopyType.State && mCopiedState != null) { PastedCopiedState(); } } }
private void StoreCopiedObject(CopyType copyType) { mCopyType = copyType; mCopiedElement = null; mCopiedInstances.Clear(); mCopiedState.Variables.Clear(); mCopiedState.VariableLists.Clear(); if (copyType == CopyType.InstanceOrElement) { if (ProjectState.Self.Selected.SelectedInstances.Count() != 0) { StoreCopiedInstances(); } else if (ProjectState.Self.Selected.SelectedElement != null) { StoreCopiedElementSave(); } } else if (copyType == CopyType.State) { StoreCopiedState(); } }
public void CopyAtt(CopyType type) { }
public void AttCopy(CopyType type) { if (_PwdView != null) { _PwdView.CopyAtt(type); } }
public void OnCut(CopyType copyType) { StoreCopiedObject(copyType); ElementSave sourceElement = SelectedState.Self.SelectedElement; InstanceSave sourceInstance = SelectedState.Self.SelectedInstance; if (sourceElement.Instances.Contains(sourceInstance)) { // Not sure why we weren't just using // ElementCommands here - maybe an oversight? // This should improve things like //sourceElement.Instances.Remove(sourceInstance); ElementCommands.Self.RemoveInstance(sourceInstance, sourceElement); if( ProjectManager.Self.GeneralSettingsFile.AutoSave) { ProjectManager.Self.SaveElement(sourceElement); } WireframeObjectManager.Self.RefreshAll(true); PropertyGridManager.Self.RefreshUI(); GumCommands.Self.GuiCommands.RefreshElementTreeView(); } }
public CopyField(List<string> datas, CopyType type) { this.datas = datas; this.type = type; }
// Beallitja a CopyLink erteket private void SetClipboardType(CopyType Type) { Settings.Default.CopyLink = (int)Type; Settings.Default.Save(); }
private CopyHelperBase ParseCopyHelper(CopyType copyType) { switch (copyType) { case CopyType.ZeroCopy: return new ZeroCopy(); case CopyType.MOQCopy: return new MOQCopy(); case CopyType.TrueCopy: return new TrueCopy(); default: throw new Exception("No CopyHelper Provided"); } }
public FileStructureFactory(CopyType copyType) { CopyHelper = ParseCopyHelper(copyType); FormatProvider = ParseFormatProvider(FileType.Music); }
public void CopyAtt(CopyType type) { _CmpLast.Copy(type); }
public void OnCopy(CopyType copyType) { StoreCopiedObject(copyType); }
public void Copy(CopyType type) { }
public void CopyData(CopyType type) { }