Exemple #1
0
        public override string Invoke(string[] args)
        {
            try
            {
                if (args == null)
                {
                    throw new Exception("Input parameter 'args' is null.");
                }

                AboutInfo aboutInfo = Invoke();

                if (aboutInfo == null)
                {
                    return("");
                }

                return(aboutInfo.ToString());
            }
            catch (Exception exception)
            {
                Log.Error(exception);

                return(null);
            }
        }
Exemple #2
0
            public static AboutInfo Load(String xmlPath)
            {
                var info = new AboutInfo();

                var doc = new XmlDocument();

                doc.Load(xmlPath);
                var xmlNode = doc.SelectSingleNode("about");

                foreach (XmlNode node in xmlNode.ChildNodes)
                {
                    if (node.NodeType != XmlNodeType.Comment && node.Name.ToLower() == "template")
                    {
                        var ns = node.Attributes;
                        info.name       = ((ns["name"] != null) ? ns["name"].Value : "");
                        info.author     = ((ns["author"] != null) ? ns["author"].Value : "");
                        info.createdate = ((ns["createdate"] != null) ? ns["createdate"].Value : "");
                        info.ver        = ((ns["ver"] != null) ? ns["ver"].Value : "");
                        info.fordntver  = ((ns["fordntver"] != null) ? ns["fordntver"].Value : "");
                        info.copyright  = ((ns["copyright"] != null) ? ns["copyright"].Value : "");
                        info.width      = ((ns["width"] != null) ? ns["width"].Value : "600");
                    }
                }

                return(info);
            }
        public AboutInfo GetAboutInfo()
        {
            var aboutInfo = new AboutInfo(new Uri($"pack://application:,,,/{Catel.Reflection.AssemblyHelper.GetEntryAssembly().GetName().Name};component/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute),
                                          uriInfo: new UriInfo("https://www.catelproject.com", "Product website"));

            return(aboutInfo);
        }
Exemple #4
0
        public void Import(String name, String dir)
        {
            var xml = "templates".CombinePath(dir, "about.xml").GetFullPath();

            if (!File.Exists(xml))
            {
                return;
            }

            var ai  = AboutInfo.Load(xml);
            var tmp = this;

            if (!name.IsNullOrEmpty())
            {
                tmp.Name      = name;
                tmp.Directory = name;
            }
            tmp.Author     = ai.author;
            tmp.Copyright  = ai.copyright;
            tmp.Ver        = ai.ver;
            tmp.Fordntver  = ai.fordntver;
            tmp.Createdate = ai.createdate;
            tmp.Width      = ai.width.ToInt(750);
            tmp.Enable     = true;
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                aboutBo = new AboutBo(web);

                var id            = Request.QueryString["Id"];
                int currentId     = 0;
                var aboutInfoList = aboutBo.get_About(web, id);
                var aboutInfo     = new AboutInfo();

                if (aboutInfoList.Any())
                {
                    if (!int.TryParse(id, out currentId))
                    {
                        aboutInfo = aboutInfoList[0];
                    }
                    else
                    {
                        aboutInfo = aboutInfoList.First(c => c.Id == currentId);
                    }

                    ltContent.Text = aboutInfo.Content;
                    ltCat.Text     = aboutInfo.Title;

                    SetPageTitles(aboutInfo.Title);
                }

                rpAbout.DataSource = aboutInfoList;
                rpAbout.DataBind();
            }
        }
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService, IUIVisualizerService uiVisualizerService,
                              IMessageService messageService, ILanguageService languageService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => languageService);

            _processService      = processService;
            _uiVisualizerService = uiVisualizerService;
            _messageService      = messageService;
            _languageService     = languageService;

            var assembly      = aboutInfo.Assembly;
            var version       = VersionHelper.GetCurrentVersion(assembly);
            var buildDateTime = assembly.GetBuildDateTime();

            Title                 = assembly.Title();
            Version               = string.Format("v {0}", version);
            BuildDateTime         = string.Format(languageService.GetString("Orchestra_BuiltOn"), buildDateTime);
            UriInfo               = aboutInfo.UriInfo;
            Copyright             = assembly.Copyright();
            CompanyLogoUri        = aboutInfo.CompanyLogoUri;
            ImageSourceUrl        = aboutInfo.LogoImageSource;
            ShowLogButton         = aboutInfo.ShowLogButton;
            AppIcon               = assembly.ExtractLargestIcon();
            OpenUrl               = new Command(OnOpenUrlExecute, OnOpenUrlCanExecute);
            OpenLog               = new TaskCommand(OnOpenLogExecuteAsync);
            ShowSystemInfo        = new Command(OnShowSystemInfoExecute);
            EnableDetailedLogging = new Command(OnEnableDetailedLoggingExecute);
        }
 /// <summary>
 /// Method to invoke when the Help command is executed.
 /// </summary>
 private void OnHelpExecute()
 {
     var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute), 
         "/Orchestra.Examples.Ribbon.Microsoft;component/Resources/Images/CompanyLogo.png", 
         new UriInfo("http://www.catelproject.com", "Product website"));
     _uiVisualizerService.ShowDialog<AboutViewModel>(aboutInfo);
 }
