/// <summary>
 /// Initializes a new instance of the MainPageViewModel class.
 /// </summary>
 public MainPageViewModel()
 {
     this.dep                   = DependencyService.Get <IMainInterface>();
     this.CommandAdd            = new Command(this.CallAdd);
     this.CommandEncryptDecrypt = new Command(this.CallEncryptDecrypt);
     this.CommandRemove         = new Command(this.CallRemove);
     this.UpdateListView();
 }
 public override void ModifyInterface(IMainInterface mainInterface)
 {
     foreach (IContextMenuPlugin plugin in Context.Current.ResolveAll<IContextMenuPlugin>())
     {
         string[] requiredUserControls = plugin.RequiredUserControls;
         if (requiredUserControls != null)
             mainInterface.LoadUserControls(requiredUserControls);
     }
 }
Esempio n. 3
0
        public Main()
        {
            var applicationLogic = new AppLogic.ApplicationLogic();

            _mainInterfaceAL = applicationLogic.GetMainInterfaceAL();

            InitializeComponent();
            InitViewBoard();
        }
Esempio n. 4
0
 public override void ModifyTree(TreePanel treePanel, IMainInterface mainInterface)
 {
     treePanel.Listeners.MoveNode.Handler = string.Format(@"
         {0}.showBusy();
         Ext.net.DirectMethods.Move.MoveNode(node.id, newParent.id, index,
         {{
             url: '{1}',
             success: function() {{ {0}.setStatus({{ text: 'Moved item', iconCls: '', clear: true }}); }}
         }})",
         mainInterface.StatusBar.ClientID, Context.AdminManager.GetAdminDefaultUrl());
 }
Esempio n. 5
0
        public override void ModifyTree(TreePanel treePanel, IMainInterface mainInterface)
        {
            treePanel.Listeners.ContextMenu.Handler = string.Format(@"function(node, e)
                {{
                    {0}.selectPath(node.getPath());
                    var contextMenu = new Ext.ux.menu.StoreMenu(
                    {{
                        url: '{1}',
                        baseParams: {{ node: node.id }},
                        width: 'auto'
                    }});

                    contextMenu.showAt(e.getXY());
                }}",
                treePanel.ClientID, Context.Current.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(GetType().Assembly, "Zeus.Admin.Plugins.ContextMenu.ContextMenuLoader.ashx"));
        }
Esempio n. 6
0
        public override void ModifyTree(TreePanel treePanel, IMainInterface mainInterface)
        {
            if (!Context.Current.Resolve<GlobalizationSection>().Enabled)
                return;

            // Setup tree bottom toolbar.
            Toolbar bottomToolbar = new Toolbar();
            treePanel.BottomBar.Add(bottomToolbar);

            ToolbarTextItem textItem = new ToolbarTextItem { Text = "Language: " };
            bottomToolbar.Items.Add(textItem);

            IconCombo comboBox = new IconCombo
            {
                EmptyText = "Select...",
                Width = Unit.Pixel(100),
                Editable = false
            };
            comboBox.Listeners.Select.Handler = string.Format(@"
                Ext.net.DirectMethods.LanguageChooser.ChangeLanguage(record.get('value'),
                {{
                    url: '{0}',
                    success: function(result)
                    {{
                        stbStatusBar.setStatus({{ text: 'Changed language', iconCls: '', clear: true }});
                    }}
                }});",
                Context.AdminManager.GetAdminDefaultUrl());

            foreach (Language language in Context.Current.Resolve<ILanguageManager>().GetAvailableLanguages())
            {
                IconComboListItem listItem = new IconComboListItem(language.Title, language.Name, language.IconUrl);
                comboBox.Items.Add(listItem);
                if (language.Name == Context.AdminManager.CurrentAdminLanguageBranch)
                {
                    comboBox.SelectedItem.Text = listItem.Text;
                    comboBox.SelectedItem.Value = listItem.Value;
                }
            }

            bottomToolbar.Items.Add(comboBox);
        }
 public override void ModifyInterface(IMainInterface mainInterface)
 {
     ResourceManager.GetInstance((Page) mainInterface).RegisterIcon(Icon.Add);
     ResourceManager.GetInstance((Page) mainInterface).RegisterIcon(Icon.Delete);
     ResourceManager.GetInstance((Page) mainInterface).RegisterIcon(Icon.ApplicationSideBoxes);
 }
