GetImageSource() public static method

Get the image frame associated with given identifier.
public static GetImageSource ( string name ) : BitmapFrame
name string
return BitmapFrame
コード例 #1
0
 private void ApplyTutorialFourth()
 {
     slide_image.Source      = UIHelpers.GetImageSource("tutorial-slide-4");
     continue_button.Content = Properties_Resources.Finish;
     check_box.Content       = String.Format(Properties_Resources.Startup, Properties_Resources.ApplicationName);
     continue_button.Focus();
 }
コード例 #2
0
ファイル: About.cs プロジェクト: sofiaker/Oris4Sync
        /// <summary>
        /// Constructor.
        /// </summary>
        public About()
        {
            Title      = "About Oris4 Sync";
            ResizeMode = ResizeMode.NoResize;
            Height     = 288;
            Width      = 640;
            Icon       = UIHelpers.GetImageSource("cmissync-app", "ico");

            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Closing += Close;

            CreateAbout();

            Controller.ShowWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Show();
                    Activate();
                    BringIntoView();
                });
            };

            Controller.HideWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Hide();
                });
            };
        }
コード例 #3
0
ファイル: SetupWindow.cs プロジェクト: sunxk/CmisSync
        /// <summary>
        /// Constructor.
        /// </summary>
        public SetupWindow()
        {
            // Window properties.
            Title                 = CmisSync.Properties_Resources.AddARemoteFolder;
            Width                 = 640;
            Height                = 440;
            ResizeMode            = ResizeMode.NoResize;
            Background            = new SolidColorBrush(Colors.WhiteSmoke);
            Icon                  = UIHelpers.GetImageSource("app", "ico");
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Content               = ContentCanvas;
            Closing              += Close;

            // Taskbar
            TaskbarItemInfo = new TaskbarItemInfo()
            {
                Description = Properties_Resources.ApplicationName
            };

            if (useXAML)
            {
                Padding = new Thickness(0);
                LoadSetup();
            }
            else
            {
                CreateSetup();
            }
        }
コード例 #4
0
ファイル: About.cs プロジェクト: OpenDataSpace/CmisSync
        /// <summary>
        /// Constructor.
        /// </summary>
        public About()
        {
            Title      = string.Format(Properties_Resources.About, Properties_Resources.ApplicationName);
            ResizeMode = ResizeMode.NoResize;
            Height     = 288;
            Width      = 640;
            Icon       = UIHelpers.GetImageSource("app", "ico");

            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Closing += Close;

            LoadAbout();

            CreateLink();

            Controller.ShowWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Show();
                    Activate();
                    BringIntoView();
                });
            };

            Controller.HideWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Hide();
                });
            };
        }
コード例 #5
0
 private void ApplyTutorialFirst()
 {
     slide_image.Source      = UIHelpers.GetImageSource("tutorial-slide-1");
     continue_button.Content = Properties_Resources.Continue;
     cancel_button.Content   = Properties_Resources.SkipTutorial;
     continue_button.Focus();
 }
コード例 #6
0
ファイル: SetupWindow.cs プロジェクト: lefty01/CmisSync
        public SetupWindow()
        {
            Title      = "CmisSync Setup";
            Width      = 640;
            Height     = 440;
            ResizeMode = ResizeMode.NoResize;
            Background = new SolidColorBrush(Colors.WhiteSmoke);
            Icon       = UIHelpers.GetImageSource("sparkleshare-app", "ico");

            TaskbarItemInfo = new TaskbarItemInfo()
            {
                Description = "CmisSync"
            };

            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Content = ContentCanvas;

            Closing += Close;

            this.bar = new Rectangle()
            {
                Width  = Width,
                Height = 40,
                Fill   = new SolidColorBrush(Color.FromRgb(240, 240, 240))
            };

            this.line = new Rectangle()
            {
                Width  = Width,
                Height = 1,
                Fill   = new SolidColorBrush(Color.FromRgb(223, 223, 223))
            };


            this.side_splash = new Image()
            {
                Width  = 150,
                Height = 482
            };

            this.side_splash.Source = UIHelpers.GetImageSource("side-splash");


            ContentCanvas.Children.Add(this.bar);
            Canvas.SetRight(bar, 0);
            Canvas.SetBottom(bar, 0);

            ContentCanvas.Children.Add(this.line);
            Canvas.SetRight(this.line, 0);
            Canvas.SetBottom(this.line, 40);

            ContentCanvas.Children.Add(this.side_splash);
            Canvas.SetLeft(this.side_splash, 0);
            Canvas.SetBottom(this.side_splash, 0);
        }