Exemple #8
0
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService, IUIVisualizerService uiVisualizerService,
                              IMessageService messageService, ILanguageService languageService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => languageService);

            _processService      = processService;
            _uiVisualizerService = uiVisualizerService;
            _messageService      = messageService;
            _languageService     = languageService;

            var buildDateTime = aboutInfo.BuildDateTime.Value;

            Title          = aboutInfo.Name;
            Version        = string.Format("v {0}", aboutInfo.DisplayVersion);
            BuildDateTime  = string.Format(languageService.GetString("Orchestra_BuiltOn"), buildDateTime);
            UriInfo        = aboutInfo.UriInfo;
            Copyright      = aboutInfo.Copyright;
            CopyrightUrl   = aboutInfo.CopyrightUri == null ? null : aboutInfo.CopyrightUri.ToString();
            CompanyLogoUri = aboutInfo.CompanyLogoUri;
            ImageSourceUrl = aboutInfo.LogoImageSource;
            ShowLogButton  = aboutInfo.ShowLogButton;
            AppIcon        = aboutInfo.AppIcon;

            OpenUrl               = new Command(OnOpenUrlExecute, OnOpenUrlCanExecute);
            OpenCopyrightUrl      = new Command(OnOpenCopyrightUrlExecute, OnOpenCopyrightUrlCanExecute);
            ShowThirdPartyNotices = new TaskCommand(OnShowThirdPartyNoticesExecuteAsync);
            OpenLog               = new TaskCommand(OnOpenLogExecuteAsync);
            ShowSystemInfo        = new TaskCommand(OnShowSystemInfoExecuteAsync);
            EnableDetailedLogging = new Command(OnEnableDetailedLoggingExecute);
        }
Exemple #9
0
        public AboutInfo GetAboutInfo()
        {
            var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Media/Images/Application/CompanyLogo.png", UriKind.RelativeOrAbsolute),
                                          uriInfo: new UriInfo("https://github.com/WolvenKit/Wolven-kit", "Github Page"));

            return(aboutInfo);
        }
Exemple #10
0
        public AboutInfo GetAboutInfo()
        {
            var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/Kennyvv_Logo.png", UriKind.RelativeOrAbsolute),
                                          uriInfo: new UriInfo("https://github.com/kennyvv/Alex", "GitHub Repository"));

            return(aboutInfo);
        }
Exemple #11
0
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService, IUIVisualizerService uiVisualizerService,
            IMessageService messageService, ILanguageService languageService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => languageService);

            _processService = processService;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;
            _languageService = languageService;

            var assembly = aboutInfo.Assembly;
            var version = aboutInfo.DisplayVersion;
            var buildDateTime = aboutInfo.BuildDateTime.Value;

            Title = aboutInfo.Name;
            Version = string.Format("v {0}", aboutInfo.DisplayVersion);
            BuildDateTime = string.Format(languageService.GetString("Orchestra_BuiltOn"), buildDateTime);
            UriInfo = aboutInfo.UriInfo;
            Copyright = aboutInfo.Copyright;
            CompanyLogoUri = aboutInfo.CompanyLogoUri;
            ImageSourceUrl = aboutInfo.LogoImageSource;
            ShowLogButton = aboutInfo.ShowLogButton;
            AppIcon = aboutInfo.AppIcon;
            OpenUrl = new Command(OnOpenUrlExecute, OnOpenUrlCanExecute);
            OpenLog = new TaskCommand(OnOpenLogExecuteAsync);
            ShowSystemInfo = new Command(OnShowSystemInfoExecute);
            EnableDetailedLogging = new Command(OnEnableDetailedLoggingExecute);
        }
        public ActionResult Edit([Bind(Include = "Id,Title,Text,Photo")] AboutInfo aboutInfo, HttpPostedFileBase Photo)
        {
            db.Entry(aboutInfo).State = EntityState.Modified;


            if (Photo == null)
            {
                db.Entry(aboutInfo).Property(a => a.Photo).IsModified = false;
            }
            else
            {
                string fileName = DateTime.Now.ToString("yyyyMMddHHmmssff") + Photo.FileName;
                string path     = Server.MapPath("~/Uploads/");
                Photo.SaveAs(path + fileName);
                aboutInfo.Photo = fileName;
            }


            if (ModelState.IsValid)
            {
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(aboutInfo));
        }
