Esempio n. 1
0
        object ICloneable.Clone()
        {
            LogicalSystem ls = (LogicalSystem)MemberwiseClone();

            ls.Mask = new List <string>(ls.Mask.ToArray());

            return(ls);
        }
Esempio n. 2
0
        public static List<LogicalSystem> GetDefaultLogicalSystem()
        {
            List<LogicalSystem> list = new List<LogicalSystem>();

            LogicalSystem images = new LogicalSystem();
            images.Display = "Images";
            images.Description = "Images";
            images.Mask = new List<string>();
            images.Mask.Add(".jpg");
            images.Mask.Add(".png");
            list.Add(images);

            LogicalSystem source = new LogicalSystem();
            source.Display = "Source codes";
            source.Description = "Source codes";
            source.Mask = new List<string>();
            source.Mask.Add(".ms");
            source.Mask.Add(".mso");
            list.Add(source);

            LogicalSystem font = new LogicalSystem();
            font.Display = "Fonts";
            font.Description = "Fonts";
            font.Mask = new List<string>();
            font.Mask.Add(".ttf");
            list.Add(font);

            LogicalSystem database = new LogicalSystem();
            database.Display = "Databases";
            database.Description = "Databases";
            database.Mask = new List<string>();
            database.Mask.Add(".db");
            database.Mask.Add(".tab");
            database.Mask.Add(".cvs");
            list.Add(database);

            LogicalSystem text = new LogicalSystem();
            text.Display = "Texts";
            text.Description = "Texts";
            text.Mask = new List<string>();
            text.Mask.Add(".txt");
            text.Mask.Add(".cvs");
            list.Add(text);

            LogicalSystem hypertext = new LogicalSystem();
            hypertext.Display = "Hypertexts";
            hypertext.Description = "Hypertexts";
            hypertext.Mask = new List<string>();
            hypertext.Mask.Add(".xml");
            hypertext.Mask.Add(".htm");
            hypertext.Mask.Add(".html");
            list.Add(hypertext);

            return list;
        }
Esempio n. 3
0
        protected virtual void OnBtnAddFilterClicked(object sender, System.EventArgs e)
        {
            EntryDialog ed = new EntryDialog("",MainClass.Languages.Translate("new_filter"),parentWindow);
            int result = ed.Run();
            if (result == (int)ResponseType.Ok){
                string newStr = ed.TextEntry;
                if (!String.IsNullOrEmpty(newStr) ){

                    LogicalSystem cdFind = conditions.Find(x=>x.Display.ToUpper() ==newStr.ToUpper());
                    if (cdFind != null){

                        MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("filter_is_exist", cdFind.Display), "", Gtk.MessageType.Error,parentWindow);
                        md.ShowDialog();
                        ed.Destroy();
                        return;
                    }

                    LogicalSystem cd= new LogicalSystem();
                    cd.Display =newStr;
                    filterStore.AppendValues(cd.Display,cd);
                    conditions.Add(cd);
                }
            }
            ed.Destroy();
        }
Esempio n. 4
0
        static public List <LogicalSystem> GetDefaultLogicalSystem()
        {
            List <LogicalSystem> list = new List <LogicalSystem>();

            LogicalSystem images = new LogicalSystem();

            images.Display     = "Images";
            images.Description = "Images";
            images.Mask        = new List <string>();
            images.Mask.Add(".jpg");
            images.Mask.Add(".png");
            list.Add(images);

            LogicalSystem source = new LogicalSystem();

            source.Display     = "Source codes";
            source.Description = "Source codes";
            source.Mask        = new List <string>();
            source.Mask.Add(".ms");
            source.Mask.Add(".mso");
            list.Add(source);

            LogicalSystem font = new LogicalSystem();

            font.Display     = "Fonts";
            font.Description = "Fonts";
            font.Mask        = new List <string>();
            font.Mask.Add(".ttf");
            list.Add(font);

            LogicalSystem database = new LogicalSystem();

            database.Display     = "Databases";
            database.Description = "Databases";
            database.Mask        = new List <string>();
            database.Mask.Add(".db");
            database.Mask.Add(".tab");
            database.Mask.Add(".cvs");
            list.Add(database);

            LogicalSystem text = new LogicalSystem();

            text.Display     = "Texts";
            text.Description = "Texts";
            text.Mask        = new List <string>();
            text.Mask.Add(".txt");
            text.Mask.Add(".cvs");
            list.Add(text);

            LogicalSystem hypertext = new LogicalSystem();

            hypertext.Display     = "Hypertexts";
            hypertext.Description = "Hypertexts";
            hypertext.Mask        = new List <string>();
            hypertext.Mask.Add(".xml");
            hypertext.Mask.Add(".htm");
            hypertext.Mask.Add(".html");
            list.Add(hypertext);

            return(list);
        }
Esempio n. 5
0
        void OnComboFilterChanged(object o, EventArgs args)
        {
            ComboBox combo = o as ComboBox;
            if (o == null)
                return;

            TreeIter iter;
            if (combo.GetActiveIter(out iter)) {
                LogicalSystem ls = (LogicalSystem)combo.Model.GetValue(iter, 2);

                if (ls != null) {
                    activetFilter = ls;
                } else {
                    activetFilter = null;
                }
                filter.Refilter();
                treeView.QueueDraw();
            }
        }
