コード例 #1
0
 private void OnCategoryChanged(object sender, EventArgs e)
 {
     if (catcombo.SelectedIndex == 0)
     {
         filters = Filterz.GetAllFilters();
     }
     else
     {
         filters = Filterz.GetFiltersOfCategory(catcombo.SelectedItem.ToString());
     }
     ShowFoundFilters();
 }
コード例 #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Program.mainform  = this;
            filterz           = new Filterz();
            filterz.MdiParent = this;
            filterz.Show();

            propform           = new PropertiesForm();
            propform.MdiParent = this;
            propform.Show();
            propform.Location = new Point(600, 0);
        }
コード例 #3
0
        private void MatchingFiltersForm_Load(object sender, EventArgs e)
        {
            List <Guid> guids = new List <Guid>();

            try {
                if (pin.Connection != null)
                {
                    AMMediaType mt = new AMMediaType();
                    pin.IPin.ConnectionMediaType(mt);
                    guids.Add(mt.majorType);
                    guids.Add(mt.subType);
                    DsUtils.FreeAMMediaType(mt);
                }
                else
                {
                    IEnumMediaTypes mtenum;
                    if (pin.IPin.EnumMediaTypes(out mtenum) >= 0)
                    {
                        AMMediaType[] mts     = new AMMediaType[1];
                        IntPtr        fetched = Marshal.AllocHGlobal(4);
                        while (mtenum.Next(1, mts, fetched) == 0)
                        {
                            guids.Add(mts[0].majorType);
                            guids.Add(mts[0].subType);
                            DsUtils.FreeAMMediaType(mts[0]);
                        }
                        Marshal.FreeHGlobal(fetched);
                    }
                }
                IFilterMapper2     fm = (IFilterMapper2) new FilterMapper2();
                IEnumMoniker       emon, emon_rend; //non-renderers, renderers
                int                hr     = 0;
                List <FilterProps> fplist = new List <FilterProps>();
                if (pin.Direction == PinDirection.Output)
                {
                    hr = fm.EnumMatchingFilters(out emon, 0, true, Merit.None, true, guids.Count / 2, guids.ToArray(),
                                                null, null, false, false, 0, null, null, null);
                    DsError.ThrowExceptionForHR(hr);
                    hr = fm.EnumMatchingFilters(out emon_rend, 0, true, Merit.None, true, guids.Count / 2, guids.ToArray(),
                                                null, null, true, false, 0, null, null, null);
                    DsError.ThrowExceptionForHR(hr);
                    fplist.AddRange(Filterz.GetFiltersFromEnum(emon, Guid.Empty));
                    fplist.AddRange(Filterz.GetFiltersFromEnum(emon_rend, Guid.Empty));
                }
                else
                {
                    hr = fm.EnumMatchingFilters(out emon, 0, true, Merit.None, false, 0, null, null, null, false,
                                                true, guids.Count / 2, guids.ToArray(), null, null);
                    DsError.ThrowExceptionForHR(hr);
                    hr = fm.EnumMatchingFilters(out emon_rend, 0, true, Merit.None, false, 0, null, null, null, true,
                                                true, guids.Count / 2, guids.ToArray(), null, null);
                    DsError.ThrowExceptionForHR(hr);
                    fplist.AddRange(Filterz.GetFiltersFromEnum(emon, Guid.Empty));
                    fplist.AddRange(Filterz.GetFiltersFromEnum(emon_rend, Guid.Empty));
                }

                //Filterz.BuildFilterTree(emon, treeView, Guid.Empty);
                Filterz.FillFilterTree(treeView, fplist);
            }
            catch (COMException ex)
            {
                Graph.ShowCOMException(ex, "Can't enumerate matching filters");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception caught while enumerating matching filters");
            }
        }
コード例 #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Program.mainform = this;

            propform           = new PropertiesForm();
            propform.MdiParent = this;
            propform.Show();

            filterz           = new Filterz();
            filterz.MdiParent = this;
            filterz.Show();

            Size sz = ClientSize;

            filterz.Location = new Point(0, 0);
            int w = 300, h = (sz.Height - 75) / 2;

            filterz.Size = new Size(w, h);
            //filterz.PerformAutoScale();
            //filterz.PerformLayout();
            propform.Location = new Point(0, h);
            propform.Size     = new Size(w, h);
            //propform.PerformLayout();

            RegistryKey nrk = Registry.CurrentUser.OpenSubKey(keyname);

            if (nrk == null)
            {
                nrk = Registry.CurrentUser.CreateSubKey(keyname);
            }

            email = (string)nrk.GetValue("email", "");
            code  = (string)nrk.GetValue("code", "");

            if (email.Length == 0)
            {   // try reading from old location
                RegistryKey ork = Registry.CurrentUser.OpenSubKey(@"Software\Dee Mon\GraphEditPlus");
                if (ork != null)
                {
                    email = (string)ork.GetValue("email", "");
                    code  = (string)ork.GetValue("code", "");
                }
            }

            int sugg_url = (int)nrk.GetValue("suggestURL", 0);

            suggestURLs = sugg_url > 0;

            int useDirCon = (int)nrk.GetValue("useDirectConnect", 1);

            useDirectConnect = useDirCon > 0;

            createFiltersByName = (int)nrk.GetValue("createFiltersByName", 1) > 0;
            autoArrange         = (int)nrk.GetValue("autoArrange", 0) > 0;

            int maxed = (int)nrk.GetValue("winMaxed", 1);

            if (maxed == 0)
            {
                WindowState = FormWindowState.Normal;
                int left   = (int)nrk.GetValue("winLeft", 0);
                int right  = (int)nrk.GetValue("winRight", 1200);
                int top    = (int)nrk.GetValue("winTop", 0);
                int bottom = (int)nrk.GetValue("winBottom", 720);
                DesktopBounds = new Rectangle(left, top, right - left, bottom - top);
            }

            if (filetoopen == null)
            {
                OnNewGraph(null, null);
            }
            else
            {
                openToolStripMenuItem_Click(null, null);
            }

            LoadFavorites(nrk);
        }
コード例 #5
0
 void ShowFoundFilters()
 {
     Filterz.FillFilterTree(filtertree, SearchFilters(filters));
 }