Ejemplo n.º 1
0
        public pics(MindMapTMR CurrentTMR, MindMapTMR OriginalTMR, MultilevelGenerator.MultiLevel ML, int level, List <pics> PicForms, GoogleImageSearchSettings settings, DrawingSizeMode drawSizeMode)
        {
            _level        = level;
            _settings     = settings;
            _DrawSizeMode = drawSizeMode;
            PicForms.Add(this);
            picForms = PicForms;
            InitializeComponent();
            this.CurrentTMR  = CurrentTMR;
            this.OriginalTMR = OriginalTMR;
            this.ML          = ML;
            this.Height      = 700;
            this.Width       = 1000;
            this.Text        = "Mind Map";

            viewer         = new MMViewManeger(this.panel1, this.CurrentTMR, false, settings, _DrawSizeMode);
            viewer.Control = this.panel1;
            int MaximumY = viewer.getMaximumY();
            int MaximumX = viewer.getMaximumX();

            this.panel1.Height = MaximumY + 40;
            this.panel1.Width  = MaximumX + 40;

            this.AutoScroll = true;
        }
Ejemplo n.º 2
0
 public GimSearchSettingsDlg(GoogleImageSearchSettings gImSearchSettings)
 {
     GImSearchSettings = gImSearchSettings;
     InitializeComponent();
     cmb_Colorization.SelectedIndex = cmb_Colorization.Items.IndexOf(gImSearchSettings.Coloriztion.ToString());
     cmbImType.SelectedIndex        = cmbImType.Items.IndexOf(gImSearchSettings.Imtype.ToString());
     cmbImSize.SelectedIndex        = cmbImSize.Items.IndexOf(gImSearchSettings.ImSize.ToString());
 }
        public void LoadConfiguration(string config)
        {
            //fresh config
            _giss = string.IsNullOrEmpty(config) ? new GoogleImageSearchSettings() : GoogleImageSearchSettings.LoadFromXML(config);

            comboBox1.SelectedValue = _giss.Color;
            txtHeight.Text = _giss.ImageHeight.ToString();
            txtWidth.Text = _giss.ImageWidth.ToString();
        }
Ejemplo n.º 4
0
 public MultiLevelMMapForm(Form5 parentForm, MindMapTMR TopTMR, MindMapTMR OriginalTMR, MultilevelGenerator.MultiLevel ML, GoogleImageSearchSettings settings, DrawingSizeMode drawSizeMode)
 {
     InitializeComponent();
     _parentForm   = parentForm;
     _settings     = settings;
     _DrawSizeMode = drawSizeMode;
     _TopTMR       = TopTMR;
     _OriginalTMR  = OriginalTMR;
     _ML           = ML;
 }
Ejemplo n.º 5
0
 public NewGoogleSearch(GoogleImageSearchSettings gImSearchSettings)
 {
     GImSearchSettings = gImSearchSettings;
     gimC = new GimageSearchClient("www.rutgers.edu");
 }
Ejemplo n.º 6
0
        private void SetSafeSearchSetting(GoogleImageSearchSettings.GoogleSafeSearchOptions gsso)
        {
            using (var client = new HttpUtility.CookieAwareWebClient(_cookies))
            {
                //First we need to access the preferences page so we can get the special ID
                var response = client.DownloadString("http://images.google.com/preferences?hl=en");
                //parse out signature
                var specialID = Regex.Match(response, "<input type=\"hidden\" name=\"sig\" value=\"(?<sig>.*?)\">").Groups["sig"].Value;

                //options are "on", "images", "off"
                var safeUIOption = "";
                switch(gsso) {
                    case GoogleImageSearchSettings.GoogleSafeSearchOptions.Off:
                        safeUIOption = "off";
                        break;
                    case GoogleImageSearchSettings.GoogleSafeSearchOptions.On:
                        safeUIOption = "on";
                        break;
                }
                //set prefs
                string url = string.Format("http://images.google.com/setprefs?sig={0}&hl=en&lr=lang_en&uulo=1&muul=4_20&luul=&safeui={1}&suggon=1&newwindow=0&q=",
                                specialID.Replace("=", "%3D"), safeUIOption);

                var finalResponse = client.DownloadString(url);
            }
        }