Esempio n. 1
0
        static void MainForm_DragDrop(object sender, DragEventArgs e)
        {
            var validSTLFile = false;
            var validAPFFile = false;

            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            foreach (string file in files)
            {
                DAL.Managers.LoggingManager.WriteToLog("Main Form Manager", "Draw/drop completed", file);

                if (file.ToLower().EndsWith("stl"))
                {
                    validSTLFile = true;
                    DroppedSTLFiles.Add(file);
                }
                else if (file.ToLower().EndsWith("apf"))
                {
                    validAPFFile = true;
                    DroppedProjectFiles.Add(file);
                }
            }

            if (validSTLFile)
            {
                if (!ProcessingDragDrop)
                {
                    DragDropSTLFile?.Invoke();
                }
            }

            if (validAPFFile)
            {
                if (!ProcessingDragDrop)
                {
                    DragDropAPFFile?.Invoke();
                }
            }
        }
Esempio n. 2
0
        public static void ProcesArguments(string[] arguments)
        {
            RegistryManager.GetRegistryProfileSettings();

            if (arguments != null && arguments.Length > 0)
            {
                foreach (var arg in arguments)
                {
                    if (!string.IsNullOrEmpty(arg))
                    {
                        if (arg.ToLower() == "verbose=true" || RegistryManager.RegistryProfile.VerboseMode)
                        {
                            DAL.ApplicationSettings.Settings.VerboseMode = true;
                            DAL.Managers.LoggingManager.Start();
                        }

                        if (arg.ToLower().EndsWith(".apf"))
                        {
                            DroppedProjectFiles.Add(arg);
                            UserProfileManager.UserProfile.AddRecentOpenedFile(new Controls.NewGui.SplashControl.UnlicensedControl.RecentFiles.RecentOpenedFile()
                            {
                                FileName = new FileInfo(arg).Name, FullPath = arg, AccessedDateTime = DateTime.Now
                            });
                            UserProfileManager.Save();
                        }
                        else if (arg.ToLower().EndsWith(".stl") || arg.ToLower().EndsWith(".3mf"))
                        {
                            DroppedSTLFiles.Add(arg);
                            UserProfileManager.UserProfile.AddRecentOpenedFile(new Controls.NewGui.SplashControl.UnlicensedControl.RecentFiles.RecentOpenedFile()
                            {
                                FileName = new FileInfo(arg).Name, FullPath = arg, AccessedDateTime = DateTime.Now
                            });
                            UserProfileManager.Save();
                        }
                    }
                }
            }
        }