コード例 #7
0
ファイル: SetupWindow.cs プロジェクト: weberale/CmisSync
        /// <summary>
        /// Constructor.
        /// </summary>
        public SetupWindow()
        {
            // Window properties.
            Title                 = CmisSync.Properties_Resources.CmisSync;
            Width                 = 640;
            Height                = 440;
            ResizeMode            = ResizeMode.NoResize;
            Background            = new SolidColorBrush(Colors.WhiteSmoke);
            Icon                  = UIHelpers.GetImageSource("cmissync-app", "ico");
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Content               = ContentCanvas;
            Closing              += Close;

            // Taskbar
            TaskbarItemInfo = new TaskbarItemInfo()
            {
                Description = "CmisSync"
            };

            // Separation and background for the line of buttons.
            this.buttonsLine = new Rectangle()
            {
                Width  = Width,
                Height = 1,
                Fill   = new SolidColorBrush(Color.FromRgb(223, 223, 223))
            };
            this.buttonsBackground = new Rectangle()
            {
                Width  = Width,
                Height = 40,
                Fill   = new SolidColorBrush(Color.FromRgb(240, 240, 240))
            };

            // Splash image.
            this.side_splash = new Image()
            {
                Width  = 150,
                Height = 482
            };
            this.side_splash.Source = UIHelpers.GetImageSource("side-splash");

            // Components position.

            ContentCanvas.Children.Add(this.buttonsBackground);
            Canvas.SetRight(buttonsBackground, 0);
            Canvas.SetBottom(buttonsBackground, 0);

            ContentCanvas.Children.Add(this.buttonsLine);
            Canvas.SetRight(this.buttonsLine, 0);
            Canvas.SetBottom(this.buttonsLine, 40);

            ContentCanvas.Children.Add(this.side_splash);
            Canvas.SetLeft(this.side_splash, 0);
            Canvas.SetBottom(this.side_splash, 0);
        }
コード例 #8
0
ファイル: SetupWindow.cs プロジェクト: sunxk/CmisSync
        private void LoadSetup()
        {
            System.Uri  resourceLocater = new System.Uri("/DataSpaceSync;component/SetupWPF.xaml", System.UriKind.Relative);
            UserControl SetupWPF        = Application.LoadComponent(resourceLocater) as UserControl;

            this.ContentCanvas     = SetupWPF.FindName("ContentCanvas") as Canvas;
            this.sideSplash        = SetupWPF.FindName("SideSplash") as Image;
            this.sideSplash.Source = UIHelpers.GetImageSource("side-splash");
            this.headerLabel       = SetupWPF.FindName("HeaderLabel") as Label;
            this.descriptionLabel  = SetupWPF.FindName("DescriptionLabel") as TextBlock;

            Content = SetupWPF;
        }
コード例 #9
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public About()
        {
            Title      = String.Format(Properties_Resources.About, Properties_Resources.ApplicationName);
            ResizeMode = ResizeMode.NoResize;
            Height     = 288;
            Width      = 640;
            Icon       = UIHelpers.GetImageSource("app", "ico");

            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Closing += Close;

            //CreateAbout ();
            LoadAbout();

            CreateLink();

            Controller.ShowWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Show();
                    Activate();
                    BringIntoView();
                });
            };

            Controller.HideWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Hide();
                });
            };

            Controller.NewVersionEvent += delegate(string new_version) {
                Dispatcher.BeginInvoke((Action) delegate {
                    this.updates.Content = String.Format(Properties_Resources.NewVersionAvailable, new_version);
                    this.updates.UpdateLayout();
                });
            };

            Controller.VersionUpToDateEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    this.updates.Content = Properties_Resources.RunningLatestVersion;
                    this.updates.UpdateLayout();
                });
            };

            Controller.CheckingForNewVersionEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    //this.updates.Content = "Checking for updates...";
                    this.updates.UpdateLayout();
                });
            };
        }