Exemple #13
0
        public AboutInfo GetAboutInfo()
        {
            var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute),
                                          uriInfo: new UriInfo("https://www.catelproject.com", "Product website"));

            return(aboutInfo);
        }
Exemple #14
0
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService, IUIVisualizerService uiVisualizerService,
            IMessageService messageService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            
            _processService = processService;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;

            var assembly = aboutInfo.Assembly;
            var version = VersionHelper.GetCurrentVersion(assembly);
            var buildDateTime = assembly.GetBuildDateTime();

            Title = assembly.Title();
            Version = string.Format("v {0}", version);
            BuildDateTime = string.Format("Built on {0}", buildDateTime);
            UriInfo = aboutInfo.UriInfo;
            Copyright = assembly.Copyright();
            CompanyLogoUri = aboutInfo.CompanyLogoUri;
            ImageSourceUrl = aboutInfo.LogoImageSource;
            ShowLogButton = aboutInfo.ShowLogButton;
            AppIcon = assembly.ExtractLargestIcon();
            OpenUrl = new Command(OnOpenUrlExecute, OnOpenUrlCanExecute);
            OpenLog = new TaskCommand(OnOpenLogExecuteAsync);
            ShowSystemInfo = new Command(OnShowSystemInfoExecute);
            EnableDetailedLogging = new Command(OnEnableDetailedLoggingExecute);
        }
Exemple #15
0
    public void EditAbout()
    {
        int    About_ID       = tools.CheckInt(Request.Form["About_ID"]);
        int    About_IsActive = tools.CheckInt(Request.Form["About_IsActive"]);
        string About_Title    = tools.CheckStr(Request.Form["About_Title"]);
        string About_Sign     = tools.CheckStr(Request.Form["About_Sign"]);
        string About_Content  = Request.Form["About_Content"];
        int    About_Sort     = tools.CheckInt(Request.Form["About_Sort"]);

        if (About_Title == "")
        {
            Public.Msg("error", "错误信息", "请填写标题", false, "{back}"); return;
        }

        AboutInfo entity = new AboutInfo();

        entity.About_ID       = About_ID;
        entity.About_IsActive = About_IsActive;
        entity.About_Title    = About_Title;
        entity.About_Sign     = About_Sign;
        entity.About_Content  = About_Content;
        entity.About_Sort     = About_Sort;
        entity.About_Site     = Public.GetCurrentSite();

        if (MyBLL.EditAbout(entity, Public.GetUserPrivilege()))
        {
            Public.Msg("positive", "操作成功", "操作成功", true, "about_list.aspx");
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
Exemple #16
0
        public AboutInfo GetAboutInfo()
        {
            var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute),
                uriInfo: new UriInfo("http://www.catelproject.com", "Product website"));

            return aboutInfo;
        }
