示例#1
0
 void Start()
 {
     gameController = GameController.instance;
     boardSelection = GetComponent <BoardSelection>();
     cursorInput    = GetComponent <CursorInput>();
     pathInput      = GetComponent <PathInput>();
 }
        public IActionResult ParseRange(PathInput path)
        {
            // start the parse
            _pdfInfoParser.Parse(path.Path);

            return(RedirectToAction("Index"));
        }
        public IActionResult Parse(PathInput path)
        {
            // start the parse
            _pdfInfoParser.Parse(path?.Path ?? @"/Users/HES8493/Downloads/SeyedamirhosseinHesamian-ShortResume.pdf");

            return(RedirectToAction("Index"));
        }
示例#4
0
 public Form2()
 {
     InitializeComponent();
     saveFileDialog1.FileName = Directory.GetCurrentDirectory() + @"\Resmod00";
     PathInput.Text           = saveFileDialog1.FileName;
     PathInput.Focus();
     SaveFileButton.Visible = false;
 }
        private void Select_Click(object sender, RoutedEventArgs e)
        {
            VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog();

            dialog.SelectedPath = SelectedGccPath;
            dialog.ShowDialog();
            PathInput.Text = dialog.SelectedPath;
            PathInput.GetBindingExpression(TextBox.TextProperty).UpdateSource();
        }
示例#6
0
    /// <summary>
    /// Creates a path component from a start point and end point.
    /// </summary>
    /// <returns>A new path component from the specified start and end points.</returns>
    /// <param name="startInput">The start point of the path component.</param>
    /// <param name="endInput">The end point of the path component.</param>
    private PathComponent CreatePath(PathInput startInput, PathInput endInput)
    {
        Vector3       start  = startInput.position;
        Vector3       end    = endInput.position;
        Vector3       center = (start + end) / 2;
        PathComponent path   = Instantiate(pathPrefab, center, Quaternion.LookRotation(end - start, Vector3.up)) as PathComponent;

        path.SetPath(start, end);
        path.transform.Rotate(new Vector3(0, -90, 0));
        Vector3 tempScale = path.transform.localScale;

        tempScale.x *= Vector3.Magnitude(end - start);
        path.transform.localScale = tempScale;
        return(path);
    }
        private void UpdateText()
        {
            if (NowStep == 0)
            {
                UcTitle.MainText    = "我们需要您提供一些路径";
                UcTitle.SubText     = "请选择MinGW编译器安装位置";
                UcTitle.Description = "MinGW编译器是将源代码(.c 或 .cpp)文件\n编译为可执行(.exe)文件的工具。";
                PrevButton.Content  = "取消";

                PathInput.SetBinding(TextBox.TextProperty, "SelectedGccPath");
            }
            else
            {
                UcTitle.MainText    = "还需要选择最后一个路径";
                UcTitle.SubText     = "请选择 VScode 项目文件夹位置";
                UcTitle.Description = "项目文件夹是存放源代码(.c 或 .cpp)的位置\n您今后需要调试的代码都需要存放在此文件夹内";
                PrevButton.Content  = "上一步";
                PathInput.SetBinding(TextBox.TextProperty, "SelectedProjectPath");
            }
        }
示例#8
0
        private void SelectPath_Click(object sender, RoutedEventArgs e)
        {
            var Save = new Microsoft.Win32.SaveFileDialog()
            {
                Filter = "Project files (*.sm3p)|*.sm3p"
                         // InitialDirectory = Directory.GetCurrentDirectory ()
            };

            if (Save.ShowDialog(Window.GetWindow(this)) ?? false)
            {
                string savePath = Save.FileName;
                PathInput.Text = savePath;
                PathInput.ScrollToEnd();
                if (RomFileInput.Text.Length == 0)
                {
                    string filename = Tools.FilenameFromPath(savePath);
                    Tools.TrimFileExtension(ref filename, out string extension);
                    RomFileInput.Text = filename + ".sfc";
                }
            }
        }
示例#9
0
 public TextAnalysisViewModel()
 {
     _pathInput = new PathInput {
         LicensePath = Strings.Label_LicensePath, DataPath = Strings.Label_DataPath
     };
     _input = new Input {
         InputText = Strings.Label_InputText_SampleString
     };
     _themes        = new Themes();
     _summary       = new Summary();
     _namedEntities = new NamedEntities();
     _import        = new Import();
     _textToAnalyse = InputText;
     try
     {
         Engine = new Salience(PathInput.LicensePath, PathInput.DataPath);
     }
     catch (SalienceException e)
     {
         //not sure how to handle this yet
     }
 }