コード例 #10
0
ファイル: About.cs プロジェクト: to2y/CmisSync
        /// <summary>
        /// Constructor.
        /// </summary>
        public About()
        {
            Title      = "About CmisSync";
            ResizeMode = ResizeMode.NoResize;
            Height     = 288;
            Width      = 640;
            Icon       = UIHelpers.GetImageSource("cmissync-app", "ico");

            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            Closing += Close;

            CreateAbout();

            Controller.ShowWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Show();
                    Activate();
                    BringIntoView();
                });
            };

            Controller.HideWindowEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    Hide();
                });
            };

            Controller.NewVersionEvent += delegate(string new_version) {
                Dispatcher.BeginInvoke((Action) delegate {
                    this.updates.Content = "A newer version (" + new_version + ") is available!";
                    this.updates.UpdateLayout();
                });
            };

            Controller.VersionUpToDateEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    this.updates.Content = "You are running the latest version.";
                    this.updates.UpdateLayout();
                });
            };

            Controller.CheckingForNewVersionEvent += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    //this.updates.Content = "Checking for updates...";
                    this.updates.UpdateLayout();
                });
            };
        }
コード例 #11
0
ファイル: Spinner.cs プロジェクト: lefty01/CmisSync
        public Spinner(int size) : base()
        {
            Width  = size;
            Height = size;

            BitmapSource spinner_gallery = UIHelpers.GetImageSource("process-working-22");

            int frames_in_width  = spinner_gallery.PixelWidth / size;
            int frames_in_height = spinner_gallery.PixelHeight / size;

            this.num_steps = (frames_in_width * frames_in_height) - 1;
            this.images    = new Image [this.num_steps];

            int i = 0;

            for (int y = 0; y < frames_in_height; y++)
            {
                for (int x = 0; x < frames_in_width; x++)
                {
                    if (!(y == 0 && x == 0))
                    {
                        CroppedBitmap crop = new CroppedBitmap(spinner_gallery,
                                                               new Int32Rect(size * x, size * y, size, size));

                        this.images [i]        = new Image();
                        this.images [i].Source = crop;
                        i++;
                    }
                }
            }

            this.timer = new Timer()
            {
                Interval = 400 / this.num_steps
            };

            this.timer.Elapsed += delegate {
                Dispatcher.BeginInvoke((Action) delegate {
                    NextImage();
                });
            };

            Start();
        }
コード例 #12
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TransmissionWindow()
        {
            Title  = Properties_Resources.Transmission;
            Height = 480;
            Width  = 640;
            Icon   = UIHelpers.GetImageSource("app", "ico");

            Closing += Transmission_Closing;
            Controller.ShowWindowEvent         += Controller_ShowWindowEvent;
            Controller.HideWindowEvent         += Controller_HideWindowEvent;
            Controller.InsertTransmissionEvent += Controller_InsertTransmissionEvent;
            Controller.UpdateTransmissionEvent += Controller_UpdateTransmissionEvent;
            Controller.DeleteTransmissionEvent += Controller_DeleteTransmissionEvent;

            LoadTransmission();

            OkButton.Click += delegate {
                Controller_HideWindowEvent();
            };
        }
コード例 #13
0
ファイル: About.cs プロジェクト: OpenDataSpace/CmisSync
        private void LoadAbout()
        {
            System.Uri  resourceLocater = new System.Uri("/DataSpaceSync;component/AboutWPF.xaml", System.UriKind.Relative);
            UserControl aboutWPF        = Application.LoadComponent(resourceLocater) as UserControl;

            canvas  = aboutWPF.FindName("canvas") as Canvas;
            image   = aboutWPF.FindName("image") as Image;
            version = aboutWPF.FindName("version") as Label;
            credits = aboutWPF.FindName("credits") as TextBlock;

            image.Source    = UIHelpers.GetImageSource("about");
            version.Content = string.Format(Properties_Resources.Version, Controller.RunningVersion, Controller.CreateTime.GetValueOrDefault().ToString("d"));
            credits.Text    = string.Format("Copyright © {0}–{1} {2}\n\n{3} {4}",
                                            "2013",
                                            DateTime.Now.Year.ToString(),
                                            " GRAU DATA AG, Aegif and others.",
                                            Properties_Resources.ApplicationName,
                                            "is Open Source software. You are free to use, modify, and redistribute it under the GNU General Public License version 3 or later.");

            Content = aboutWPF;
        }
