public void NamedOptionsConstructors()
        {
            NamedOption namedOptions1 = new NamedOption("Name");

            Assert.AreEqual("Name", namedOptions1.Name);
            Assert.AreEqual(ScreenSize.Width, namedOptions1.Width);
            Assert.AreEqual(ScreenSize.Height, namedOptions1.Height);
            Assert.AreEqual(ScreenSize.TopLeftPoint, namedOptions1.SourcePoint);

            NamedOption namedOptions2 = new NamedOption("Name", new Option(10, 20, new System.Drawing.Point(1, 2)));

            Assert.AreEqual("Name", namedOptions2.Name);
            Assert.AreEqual(10, namedOptions2.Width);
            Assert.AreEqual(20, namedOptions2.Height);
            Assert.AreEqual(new System.Drawing.Point(1, 2), namedOptions2.SourcePoint);

            NamedOption namedOptions3 = new NamedOption("Name", 10, 20, new System.Drawing.Point(1, 2));

            Assert.AreEqual("Name", namedOptions3.Name);
            Assert.AreEqual(10, namedOptions3.Width);
            Assert.AreEqual(20, namedOptions3.Height);
            Assert.AreEqual(new System.Drawing.Point(1, 2), namedOptions3.SourcePoint);

            NamedOption namedOptions4 = new NamedOption();

            Assert.AreEqual("null", namedOptions4.Name);
            Assert.AreEqual(ScreenSize.Width, namedOptions4.Width);
            Assert.AreEqual(ScreenSize.Height, namedOptions4.Height);
            Assert.AreEqual(ScreenSize.TopLeftPoint, namedOptions4.SourcePoint);
        }
Exemple #2
0
        public void SetDefault(NamedOption option)
        {
            GetDefault().IsDefault = false;
            option.IsDefault       = true;

            Save();
        }
Exemple #3
0
        public frmFeed(NamedOption usersOptions, string path)
        {
            InitializeComponent();

            this.UsersOptions = usersOptions;

            FeedWorker = new CaptureWorker(this.UsersOptions, path);
        }
        public NamedOption Create(NamedOption option)
        {
            if (option.IsDefault)
            {
                SetDefault(option);
            }

            Options.Add(option);

            return(option);
        }
        public NamedOption Create(string name, int width, int height, Point sourcePoint, bool isDefault = false)
        {
            var option = new NamedOption(name, width, height, sourcePoint, isDefault);

            if (isDefault)
            {
                SetDefault(option);
            }

            Options.Add(option);

            return(option);
        }
Exemple #6
0
        public frmUserCaptureArea(NamedOption options, bool show)
        {
            InitializeComponent();

            this.MouseDown += new MouseEventHandler(mouse_Click);
            this.MouseUp   += new MouseEventHandler(mouse_Up);
            this.MouseMove += new MouseEventHandler(mouse_Move);
            this.KeyUp     += new KeyEventHandler(key_press);

            this.Location = ScreenSize.TopLeftPoint;

            g = this.CreateGraphics();

            CaptureOptions = options;

            this.show = show;
        }
Exemple #7
0
        public void Okay()
        {
            if (ValidWidth() && ValidHeight())
            {
                if (radFullScreen.Checked)
                {
                    UsersOptions = new NamedOption();
                }
                else
                {
                    UsersOptions = MakeOptions();
                }

                this.DialogResult = DialogResult.OK;
            }
            else
            {
                System.Console.WriteLine("Capture area too large for the screen.");
                this.DialogResult = DialogResult.None;
            }
        }
Exemple #8
0
 public Screenshot(NamedOption options)
 {
     CaptureOptions = options;
 }
Exemple #9
0
 /// <summary>
 /// Makes a new instance of a screenshot.
 /// It will capture an area from (0, 0) to the set width and height.
 /// </summary>
 /// <param name="captureWidth">The width of capture area.</param>
 /// <param name="captureHeight">The height of capture area.</param>
 public Screenshot(int captureWidth, int captureHeight, string name = "")
 {
     CaptureOptions = new NamedOption(name, captureWidth, captureHeight, Point.Empty);
 }
 public NamedOption Update(string name, NamedOption option, string newName = null)
 {
     return(Update(name, option.Width, option.Height, option.SourcePoint, option.IsDefault));
 }
Exemple #11
0
 public NamedOption Create(NamedOption option)
 {
     return(Create(option.Name, option.Width, option.Height, option.SourcePoint, option.IsDefault));
 }
 public void Initialize()
 {
     namedOptions = new NamedOption("Name");
 }
Exemple #13
0
 /// <summary>
 /// Makes a new instance of a Option.Option.Option.Option menu form.
 /// </summary>
 /// <param name="options">The options that are currently doing run.</param>
 public frmOptions(NamedOption options)
 {
     UsersOptions = options;
     InitializeComponent();
 }
Exemple #14
0
 /// <summary>
 /// Gets the capture information from the form and creates, returns a new Option.Option.
 /// </summary>
 /// <returns></returns>
 private NamedOption MakeOptions()
 {
     return(UsersOptions = new NamedOption(txtProfileName.Text, (int)CurrentWidth, (int)CurrentHeight, new Point((int)CurrentX, (int)CurrentY)));
 }