示例#10
0
    void Update()
    {
        GameObject mn = GameObject.Find("Manager");
        PathInput  pi = mn.GetComponent <PathInput>();

        folder = pi.path;
        Debug.Log(folder);
        // check keyboard 'k' for one time screenshot capture and holding down 'v' for continious screenshots
        captureScreenshot |= Input.GetKeyDown(KeyCode.Return);
        captureVideo       = Input.GetKey("p");

        if (captureScreenshot || captureVideo)
        {
            captureScreenshot = false;

            // hide optional game object if set
            if (hideGameObject != null)
            {
                hideGameObject.SetActive(false);
            }

            // create screenshot objects if needed
            if (renderTexture == null)
            {
                // creates off-screen render texture that can rendered into
                rect          = new Rect(0, 0, captureWidth, captureHeight);
                renderTexture = new RenderTexture(captureWidth, captureHeight, 24);
                screenShot    = new Texture2D(captureWidth, captureHeight, TextureFormat.RGB24, false);
            }

            // get main camera and manually render scene into rt
            Camera camera = this.GetComponent <Camera>(); // NOTE: added because there was no reference to camera in original script; must add this script to Camera
            camera.targetTexture = renderTexture;
            camera.Render();

            // read pixels will read from the currently active render texture so make our offscreen
            // render texture active and then read the pixels
            RenderTexture.active = renderTexture;
            screenShot.ReadPixels(rect, 0, 0);

            // reset active camera texture and render texture
            camera.targetTexture = null;
            RenderTexture.active = null;

            // get our unique filename
            string filename = uniqueFilename((int)rect.width, (int)rect.height);

            // pull in our file header/data bytes for the specified image format (has to be done from main thread)
            byte[] fileHeader = null;
            byte[] fileData   = null;
            if (format == Format.RAW)
            {
                fileData = screenShot.GetRawTextureData();
            }
            else if (format == Format.PNG)
            {
                fileData = screenShot.EncodeToPNG();
            }
            else if (format == Format.JPG)
            {
                fileData = screenShot.EncodeToJPG();
            }
            else // ppm
            {
                // create a file header for ppm formatted file
                string headerStr = string.Format("P6\n{0} {1}\n255\n", rect.width, rect.height);
                fileHeader = System.Text.Encoding.ASCII.GetBytes(headerStr);
                fileData   = screenShot.GetRawTextureData();
            }

            // create new thread to save the image to file (only operation that can be done in background)
            new System.Threading.Thread(() =>
            {
                // create file and write optional header with image bytes
                var f = System.IO.File.Create(filename);
                if (fileHeader != null)
                {
                    f.Write(fileHeader, 0, fileHeader.Length);
                }
                f.Write(fileData, 0, fileData.Length);
                f.Close();
                Debug.Log(string.Format("Wrote screenshot {0} of size {1}", filename, fileData.Length));
            }).Start();

            // unhide optional game object if set
            if (hideGameObject != null)
            {
                hideGameObject.SetActive(true);
            }

            // cleanup if needed
            if (optimizeForManyScreenshots == false)
            {
                Destroy(renderTexture);
                renderTexture = null;
                screenShot    = null;
            }
        }
    }
示例#11
0
 private void Window_ContentRendered(object sender, EventArgs e)
 {
     PathInput.SelectAll();
     PathInput.Focus();
 }
示例#12
0
        static StateElement CreateInputStateElement(PropertyInfo property, Container parent)
        {
            var    attr         = property.GetCustomAttribute <ElementAttribute>(true);
            string description  = attr?.Description;
            var    displayName  = attr?.DisplayName ?? Utils.NameToDisplayName(property.Name);
            var    displayWords = displayName.Split(' ');

            var t = property.PropertyType;

            if (t.IsArray || (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IEnumerable <>)))
            {
                var itemType = t.IsArray
                    ? t.GetElementType()
                    : t.GetGenericArguments().Single();

                return(new TableView(itemType, parent, property, property.Name)
                {
                    DisplayName = displayName,
                    Description = description,
                    Attribute = attr
                });
            }

            if (t == typeof(bool) && t.IsPublic)
            {
                return(new CheckBox(parent, property, property.Name)
                {
                    DisplayName = displayName,
                    Description = description,
                    Attribute = attr,
                });
            }

            if (t.IsEnum)
            {
                return(new EnumInput(parent, property, property.Name)
                {
                    DisplayName = displayName,
                    Description = description,
                    Attribute = attr,
                });
            }

            // TODO: Add intermediate state support

            var rangeAttrib = t.GetCustomAttribute <RangeAttribute>(true);

            if (t.IsNumeric() && (
                    rangeAttrib != null ||
                    displayWords.Contains("Range")))
            {
                double min = rangeAttrib?.Min ?? 0;
                double max = rangeAttrib?.Max ??
                             (t == typeof(int) ? 100 :
                              t == typeof(double) ? 1 :
                              t == typeof(float) ? 1 : 10);

                return(new SlideInput(min, max, parent, property, property.Name)
                {
                    DisplayName = displayName,
                    Description = description,
                    Attribute = attr,
                });
            }

            if (attr?.GetType() == typeof(DateInputAttribute) ||
                (t == typeof(DateTime) && property.SetMethod.IsPublic))
            {
                return(new DateInput(parent, property, property.Name)
                {
                    DisplayName = displayName,
                    Description = description,
                    Attribute = attr,
                });
            }

            if (attr?.GetType() == typeof(PathAttribute) ||
                (t == typeof(string) && displayWords.Contains("Path") && property.SetMethod.IsPublic))
            {
                if (!property.SetMethod.IsPublic)
                {
                    throw new NotSupportedException("The setter of a Path property has to be public.");
                }

                ElementAttribute elAttr = null;
                var pa       = attr as PathAttribute;
                var pathType = PathType.Open;
                if ((pa == null || pa.Type != PathType.Open) && displayWords.Contains("Save"))
                {
                    pathType = PathType.Save;
                }
                else if (pa != null)
                {
                    pathType = pa.Type;
                }

                if (displayWords.Length > 1)
                {
                    displayName = string.Join(" ", displayWords.Where(x => x != "Path"));
                }

                var pathInput = new PathInput(parent, property, property.Name, pathType)
                {
                    DisplayName = displayName,
                    Description = description
                };

                pathInput.Attribute = attr as ElementAttribute;

                return(pathInput);
            }

            if (attr?.GetType() == typeof(PasswordAttribute) ||
                (t == typeof(string) && displayWords.Contains("Password") && property.SetMethod.IsPublic))
            {
                return(new PasswordInput(parent, property, property.Name)
                {
                    DisplayName = displayName,
                    Description = description,
                    Attribute = attr,
                });
            }

            return((StateElement) new TextInput(parent, property, property.Name)
            {
                DisplayName = displayName,
                Description = description,
                Attribute = attr,
            });
        }