Esempio n. 1
0
    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());
    }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
    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;
        }
    }
Esempio n. 6
0
        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...
        }
Esempio n. 7
0
        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;
            }
        }
Esempio n. 8
0
 public void CopyData(CopyType type)
 {
     if (EditCtl != null)
     {
         EditCtl.Copy(type);
     }
 }
Esempio n. 9
0
        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);
            }
        }
Esempio n. 10
0
 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();
             }
         }
     }
 }
Esempio n. 11
0
File: WWiz.cs Progetto: burstas/rmps
 public void CopyAtt(CopyType type)
 {
     if (_LastView != null)
     {
         _LastView.CopyData(type);
     }
 }
Esempio n. 12
0
 public void CopyData(CopyType type)
 {
     if (_TBox != null)
     {
         _TBox.Copy();
     }
 }
Esempio n. 13
0
        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);
        }
Esempio n. 15
0
        public void SetCopyMode(CopyType mode)
        {
            CopyMode.SelectedIndex = (int)mode;

            for (int i = 1; i < Contents.Count; i++)
            {
                ((CopyOffset)Contents[i]).AngleEnabled = mode == CopyType.Interpolate;
            }
        }
Esempio n. 16
0
        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;
        }
Esempio n. 17
0
 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;
 }
Esempio n. 18
0
 /// <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));
     }
 }
Esempio n. 19
0
        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();
            }
        }
Esempio n. 20
0
        public void Copy(CopyType type)
        {
            if (type == CopyType.Data)
            {
                if (!string.IsNullOrEmpty(TbData.Text))
                {
                    Clipboard.SetText(TbData.Text);
                }
                return;
            }

            SafeUtil.Copy(TbData.Text);
        }
Esempio n. 21
0
        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();
        }
Esempio n. 23
0
        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();
        }
Esempio n. 24
0
        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);
        }
Esempio n. 25
0
        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();
            }
        }
Esempio n. 26
0
        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);
        }
Esempio n. 27
0
        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);
        }
Esempio n. 28
0
        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();
        }
Esempio n. 30
0
        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);
        }
Esempio n. 31
0
        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...
        }
Esempio n. 32
0
        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();
            }
        }
Esempio n. 33
0
 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();
         }
     }
 }
Esempio n. 34
0
        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();
            }
        }
Esempio n. 35
0
        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();
            }
        }
Esempio n. 36
0
 public void CopyAtt(CopyType type)
 {
 }
Esempio n. 37
0
File: WPwd.cs Progetto: burstas/rmps
 public void AttCopy(CopyType type)
 {
     if (_PwdView != null)
     {
         _PwdView.CopyAtt(type);
     }
 }
Esempio n. 38
0
        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;
 }
Esempio n. 40
0
        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();

                    }
                }
            }
        }
Esempio n. 41
0
 // Beallitja a CopyLink erteket
 private void SetClipboardType(CopyType Type)
 {
     Settings.Default.CopyLink = (int)Type;
     Settings.Default.Save();
 }
Esempio n. 42
0
 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");
     }
 }
Esempio n. 43
0
 public FileStructureFactory(CopyType copyType)
 {
     CopyHelper = ParseCopyHelper(copyType);
     FormatProvider = ParseFormatProvider(FileType.Music);
 }
Esempio n. 44
0
File: WPro.cs Progetto: burstas/rmps
 public void CopyAtt(CopyType type)
 {
     _CmpLast.Copy(type);
 }
Esempio n. 45
0
 public void OnCopy(CopyType copyType)
 {
     StoreCopiedObject(copyType);
 }
Esempio n. 46
0
 public void OnCopy(CopyType copyType)
 {
     StoreCopiedObject(copyType);
 }
Esempio n. 47
0
 public void Copy(CopyType type)
 {
 }
Esempio n. 48
0
 public void CopyData(CopyType type)
 {
 }