Exemple #17
0
        //---------------------------------------------------------------
        // Metodos públicos de la clase
        //---------------------------------------------------------------

        #region Ventana About
        /// <summary>
        /// Arma la información de la ventana de "Acerca de"
        /// </summary>
        /// <param name="p_strTitle">Titulo del programa</param>
        /// <param name="p_bmpEEgg">Imagen Eastern Egg</param>
        public static AboutInfo MakeAboutInfo(string p_strTitle,
                                              Bitmap p_bmpEEgg)
        {
            // Llenamos la información de la ventana About...
            AboutInfo l_aiData = new AboutInfo();

            l_aiData.FrmColor  = Color.FromArgb(255, 255, 255);
            l_aiData.ConIcono  = true;
            l_aiData.ConLogo   = true;
            l_aiData.Copyright = String.Format("© Copyright 2003-{0:yy} by TNGS\r\n" +
                                               "www.tngs.com.ar    email: info@\r\n\r\n" +
                                               "Programa de la solucion Carm.",
                                               DateTime.Now);
            l_aiData.ConScroll   = true;
            l_aiData.ScrollColor = Color.FromArgb(255, 255, 255);
            l_aiData.ScrollTxt   = "[C][O][3]" + p_strTitle + "\r\n" +
                                   "[I][N][2]Desarrolladores:\r\n" +
                                   "[F][1][C]Moll Matias (Contacto: [email protected])\r\n" +
                                   "[N][2][I]Diseño:\r\n" +
                                   "[F][1][C]Moll Marcelo \r\n\r\n" +
                                   "[F][1][C]Moll Matias (Contacto: [email protected])\r\n\r\n" +
                                   "[I]" +
                                   AboutInfo.AboutCopyright + // No Remover!!. Son los copyrights de los elementos licenciados
                                   "Advertencia: Los códigos fuentes de este programa están protegidos por las leyes de derecho de autor para todo el territorio argentino.\r\n\r\n";
            l_aiData.EECode  = "<Alt\tT: Secuncia del EEgg>"; //"Menu, Alt\tT, Alt\tN, Alt\tG, Alt\tS, Alt\tY\tA\t";
            l_aiData.EEImage = p_bmpEEgg;
            return(l_aiData);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            AboutInfo aboutInfo = db.AboutInfo.Find(id);

            db.AboutInfo.Remove(aboutInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #19
0
        /// <summary>
        /// Initialize application context and displays main window.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        /// <param name="aboutInfo">The about information.</param>
        public void Start(IServiceProvider serviceProvider, AboutInfo aboutInfo)
        {
            InitializeConverters(serviceProvider);

            Selector = ThemeSelector.Create("Themes");
            Selector.LoadSelectedTheme("Core2D.theme");

            var log    = serviceProvider.GetService <ILog>();
            var fileIO = serviceProvider.GetService <IFileSystem>();

            log?.Initialize(System.IO.Path.Combine(fileIO?.GetBaseDirectory(), "Core2D.log"));

            try
            {
                var editor = serviceProvider.GetService <IProjectEditor>();

                editor.LayoutPlatform.LoadLayout  = () => editor.Platform.OnLoadLayout();
                editor.LayoutPlatform.SaveLayout  = () => editor.Platform.OnSaveLayout();
                editor.LayoutPlatform.ResetLayout = () => editor.Platform.OnResetLayout();

                var layoutPath = System.IO.Path.Combine(fileIO.GetBaseDirectory(), "Core2D.layout");
                if (fileIO.Exists(layoutPath))
                {
                    editor.OnLoadLayout(layoutPath);
                }

                var dockFactory = serviceProvider.GetService <IDockFactory>();
                editor.Layout = editor.Layout ?? dockFactory.CreateLayout();
                dockFactory.InitLayout(editor.Layout);

                var recentPath = System.IO.Path.Combine(fileIO.GetBaseDirectory(), "Core2D.recent");
                if (fileIO.Exists(recentPath))
                {
                    editor.OnLoadRecent(recentPath);
                }

                editor.CurrentTool     = editor.Tools.FirstOrDefault(t => t.Title == "Selection");
                editor.CurrentPathTool = editor.PathTools.FirstOrDefault(t => t.Title == "Line");
                editor.IsToolIdle      = true;
                editor.AboutInfo       = aboutInfo;

                var window = serviceProvider.GetService <Windows.MainWindow>();
                window.Closing += (sender, e) =>
                {
                    editor.Layout.Close();
                    editor.OnSaveLayout(layoutPath);
                    editor.OnSaveRecent(recentPath);
                    Selector.SaveSelectedTheme("Core2D.theme");
                };
                window.DataContext = editor;
                window.Show();
                Run(window);
            }
            catch (Exception ex)
            {
                log?.LogException(ex);
            }
        }
Exemple #20
0
        private void OnShowAbout()
        {
            if (aboutForm == null || aboutForm.IsDisposed)
            {
                aboutForm = new AboutInfo();
            }

            aboutForm.Show();
        }
Exemple #21
0
 public ActionResult Edit([Bind(Include = "Id,Title,Content,ButtonInfo,Name,Image,Position,CountryInfo,Faculty,EducationTitle,EducationInfo,PreviosTitle,Previosİnfo")] AboutInfo aboutInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aboutInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aboutInfo));
 }
        public AboutInfo GetAboutInfo()
        {
            var bitmap    = new BitmapImage(new Uri("pack://application:,,,/Resources/Media/Images/Application/3.png", UriKind.RelativeOrAbsolute));
            var aboutInfo = new AboutInfo(
                description: "An all in one modkit for modern CDPR games.",
                appIcon: bitmap,
                uriInfo: new UriInfo("https://github.com/WolvenKit/Wolven-kit", "Github Page")
                );

            return(aboutInfo);
        }
