示例#1
0
        private void _generateGrid(ref int line, GenericDatabase database, TabControl control, DisplayableProperty <TKey, ReadableTuple <TKey> > generalProperties, BaseDb gdb)
        {
            if (gdb.LayoutIndexes != null)
            {
                AbstractProvider metaProvider = AbstractProvider.GetProvider(gdb.LayoutIndexes);

                if (metaProvider is GroupIndexProvider)
                {
                    AbstractProvider gridProvider = AbstractProvider.GetProvider(gdb.GridIndexes);
                    gridProvider.GroupAs = typeof(SpecifiedIndexProvider);
                    bool col = false;

                    foreach (IIndexProvider provider in metaProvider.Providers)
                    {
                        AbstractProvider gridLayout = gridProvider.Next <AbstractProvider>();
                        GTabsMaker.PrintGrid(ref line, (col = !col) ? 0 : 3, 1, 2, provider, gridLayout, generalProperties, gdb.AttributeList);
                        if (col)
                        {
                            line--;
                        }
                    }
                }
                else
                {
                    GTabsMaker.Print(ref line, metaProvider, generalProperties, gdb.AttributeList);
                }
            }
            else
            {
                GTabsMaker.Print(ref line, new SpecifiedRangeIndexProvider(new int[] { 0, gdb.AttributeList.Attributes.Count }), generalProperties, gdb.AttributeList);
            }
        }
示例#2
0
        private void _miSelectInNotepad_Click(object sender, RoutedEventArgs e)
        {
            try {
                TValue item = _listView.SelectedItem as TValue;

                if (item != null)
                {
                    string displayId = item.GetValue <string>(Settings.AttId);
                    string path;

                    if ((path = AllLoaders.DetectPath(Settings.DbData)) != null)
                    {
                        string[] lines = File.ReadAllLines(path);

                        string line = lines.FirstOrDefault(p => p.StartsWith(displayId + ","));

                        if (line == null)
                        {
                            line = lines.FirstOrDefault(p => p.StartsWith(displayId + "\t"));
                        }

                        if (line == null)
                        {
                            line = lines.FirstOrDefault(p => p.Contains("Id: " + displayId));
                        }

                        if (line == null)
                        {
                            line = lines.FirstOrDefault(p => p.StartsWith(displayId));
                        }

                        if (line != null)
                        {
                            GTabsMaker.SelectInNotepadpp(path, (lines.ToList().IndexOf(line) + 1).ToString(CultureInfo.InvariantCulture));
                        }
                    }
                }
            }
            catch (Exception err) {
                ErrorHandler.HandleException(err);
            }
        }
示例#3
0
 public void InitStyle(GDbTabWrapper <TKey, ReadableTuple <TKey> > tab, GTabSettings <TKey, ReadableTuple <TKey> > settings, BaseDb gdb)
 {
     GTabsMaker.SInit(tab, settings, gdb);
 }