コード例 #14
0
ファイル: SetupWindow.cs プロジェクト: sunxk/CmisSync
        private void CreateSetup()
        {
            // Separation and background for the line of buttons.
            this.buttonsLine = new Rectangle()
            {
                Width  = Width,
                Height = 1,
                Fill   = new SolidColorBrush(Color.FromRgb(223, 223, 223))
            };
            this.buttonsBackground = new Rectangle()
            {
                Width  = Width,
                Height = 40,
                Fill   = new SolidColorBrush(Color.FromRgb(240, 240, 240))
            };

            // Splash image.
            this.sideSplash = new Image()
            {
                Width  = 150,
                Height = 482
            };
            this.sideSplash.Source = UIHelpers.GetImageSource("side-splash");

            // Components position.

            ContentCanvas.Children.Add(this.buttonsBackground);
            Canvas.SetRight(buttonsBackground, 0);
            Canvas.SetBottom(buttonsBackground, 0);

            ContentCanvas.Children.Add(this.buttonsLine);
            Canvas.SetRight(this.buttonsLine, 0);
            Canvas.SetBottom(this.buttonsLine, 40);

            ContentCanvas.Children.Add(this.sideSplash);
            Canvas.SetLeft(this.sideSplash, 0);
            Canvas.SetBottom(this.sideSplash, 0);
        }
コード例 #15
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Setting()
        {
            Title      = Properties_Resources.EditTitle;
            ResizeMode = ResizeMode.NoResize;
            Height     = 340;
            Width      = 640;
            Icon       = UIHelpers.GetImageSource("app", "ico");
            ElementHost.EnableModelessKeyboardInterop(this);

            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            Closing += delegate(object sender, CancelEventArgs args)
            {
                Controller.HideWindow();
                args.Cancel = true;
            };

            LoadSetting();

            Controller.ShowWindowEvent += delegate
            {
                Dispatcher.BeginInvoke((Action) delegate
                {
                    RefreshSetting();
                    Show();
                    Activate();
                    BringIntoView();
                });
            };

            Controller.HideWindowEvent += delegate
            {
                Dispatcher.BeginInvoke((Action) delegate
                {
                    Hide();
                });
            };

            FinishButton.Click += delegate
            {
                ProxySettings proxy = new ProxySettings();
                if (ProxyNone.IsChecked.GetValueOrDefault())
                {
                    proxy.Selection = ProxySelection.NOPROXY;
                }
                else if (ProxySystem.IsChecked.GetValueOrDefault())
                {
                    proxy.Selection = ProxySelection.SYSTEM;
                }
                else
                {
                    proxy.Selection = ProxySelection.CUSTOM;
                }
                proxy.LoginRequired = LoginCheck.IsChecked.GetValueOrDefault();
                string server = Controller.GetServer(AddressText.Text);
                if (server != null)
                {
                    proxy.Server = new Uri(server);
                }
                else
                {
                    proxy.Server = ConfigManager.CurrentConfig.Proxy.Server;
                }
                proxy.Username           = UserText.Text;
                proxy.ObfuscatedPassword = Crypto.Obfuscate(PasswordText.Password);

                ConfigManager.CurrentConfig.Proxy = proxy;

                ConfigManager.CurrentConfig.Notifications = NotificationsCheck.IsChecked.GetValueOrDefault();

                ConfigManager.CurrentConfig.Save();

                Controller.HideWindow();
            };

            CancelButton.Click += delegate
            {
                Controller.HideWindow();
            };
        }
コード例 #16
0
 private void ApplyTutorialSecond()
 {
     slide_image.Source      = UIHelpers.GetImageSource("tutorial-slide-2");
     continue_button.Content = Properties_Resources.Continue;
     continue_button.Focus();
 }