Exemple #23
0
        /// <summary>
        /// Initialize application context and displays main window.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        /// <param name="aboutInfo">The about information.</param>
        public void Start(IServiceProvider serviceProvider, AboutInfo aboutInfo)
        {
            InitializeConverters(serviceProvider);

            var log    = serviceProvider.GetService <ILog>();
            var fileIO = serviceProvider.GetService <IFileSystem>();

            log?.Initialize(System.IO.Path.Combine(fileIO?.GetBaseDirectory(), "Core2D.log"));

            try
            {
                var editor = serviceProvider.GetService <ProjectEditor>();

                var layoutPath = System.IO.Path.Combine(fileIO.GetBaseDirectory(), "Core2D.layout");
                if (fileIO.Exists(layoutPath))
                {
                    editor.OnLoadLayout(layoutPath);
                }

                var dockFactory = serviceProvider.GetService <IDockFactory>();
                editor.Layout = editor.Layout ?? dockFactory.CreateLayout();
                dockFactory.InitLayout(editor.Layout);

                var recentPath = System.IO.Path.Combine(fileIO.GetBaseDirectory(), "Core2D.recent");
                if (fileIO.Exists(recentPath))
                {
                    editor.OnLoadRecent(recentPath);
                }

                editor.CurrentTool     = editor.Tools.FirstOrDefault(t => t.Title == "Selection");
                editor.CurrentPathTool = editor.PathTools.FirstOrDefault(t => t.Title == "Line");
                editor.IsToolIdle      = true;
                editor.AboutInfo       = aboutInfo;

                var window = serviceProvider.GetService <Windows.MainWindow>();
                window.Closing += (sender, e) =>
                {
                    editor.Layout.Close();
                    editor.OnSaveLayout(layoutPath);
                    editor.OnSaveRecent(recentPath);
                };
                window.DataContext = editor;
                window.Show();
                Run(window);
            }
            catch (Exception ex)
            {
                log?.LogError($"{ex.Message}{Environment.NewLine}{ex.StackTrace}");
                if (ex.InnerException != null)
                {
                    log?.LogError($"{ex.InnerException.Message}{Environment.NewLine}{ex.InnerException.StackTrace}");
                }
            }
        }
Exemple #24
0
        public AboutInfo GetAboutInfo()
        {
            var aboutInfo = new AboutInfo(
                uriInfo: new UriInfo(Settings.Links.Homepage, "PresetMagician Homepage"),
                name: "PresetMagician"
                )
            {
                ShowLogButton = false
            };


            return(aboutInfo);
        }
        // GET: Manage/AboutInfoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AboutInfo aboutInfo = db.AboutInfo.Find(id);

            if (aboutInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(aboutInfo));
        }
 public static AboutResponse ToAboutResponse(this AboutInfo about)
 {
     return(new AboutResponse
     {
         Links = about.Links.Select(ToLinkResponse).ToList(),
         Description = about.Description,
         Name = about.Name,
         Owners = about.Owners.Select(ToOwnerResponse).ToList(),
         BuildInfo = new BuildInfo
         {
             Revision = about.Revision
         }
     });
 }
Exemple #27
0
        public AboutInfo Invoke()
        {
            try
            {
                AboutInfo aboutInfo = DriveService.GetAbout();

                return(aboutInfo);
            }
            catch (Exception exception)
            {
                Log.Error(exception);

                return(null);
            }
        }
        public ActionResult Create([Bind(Include = "Id,Title,Text,Photo")] AboutInfo aboutInfo, HttpPostedFileBase Photo)
        {
            if (ModelState.IsValid)
            {
                string fileName = DateTime.Now.ToString("yyyyMMddHHmmssff") + Photo.FileName;
                string path     = Server.MapPath("~/Uploads/");
                Photo.SaveAs(path + fileName);
                aboutInfo.Photo = fileName;
                db.AboutInfo.Add(aboutInfo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aboutInfo));
        }