Esempio n. 8
0
        public override void ModifyInterface(IMainInterface mainInterface)
        {
            // Add tree.
            TreePanel treePanel = new TreePanel
            {
                ID = "stpNavigation",
                Width = 200,
                Icon = Icon.SitemapColor,
                Title = "Site",
                AutoScroll = true,
                PathSeparator = "|",
                EnableDD = true,
                UseArrows = true,
                BodyStyle = "padding-top:5px",
                Region = Region.West,
                MinWidth = 175,
                MaxWidth = 400,
                Split = true,
                CollapseFirst = false
            };
            mainInterface.Viewport.Items.Add(treePanel);

            // Setup tree top toolbar.
            Toolbar topToolbar = new Toolbar();
            treePanel.TopBar.Add(topToolbar);

            TriggerField filterField = new TriggerField
            {
                EnableKeyEvents = true,
                Width = 100,
                EmptyText = "Filter..."
            };
            filterField.Triggers.Add(new FieldTrigger
            {
                Icon = TriggerIcon.Clear,
                HideTrigger = true
            });
            filterField.Listeners.KeyUp.Fn = "keyUp";
            filterField.Listeners.KeyUp.Buffer = 100;
            filterField.Listeners.TriggerClick.Fn = "clearFilter";
            topToolbar.Items.Add(filterField);

            topToolbar.Items.Add(new ToolbarFill());

            Button refreshButton = new Button { Icon = Icon.Reload };
            refreshButton.ToolTips.Add(new ToolTip { Html = "Refresh" });
            refreshButton.Listeners.Click.Handler = string.Format("{0}.getLoader().load({0}.getRootNode());", treePanel.ClientID);
            topToolbar.Items.Add(refreshButton);

            Button expandAllButton = new Button { IconCls = "icon-expand-all" };
            expandAllButton.ToolTips.Add(new ToolTip { Html = "Expand All" });
            expandAllButton.Listeners.Click.Handler = string.Format("{0}.expandAll();", treePanel.ClientID);
            topToolbar.Items.Add(expandAllButton);

            Button collapseAllButton = new Button { IconCls = "icon-collapse-all" };
            collapseAllButton.ToolTips.Add(new ToolTip { Html = "Collapse All" });
            collapseAllButton.Listeners.Click.Handler = string.Format("{0}.collapseAll();", treePanel.ClientID);
            topToolbar.Items.Add(collapseAllButton);

            topToolbar.Items.Add(new ToolbarSeparator());

            Window helpWindow = new Window
                {
                    Modal = true,
                    Icon = Icon.Help,
                    Title = "Help",
                    Hidden = true,
                    Html = "This is the site tree. You can use this to view all the pages on your site. Right-click any item to edit or delete it, as well as create additional pages.<br /><br />The main branches of the root node tree are the main sections of the admin system. Each section is broken down into smaller sections, accessed by expanding the + sign. (Wherever you see a + sign, the section can be broken down into further sections).<br /><br />When you receive your admin system, you will notice the first main section (after the Root Node) will be divided into the main sections of your website. (Example sections may include: Homepage, About Us, News, Links and Contact pages.) To see these pages, as they appear on the website, simply click the relevant node – it will then appear in the right hand pane.",
                    BodyStyle = "padding:5px",
                    Width = 300,
                    Height = 200,
                    AutoScroll = true
                };
            mainInterface.AddControl(helpWindow);

            Button helpButton = new Button();
            helpButton.Icon = Icon.Help;
            helpButton.ToolTips.Add(new ToolTip { Html = "Help" });
            helpButton.Listeners.Click.Handler = string.Format("{0}.show();", helpWindow.ClientID);
            topToolbar.Items.Add(helpButton);

            // Data loader.
            var treeLoader = new Ext.Net.TreeLoader
                {
                    DataUrl = Context.Current.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(GetType().Assembly,
                        "Zeus.Admin.Plugins.Tree.TreeLoader.ashx"),
                    PreloadChildren = true
                };
            treeLoader.Listeners.Load.Handler = "if (response.getResponseHeader['Content-Type'] == 'text/html; charset=utf-8') { Ext.Msg.alert('Timeout', 'Your session has timed out. Please refresh your browser to login again.'); }";
            treePanel.Loader.Add(treeLoader);

            // Call tree modification plugins and load tree plugin user controls.
            foreach (ITreePlugin treePlugin in Context.Current.ResolveAll<ITreePlugin>())
            {
                string[] requiredUserControls = treePlugin.RequiredUserControls;
                if (requiredUserControls != null)
                    mainInterface.LoadUserControls(requiredUserControls);

                treePlugin.ModifyTree(treePanel, mainInterface);
            }

            if (!ExtNet.IsAjaxRequest)
            {
                TreeNodeBase treeNode = SiteTree.Between(Find.StartPage, Find.RootItem, true)
                    .OpenTo(Find.StartPage)
                    .Filter(items => items.Authorized(Context.Current.WebContext.User, Context.SecurityManager, Operations.Read))
                    .ToTreeNode(true);
                treePanel.Root.Add(treeNode);
            }
        }
Esempio n. 9
0
 public virtual void ModifyInterface(IMainInterface mainInterface)
 {
 }
Esempio n. 10
0
 public abstract void ModifyTree(TreePanel treePanel, IMainInterface mainInterface);