コード例 #17
0
ファイル: About.cs プロジェクト: pcreignou/CmisSync
        /// <summary>
        /// Create the UI.
        /// </summary>
        private void CreateAbout()
        {
            Image image = new Image()
            {
                Width  = 640,
                Height = 260
            };

            image.Source = UIHelpers.GetImageSource("about");


            Label version = new Label()
            {
                Content    = String.Format(Properties_Resources.Version, Controller.RunningVersion),
                FontSize   = 11,
                Foreground = new SolidColorBrush(Color.FromRgb(135, 178, 227))
            };

            this.updates = new Label()
            {
                Content = Properties_Resources.ResourceManager.GetString(
                    "PleaseCheckForUpdates", CultureInfo.CurrentCulture), // Previously: "Checking for updates...",
                FontSize   = 11,
                Foreground = new SolidColorBrush(Color.FromRgb(135, 178, 227))
            };

            TextBlock credits = new TextBlock()
            {
                FontSize   = 11,
                Foreground = new SolidColorBrush(Color.FromRgb(135, 178, 227)),
                Text       = "Copyright © 2010–" + DateTime.Now.Year.ToString() + " Aegif and others.\n" +
                             "\n" +
                             Properties_Resources.ResourceManager.GetString("OpenSource", CultureInfo.CurrentCulture),
                TextWrapping = TextWrapping.Wrap,
                Width        = 318
            };

            Link website_link = new Link(Properties_Resources.ResourceManager.GetString(
                                             "Website", CultureInfo.CurrentCulture), Controller.WebsiteLinkAddress);
            Link credits_link = new Link(Properties_Resources.ResourceManager.GetString(
                                             "Credits", CultureInfo.CurrentCulture), Controller.CreditsLinkAddress);
            Link report_problem_link = new Link(Properties_Resources.ResourceManager.GetString(
                                                    "ReportProblem", CultureInfo.CurrentCulture), Controller.ReportProblemLinkAddress);

            Canvas canvas = new Canvas();

            canvas.Children.Add(image);
            Canvas.SetLeft(image, 0);
            Canvas.SetTop(image, 0);

            canvas.Children.Add(version);
            Canvas.SetLeft(version, 289);
            Canvas.SetTop(version, 92);

            canvas.Children.Add(this.updates);
            Canvas.SetLeft(this.updates, 289);
            Canvas.SetTop(this.updates, 109);

            canvas.Children.Add(credits);
            Canvas.SetLeft(credits, 294);
            Canvas.SetTop(credits, 142);

            canvas.Children.Add(website_link);
            Canvas.SetLeft(website_link, 289);
            Canvas.SetTop(website_link, 222);

            canvas.Children.Add(credits_link);
            Canvas.SetLeft(credits_link, 289 + website_link.ActualWidth + 60);
            Canvas.SetTop(credits_link, 222);

            canvas.Children.Add(report_problem_link);
            Canvas.SetLeft(report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
            Canvas.SetTop(report_problem_link, 222);

            Content = canvas;
        }
コード例 #18
0
ファイル: About.cs プロジェクト: to2y/CmisSync
        /// <summary>
        /// Create the UI.
        /// </summary>
        private void CreateAbout()
        {
            Image image = new Image()
            {
                Width  = 640,
                Height = 260
            };

            image.Source = UIHelpers.GetImageSource("about");


            Label version = new Label()
            {
                Content    = "version " + Controller.RunningVersion,
                FontSize   = 11,
                Foreground = new SolidColorBrush(Color.FromRgb(135, 178, 227))
            };

            this.updates = new Label()
            {
                Content    = "Please check for updates at CmisSync.com", //"Checking for updates...",
                FontSize   = 11,
                Foreground = new SolidColorBrush(Color.FromRgb(135, 178, 227))
            };

            TextBlock credits = new TextBlock()
            {
                FontSize   = 11,
                Foreground = new SolidColorBrush(Color.FromRgb(135, 178, 227)),
                Text       = "Copyright © 2010–" + DateTime.Now.Year.ToString() + " Aegif and others.\n" +
                             "\n" +
                             "CmisSync is Open Source software. You are free to use, modify, " +
                             "and redistribute it under the GNU General Public License version 3 or later.",
                TextWrapping = TextWrapping.Wrap,
                Width        = 318
            };

            Link website_link        = new Link("Website", Controller.WebsiteLinkAddress);
            Link credits_link        = new Link("Credits", Controller.CreditsLinkAddress);
            Link report_problem_link = new Link("Report a problem", Controller.ReportProblemLinkAddress);

            Canvas canvas = new Canvas();

            canvas.Children.Add(image);
            Canvas.SetLeft(image, 0);
            Canvas.SetTop(image, 0);

            canvas.Children.Add(version);
            Canvas.SetLeft(version, 289);
            Canvas.SetTop(version, 92);

            canvas.Children.Add(this.updates);
            Canvas.SetLeft(this.updates, 289);
            Canvas.SetTop(this.updates, 109);

            canvas.Children.Add(credits);
            Canvas.SetLeft(credits, 294);
            Canvas.SetTop(credits, 142);

            canvas.Children.Add(website_link);
            Canvas.SetLeft(website_link, 289);
            Canvas.SetTop(website_link, 222);

            canvas.Children.Add(credits_link);
            Canvas.SetLeft(credits_link, 289 + website_link.ActualWidth + 60);
            Canvas.SetTop(credits_link, 222);

            canvas.Children.Add(report_problem_link);
            Canvas.SetLeft(report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
            Canvas.SetTop(report_problem_link, 222);

            Content = canvas;
        }