Exemple #29
0
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);

            _processService = processService;

            var assembly = aboutInfo.Assembly;
            var version  = VersionHelper.GetCurrentVersion(assembly);

            Title          = assembly.Title();
            Version        = string.Format("v {0}", version);
            Url            = aboutInfo.Url;
            Copyright      = assembly.Copyright();
            ImageSourceUrl = aboutInfo.LogoImageSource;
            ShowLogButton  = aboutInfo.ShowLogButton;
            AppIcon        = IconHelper.GetApplicationIcon(assembly.Location, 256);
            OpenUrl        = new Command(OnOpenUrlExecute);
            OpenLog        = new Command(OnOpenLogExecute);
        }
Exemple #30
0
        /// <summary>
        /// Initialize application context and displays main window.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        /// <param name="aboutInfo">The about information.</param>
        public void Start(IServiceProvider serviceProvider, AboutInfo aboutInfo)
        {
            InitializeConverters(serviceProvider);

            var log    = serviceProvider.GetService <ILog>();
            var fileIO = serviceProvider.GetService <IFileSystem>();

            log?.Initialize(System.IO.Path.Combine(fileIO?.GetAssemblyPath(null), "Core2D.log"));

            try
            {
                var editor = serviceProvider.GetService <ProjectEditor>();

                var path = System.IO.Path.Combine(fileIO.GetAssemblyPath(null), "Core2D.recent");
                if (fileIO.Exists(path))
                {
                    editor.OnLoadRecent(path);
                }

                editor.CurrentView     = editor.Views.FirstOrDefault(v => v.Title == "Dashboard");
                editor.CurrentTool     = editor.Tools.FirstOrDefault(t => t.Title == "Selection");
                editor.CurrentPathTool = editor.PathTools.FirstOrDefault(t => t.Title == "Line");
                editor.IsToolIdle      = true;

                editor.AboutInfo = aboutInfo;

                var window = serviceProvider.GetService <Windows.MainWindow>();
                window.Closed     += (sender, e) => editor.OnSaveRecent(path);
                window.DataContext = editor;
                window.Show();
                Run(window);
            }
            catch (Exception ex)
            {
                log?.LogError($"{ex.Message}{Environment.NewLine}{ex.StackTrace}");
                if (ex.InnerException != null)
                {
                    log?.LogError($"{ex.InnerException.Message}{Environment.NewLine}{ex.InnerException.StackTrace}");
                }
            }
        }
        public IActionResult About()
        {
            var node = this.GetNodeSingleton();

            var aboutData = new AboutInfo()
            {
                About                 = "BlokcheChain/0.01-C#",
                NodeId                = node.NodeId,
                ChainId               = node.ChainId,
                NodeUrl               = node.SelfUrl,
                Peers                 = node.Peers.Keys.Count,
                CurrentDifficulty     = node.Chain.CurrentDifficulty,
                BlocksCount           = node.Chain.Blocks.Count,
                CumulativeDifficulty  = node.Chain.CalcCumulativeDifficulty(),
                ConfirmedTransactions = node.Chain.GetConfirmedTransactions().Count(),
                PendingTransactions   = node.Chain.PendingTransactions.Count,
            };


            return(Ok(aboutData));
        }
Exemple #32
0
 protected override async Task InitializeAsync()
 {
     AboutInfo = _aboutInfoService.GetAboutInfo();
 }
 public AboutInfo GetAboutInfo()
 {
     var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute));
     return aboutInfo;
 }
 private string GetApplicationInfoString()
 {
     AboutInfo aboutInfo = new AboutInfo(WebApplication.Instance);
     return aboutInfo.GetAboutInfoString();
 }
Exemple #35
0
 /// <summary>
 /// Method to invoke when the Help command is executed.
 /// </summary>
 private void OnHelpExecute()
 {
     var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute), 
         "/Orchestra.Examples.Ribbon.Microsoft;component/Resources/Images/CompanyLogo.png", 
         new UriInfo("http://www.catelproject.com", "Product website"));
     _uiVisualizerService.ShowDialog<AboutViewModel>(aboutInfo);
 }
    private string GetApplicationInfoString()
    {
        AboutInfo aboutInfo = new AboutInfo(WebApplication.Instance);

        return(aboutInfo.GetAboutInfoString());
    }
Exemple #37
0
 /// <summary>
 /// Method to invoke when the Help command is executed.
 /// </summary>
 private void OnHelpExecute()
 {
     var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute), null, "http://www.somecompany.com");
     _uiVisualizerService.ShowDialog<AboutViewModel>(aboutInfo);
 }