Esempio n. 6
0
        // Icon,Show Name, Full Path, TypFile
        public WorkspaceTree()
        {
            treeView = new TreeView();

            treeView.ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
            treeView.KeyReleaseEvent += delegate(object o, KeyReleaseEventArgs args) {
                if(args.Event.Key == Gdk.Key.Delete){
                    MainClass.MainWindow.DeleteFile();
                }
            };

            //treeView.Model = modelStore = store;

            filter = new Gtk.TreeModelFilter(store, null);
            filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
            treeView.Model = filter;

            treeView.HeadersVisible = true;
            //this.ExpandAll();
            treeView.Selection.Mode = Gtk.SelectionMode.Single;
            treeView.RowActivated += OnRowActivate;
            treeView.Selection.Changed+= OnRowSelection;
            treeView.ShowExpanders = true;

            //	TreeViewColumn display_column.PackStart (text_render, true);

            CellRendererPixbuf crp = new CellRendererPixbuf();
            crp.Ypad = 0;
            crp.Yalign = 0;

            Gtk.CellRendererText fileNameRenderer = new Gtk.CellRendererText();
            fileNameRenderer.Ypad =0;

            TreeViewColumn icon_column = new TreeViewColumn();//("Icon", crp, "pixbuf", ICO_ROW);
            icon_column.PackStart (crp, false);
            icon_column.AddAttribute(crp,"pixbuf",ICO_ROW);

            icon_column.PackStart (fileNameRenderer, true);
            icon_column.AddAttribute (fileNameRenderer, "markup", NAME_ROW);

            treeView.AppendColumn(icon_column);

            //treeView.AppendColumn("Icon", crp, "pixbuf", ICO_ROW);

            treeView.AppendColumn("Name", fileNameRenderer, "text", NAME_ROW);
            treeView.Columns[NAME_ROW].Visible = false;

            CellRendererText textRenderer = new CellRendererText();
            textRenderer.Ypad =0;

            treeView.AppendColumn("FullPath", textRenderer, "text", PATH_ROW);
            treeView.Columns[PATH_ROW].Visible = false;
            treeView.HeadersVisible = false;
            treeView.EnableTreeLines = true;
            treeView.HoverExpand = false;
            treeView.HoverSelection = false;

            treeView.Columns[NAME_ROW].SetCellDataFunc(fileNameRenderer, new Gtk.TreeCellDataFunc(RenderFileNme));

            sw.ShadowType = ShadowType.Out;
            sw.Add(treeView);

            this.PackEnd(sw, true, true, 0);

            Toolbar toolbar = new Toolbar ();

            refreshButton = new ToolButton ("refresh.png");//Stock.Home);
            refreshButton.IsImportant = true;
            refreshButton.Label = MainClass.Languages.Translate("menu_refresh");
            refreshButton.BorderWidth = 1;
            refreshButton.Clicked+= delegate {
                MainClass.MainWindow.RefreshProject();
            };
            toolbar.Insert (refreshButton, -1);

            Gtk.Menu menuAdd = new Gtk.Menu ();

            MenuItem mi = new MenuItem (MainClass.Languages.Translate("menu_create_file"));
            mi.Activated += delegate(object sender, EventArgs e) {
                NewAction nw = new NewAction();
                nw.Activate();
            };

            menuAdd.Insert (mi, -1);
            mi = new MenuItem (MainClass.Languages.Translate("menu_create_dir"));
            mi.Activated += delegate(object sender, EventArgs e) {
                NewDirectoryAction nw = new NewDirectoryAction();
                nw.Activate();
            };

            menuAdd.Insert (mi, -1);
            menuAdd.ShowAll ();

            mtbCreate= new MenusToolButton(menuAdd,"file-new.png");
            mtbCreate.IsImportant = true;
            mtbCreate.Label = "Create";
            toolbar.Insert (mtbCreate, -1);

            if(MainClass.Settings.LogicalSort == null)
                MainClass.Settings.LogicalSort = LogicalSystem.GetDefaultLogicalSystem();

            Gtk.Menu menuFilter = new Gtk.Menu ();

            MenuItem menuItemFilter = new MenuItem (MainClass.Languages.Translate("all_files") );
            menuItemFilter.Activated += delegate(object sender, EventArgs e) {
                activetFilter = null;
                filter.Refilter();
                treeView.QueueDraw();
            };
            menuFilter.Insert (menuItemFilter, -1);

            foreach (LogicalSystem ls in MainClass.Settings.LogicalSort){
                LogicalSystem lsTemp = ls;
                menuItemFilter = new MenuItem (lsTemp.Display);
                menuItemFilter.Activated += delegate(object sender, EventArgs e) {
                    if (lsTemp != null) {
                        activetFilter = lsTemp;
                    } else {
                        activetFilter = null;
                    }
                    filter.Refilter();
                    treeView.QueueDraw();
                };
                menuFilter.Insert (menuItemFilter, -1);
                //filterModel.AppendValues(ls.Display, "", ls);
            }
            menuFilter.ShowAll();

            MenusToolButton mtbFilter= new MenusToolButton(menuFilter,"filter.png");
            mtbFilter.IsImportant = true;
            mtbFilter.Label = "Filter";
            toolbar.Insert (mtbFilter, -1);
            this.PackStart(toolbar, false, false, 0);
            //this.PackStart(ComboFilter, false, false, 0);
            //ComboFilter.Active = 0;
        }