Пример #1
0
        private void setEnglishLang_Click(object sender, RoutedEventArgs e)
        {
            CultureResources.ChangeCulture(new CultureInfo("en"));

            /*
             * ClearOperation();
             * AddNewMenuOperationItems("en");
             */
        }
Пример #2
0
        public MainWindow()
        {
            CultureResources.ChangeCulture(new CultureInfo("pl"));
            InitializeComponent();

            InitializeBackGroundWorker();

            drawPluginsList      = PluginsManager.LoadPlugins <DrawInterface.IPluginShapes>().ToList();
            operationPluginsList = PluginsManager.LoadPlugins <DrawInterface.IPluginOperations>().ToList();

            drawPluginsDictionary       = new Dictionary <string, DrawInterface.IPluginShapes>();
            operationsPluginsDictionary = new Dictionary <string, DrawInterface.IPluginOperations>();

            m_redoStack = new Stack <UIElement>();

            //insert list draw plugins into dictionary
            foreach (var plugin in drawPluginsList)
            {
                drawPluginsDictionary.Add(plugin.GetName(), plugin);
            }

            //insert list operation plugins into dictionary
            foreach (var plugin in operationPluginsList)
            {
                operationsPluginsDictionary.Add(plugin.GetName(), plugin);
            }

            //add draw plugins into toolbar
            foreach (var plugin in drawPluginsDictionary)
            {
                Button pluginButton = new Button();
                pluginButton.Tag     = plugin.Key;
                pluginButton.Content = plugin.Value.GetName();
                pluginButton.Click  += pluginButton_Click;
                shapePlugins.Items.Add(pluginButton);
            }

            //add operation plugins into menu
            foreach (var plugin in operationsPluginsDictionary)
            {
                MenuItem operationDrawMenuItem = new MenuItem();
                operationDrawMenuItem.Header = plugin.Key;
                operationDrawMenuItem.Click += operationsMenuItem_Click;
                operationsMenu.Items.Add(operationDrawMenuItem);
            }
        }