Exemple #1
0
        public ShellViewModel()
        {
            DisplayName = "LiteDB Explorer";

            WindowMenu = IoC.Get <IShellMenu>();

            WindowRightMenu = IoC.Get <IShellRightMenu>();

            StatusBarContent = IoC.Get <IShellStatusBar>();

            LeftContent = IoC.Get <IDocumentExplorer>();

            MainContent = IoC.Get <IDocumentSet>();

            if (Properties.Settings.Default.ShowStartPageOnOpen)
            {
                MainContent.OpenDocument <IStartupDocument>();
            }

            MainContent.ActiveDocumentChanged += (sender, args) =>
            {
                if (!MainContent.Documents.Any() && Properties.Settings.Default.ShowStartOnCloseAll)
                {
                    MainContent.OpenDocument <IStartupDocument>();
                }
            };
        }
Exemple #2
0
 private async void Grid_Loaded(object sender, RoutedEventArgs e)
 {
     //Inital setup
     Navigation.Init(this);
     MainContent.Navigate(new Intro());
     //await Navigation.Navigate(new Intro());
 }
 public void Show()
 {
     IsVisible = true;
     MainContent.FadeTo(1);
     MainContent.TranslateTo(MainContent.TranslationX, 0);
     ShadowView.IsVisible = true;
 }
 private void ShowSIDConfirmBox()
 {
     PopupContainer.IsVisible = true;
     MainContent.FadeTo(1);
     MainContent.TranslateTo(MainContent.TranslationX, 0);
     ShadowView.IsVisible = true;
 }
Exemple #5
0
        public static MvcHtmlString dislpayArticles(this HtmlHelper html)
        {
            MainContent content = new MainContent();
            var         div     = new TagBuilder("div");

            div.MergeAttribute("class", "content");
            foreach (var item in MainContent.articles)
            {
                var innerDiv = new TagBuilder("div");
                innerDiv.MergeAttribute("class", "contentBlock");
                var headerH4 = new TagBuilder("h4");
                headerH4.SetInnerText(item.Name);
                var textH6 = new TagBuilder("h6");
                textH6.SetInnerText(item.Text);
                textH6.MergeAttribute("class", "contentText");
                var dateDiv = new TagBuilder("div");
                dateDiv.MergeAttribute("class", "contentDate");
                var dateH6 = new TagBuilder("h6");
                dateH6.SetInnerText("Post date: " + item.Data.ToString("d"));
                dateDiv.InnerHtml  += dateH6.ToString();
                innerDiv.InnerHtml += headerH4.ToString();
                innerDiv.InnerHtml += textH6.ToString();
                innerDiv.InnerHtml += dateDiv.ToString();
                div.InnerHtml      += innerDiv.ToString();
            }
            return(new MvcHtmlString(div.ToString()));
        }
 protected override async void OnViewLoaded(object view)
 {
     if (Properties.Settings.Default.ShowStartPageOnOpen)
     {
         await MainContent.OpenDocument <IStartupDocument>();
     }
 }
Exemple #7
0
 private async void MainContentOnActiveDocumentChanged(object sender, EventArgs e)
 {
     if (!MainContent.Documents.Any() && Properties.Settings.Default.ShowStartOnCloseAll)
     {
         await MainContent.OpenDocument <IStartupDocument>();
     }
 }
        protected override async void OnViewLoaded(object view)
        {
            ToolPanelsContent.ActivateItem(IoC.Get <IOutput>());

            if (Properties.Settings.Default.ShowNavigationPanelOnOpen)
            {
                ShellLayoutController.Current.LeftContentIsVisible = true;
            }

            if (Properties.Settings.Default.ShowStartPageOnOpen)
            {
                await MainContent.OpenDocument <IStartupDocument>();
            }

            if (Properties.Settings.Default.Diagnostics_ShowManagedMemory)
            {
                StatusBarContent.ActivateContent(new MemoryUsageStatusButton().Start(), StatusBarContentLocation.Right);
            }

            CommandManager.InvalidateRequerySuggested();

            if (!AppConstants.IsDebug)
            {
                _ = Task.Delay(TimeSpan.FromSeconds(30))
                    .ContinueWith(task => { OnUIThread(async() => await AppUpdateManager.Current.CheckForUpdates(false)); })
                    .ConfigureAwait(false);
            }
        }
Exemple #9
0
        private void Window_Activated(object sender, EventArgs e)
        {
            MainContent.InvalidateVisual();

            TxtSearch.Focus();
            TxtSearch.CaretIndex = TxtSearch.Text.Length;
        }
Exemple #10
0
        private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
        {
            if (CoreManager.needInit)
            {
            }
            else
            {
                if (args.IsSettingsSelected)
                {
                    MainContent.Navigate(typeof(SettingsPage));
                }
                else
                {
                    NavigationViewItem item = args.SelectedItem as NavigationViewItem;
                    switch (item.Tag)
                    {
                    case Tag_StartPage:
                        MainContent.Navigate(typeof(StartPage));
                        break;

                    case Tag_LaunchOptions:
                        MainContent.Navigate(typeof(LaunchOptionsPage));
                        break;

                    case Tag_Download:
                        MainContent.Navigate(typeof(DownloadPage));
                        break;
                    }
                }
            }
        }
Exemple #11
0
        private void ExportDivContentToPDF()
        {
            System.Web.HttpResponse Response = System.Web.HttpContext.Current.Response;
            try
            {
                // create an API client instance
                string          userName = ConfigurationManager.AppSettings["pdfcrowdUsername"].ToString();
                string          APIKey   = ConfigurationManager.AppSettings["pdfcrowdAPIKey"].ToString();
                pdfcrowd.Client client   = new pdfcrowd.Client(userName, APIKey);

                // convert a web page and write the generated PDF to a memory stream
                MemoryStream Stream = new MemoryStream();
                //client.convertURI("http://www.google.com", Stream);

                // set HTTP response headers
                Response.Clear();
                Response.AddHeader("Content-Type", "application/pdf");
                Response.AddHeader("Cache-Control", "max-age=0");
                Response.AddHeader("Accept-Ranges", "none");
                Response.AddHeader("Content-Disposition", "attachment; filename=TigerReservePdfExport.pdf");
                System.IO.StringWriter       stringWrite1 = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter htmlWrite1   = new HtmlTextWriter(stringWrite1);
                MainContent.RenderControl(htmlWrite1);
                client.convertHtml(stringWrite1.ToString(), Stream);
                // send the generated PDF
                Stream.WriteTo(Response.OutputStream);
                Stream.Close();
                Response.Flush();
                Response.End();
            }
            catch (pdfcrowd.Error why)
            {
                Response.Write(why.ToString());
            }
        }
Exemple #12
0
        private void format_formatCodeButton_Click(object sender, EventArgs e)
        {
            if (activeRichTextBox == null)
            {
                return;
            }

            Font f;

            if (MainContent.GetFontFromStyleString("Code Fragment", out f))
            {
                if (activeRichTextBox.SelectedText != "" && format_languageSelector.SelectedItem != null)
                {
                    activeRichTextBox.SelectionFont = f;

                    int s = activeRichTextBox.SelectionStart;
                    int l = activeRichTextBox.SelectionLength;
                    activeRichTextBox.SelectedText = activeRichTextBox.SelectedText.Replace("\t", "   ");
                    RtfCodeFormatter.FormatCodeFragment(format_languageSelector.SelectedItem.ToString(), ref activeRichTextBox, s, s + l);

                    activeRichTextBox.SelectionStart  = activeRichTextBox.SelectionStart + activeRichTextBox.SelectionLength;
                    activeRichTextBox.SelectionLength = 0;
                    activeRichTextBox.SelectionFont   = activeRichTextBox.Font;
                }
            }
        }
Exemple #13
0
        private void ExportDivContentToMsExcel()
        {
            try
            {
                StringBuilder StrHtmlGenerate = new StringBuilder();
                StringBuilder StrExport       = new StringBuilder();

                StrExport.Append(@"<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'><head><title>Time</title>");
                StrExport.Append(@"<body lang=EN-US style='mso-element:header' id=h1><span style='mso--code:DATE'></span><div class=Section1>");
                StrExport.Append("<DIV  style='font-size:12px;'>");
                System.IO.StringWriter       stringWrite = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter htmlWrite   = new HtmlTextWriter(stringWrite);
                MainContent.RenderControl(htmlWrite);
                StrExport.Append(stringWrite);
                StrExport.Append("</div></body></html>");
                string strFile        = "QuarterlyReportExcelExport.xls";
                string strcontentType = "application/excel";
                Response.ClearContent();
                Response.ClearHeaders();
                Response.BufferOutput = true;
                Response.ContentType  = strcontentType;
                Response.AddHeader("Content-Disposition", "attachment; filename=" + strFile);
                Response.Write(StrExport.ToString());
                Response.Flush();
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
            }
        }
Exemple #14
0
 public AdminForm()
 {
     InitializeComponent();
     mainContent  = new MainContent();
     movieContent = new AdminMovieContent();
     MainCheck_Change();
 }
        public ShellViewModel()
        {
            DisplayName = "LiteDB Explorer";

            WindowMenu = IoC.Get <IShellMenu>();

            WindowRightMenu = IoC.Get <IShellRightMenu>();

            StatusBarContent = IoC.Get <IShellStatusBar>();

            LeftContent = IoC.Get <IDocumentExplorer>();

            MainContent = IoC.Get <IDocumentSet>();

            var initialDocument = MainContent.NewDocumentFactory();

            if (initialDocument != null)
            {
                MainContent.OpenDocument(initialDocument);
            }

            MainContent.ActiveDocumentChanged += (sender, args) =>
            {
                if (!MainContent.Documents.Any() && initialDocument != null)
                {
                    MainContent.OpenDocument(initialDocument);
                }
            };
        }
Exemple #16
0
        private void DeleteAction_Click(object s, RoutedEventArgs ea)
        {
            MainContent mc = ((MainWindow)Application.Current.MainWindow).MainContent;

            List <Monument> conflicting = mc.tagConflictingMonuments(Id);

            if (conflicting == null)
            {
                AreYouSure ars = new AreYouSure("Are you sure you want to delete this tag?");
                ars.Owner = Application.Current.MainWindow;
                ars.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                ars.ShowDialog();

                if (ars.DialogResult.HasValue && !ars.DialogResult.Value)
                {
                    return;
                }
            }
            else
            {
                DeleteTagDialog dtDialog = new DeleteTagDialog(new ObservableCollection <Monument>(conflicting));

                dtDialog.Owner = Application.Current.MainWindow;
                dtDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                dtDialog.ShowDialog();
                if (dtDialog.DialogResult.HasValue && dtDialog.DialogResult.Value)
                {
                    mc.removeTagFromMonuments(Id);
                }
                else
                {
                    return;
                }
            }


            DoubleAnimation animation = new DoubleAnimation();

            animation.To = 0;
            //animation.From = 1;
            animation.Duration       = TimeSpan.FromMilliseconds(300);
            animation.EasingFunction = new QuadraticEase();

            Storyboard sb = new Storyboard();

            sb.Children.Add(animation);

            Root.Opacity    = 1;
            Root.Visibility = Visibility.Visible;

            Storyboard.SetTarget(sb, Root);
            Storyboard.SetTargetProperty(sb, new PropertyPath(Control.OpacityProperty));

            sb.Completed += delegate(object sender, EventArgs e)
            {
                Root.Visibility = Visibility.Collapsed;
                this.RemoveTagCallback(this.Id);
            };
            sb.Begin();
        }
        public MainPageViewModel()
        {
            var presenter = (Bxf.IPresenter)Bxf.Shell.Instance;

            presenter.OnShowError += (message, caption) =>
            {
                MessageBox.Show(message, caption, MessageBoxButton.OK);
            };

            presenter.OnShowStatus += (status) =>
            {
            };

            presenter.OnShowView += (view, region) =>
            {
                if (region == "Content")
                {
                    MainContent.Add(view.ViewInstance);
                    while (MainContent.Count > 1)
                    {
                        MainContent.RemoveAt(0);
                    }
                }
            };

            if (!DesignerProperties.IsInDesignTool)
            {
                ListPersons();
            }
        }
        private async void ToggleExpand(object sender, RoutedEventArgs e)
        {
            var panel = Window.Current.Content.FindControl <DropShadowPanel>("NowPlaying");

            if (panel == null)
            {
                return;
            }

            // If the main content is hidden, we want to expand
            if (MainContent.Opacity == 0.0f)
            {
                var myDoubleAnimation = new DoubleAnimation
                {
                    To                       = 1500,
                    From                     = 430,
                    Duration                 = new Duration(TimeSpan.FromMilliseconds(250)),
                    EasingFunction           = new CubicEase(),
                    EnableDependentAnimation = true
                };

                Storyboard.SetTarget(myDoubleAnimation, panel);
                Storyboard.SetTargetProperty(myDoubleAnimation, "MaxWidth");

                var storyboard = new Storyboard();
                storyboard.Children.Add(myDoubleAnimation);

                await Task.WhenAll(new[]
                {
                    MainContent.Fade(1.0f, 250, 0, EasingType.Quadratic).StartAsync(),
                    ExpandToggle.Rotate(0, 9f, 9f, 250, 0, EasingType.Quadratic).StartAsync(),
                    storyboard.BeginAsync()
                });
            }
            else
            {
                var myDoubleAnimation = new DoubleAnimation
                {
                    To                       = 430,
                    From                     = 1500,
                    Duration                 = new Duration(TimeSpan.FromMilliseconds(250)),
                    EasingFunction           = new CubicEase(),
                    EnableDependentAnimation = true
                };

                Storyboard.SetTarget(myDoubleAnimation, panel);
                Storyboard.SetTargetProperty(myDoubleAnimation, "MaxWidth");

                var storyboard = new Storyboard();
                storyboard.Children.Add(myDoubleAnimation);

                await Task.WhenAll(new[]
                {
                    MainContent.Fade(0.0f, 250, 0, EasingType.Bounce).StartAsync(),
                    ExpandToggle.Rotate(178, 9f, 9f, 250, 0, EasingType.Quadratic).StartAsync(),
                    storyboard.BeginAsync()
                });
            }
        }
Exemple #19
0
 public override object GetResult()
 {
     MainContent.Add(new MyImage("logo"));
     BeginWaiting(() => {
         MyApp.Execute("Login");
     });
     return(base.GetResult());
 }
Exemple #20
0
        private async void OnInitializationComplete(object sender, EventArgs e)
        {
            CoreManager.needInit = false;
            await CoreManager.InitAppAsync();

            MainContent.Navigate(typeof(StartPage));
            ViewModel.IsNavItemEnable = true;
        }
Exemple #21
0
        public ActionResult DeleteConfirmed(int id)
        {
            MainContent mainContent = db.MainContents.Find(id);

            db.MainContents.Remove(mainContent);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #22
0
 public MainForm(Member_tbl memberTbl)
 {
     InitializeComponent();
     this.memberTbl = memberTbl;
     mainContent    = new MainContent();
     movieContent   = new MovieContent();
     MainCheck_Change();
 }
 // Use this for initialization
 protected override void Start()
 {
     base.Start();
     mainContent = transform.parent.gameObject.GetComponent <MainContent>();
     BuyBtn.onClick.AddListener(OnClick);
     GoBtn.onClick.AddListener(OnGoClick);
     TimeManager.instance.SetMapsView(this);
     SetFirstPopUp();
 }
 public void Show(QuaddieGroup quaddie)
 {
     QuaddieLayout.Children.Clear();
     QuaddieLayout.Children.Add(GenerateQuaddieView(quaddie));
     IsVisible = true;
     MainContent.FadeTo(1);
     MainContent.TranslateTo(MainContent.TranslationX, 0);
     ShadowView.IsVisible = true;
 }
        private async Task ToggleExpandAsync()
        {
            if (!(App.Shell?.GetName("NowPlaying") is DropShadowPanel panel))
            {
                return;
            }

            // If the main content is hidden, we want to expand
            if (MainContent.Opacity == 0.0f)
            {
                var myDoubleAnimation = new DoubleAnimation
                {
                    To                       = 1500,
                    From                     = 450,
                    Duration                 = new Duration(TimeSpan.FromMilliseconds(250)),
                    EasingFunction           = new CubicEase(),
                    EnableDependentAnimation = true
                };

                Storyboard.SetTarget(myDoubleAnimation, panel);
                Storyboard.SetTargetProperty(myDoubleAnimation, "MaxWidth");

                var storyboard = new Storyboard();
                storyboard.Children.Add(myDoubleAnimation);

                await Task.WhenAll(new Task[]
                {
                    MainContent.Fade(1.0f, 250, 0, EasingType.Quadratic).StartAsync(),
                    ExpandToggle.Rotate(0, 9f, 9f, 250, 0, EasingType.Quadratic).StartAsync(),
                    storyboard.BeginAsync()
                });
            }
            else
            {
                var myDoubleAnimation = new DoubleAnimation
                {
                    To                       = 450,
                    From                     = 1500,
                    Duration                 = new Duration(TimeSpan.FromMilliseconds(250)),
                    EasingFunction           = new CubicEase(),
                    EnableDependentAnimation = true
                };

                Storyboard.SetTarget(myDoubleAnimation, panel);
                Storyboard.SetTargetProperty(myDoubleAnimation, "MaxWidth");

                var storyboard = new Storyboard();
                storyboard.Children.Add(myDoubleAnimation);

                await Task.WhenAll(new Task[]
                {
                    MainContent.Fade(0.0f, 250, 0, EasingType.Bounce).StartAsync(),
                    ExpandToggle.Rotate(178, 9f, 9f, 250, 0, EasingType.Quadratic).StartAsync(),
                    storyboard.BeginAsync()
                });
            }
        }
Exemple #26
0
        private void OnTextComposition(object sender, TextCompositionEventArgs e)
        {
            MainContent content = ((MainWindow)Application.Current.MainWindow).MainContent;

            if (content.DemonAlive)
            {
                content.Demon.Abort();
                content.DemonAlive = false;
            }
        }
Exemple #27
0
        private void BackButtonPage_BackRequested(object sender, BackRequestedEventArgs e)
        {
            if (MainContent.CanGoBack)
            {
                //e.Handled = true;
                MainContent.GoBack();
            }

            checkBackButtonVisivility();
        }
Exemple #28
0
 public ActionResult Edit([Bind(Include = "Id,Title,Content,Date,BigContent")] MainContent mainContent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mainContent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mainContent));
 }
        private void GotoReadyState(object sender, RoutedEventArgs e)
        {
            var sut = MainContent.FindFirstChild <Rectangle>(x => x.Name == "SUT");

            var colors = new [] { Colors.Blue, Colors.Pink, Colors.Yellow, Colors.Lime };
            var color  = colors[random.Next(colors.Length)];

            sut.Fill = new SolidColorBrush(color);

            VisualStateManager.GoToState(MainContent, "Ready", true);
        }
Exemple #30
0
        public ActionResult Create([Bind(Include = "Id,Title,Content,Date,BigContent")] MainContent mainContent)
        {
            if (ModelState.IsValid)
            {
                db.MainContents.Add(mainContent);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mainContent));
        }
Exemple #31
0
 internal void createModel(MainContent parent)
 {
     switch (roomType) {
     case RoomType.BOX:
         model = (GameObject)GameObject.Instantiate(parent.BoxRoomPrefab, pos, Quaternion.identity);
         model.transform.localScale = new Vector3(w*2,1,h*2);
         break;
     case RoomType.CIRCLE:
         model = (GameObject)GameObject.Instantiate(parent.CircleRoomPrefab, pos, Quaternion.identity);
         model.transform.localScale = new Vector3(w*2,1,h*2);
         break;
     }
 }
Exemple #32
0
    internal void createModel(MainContent parent)
    {
        //実際に部屋の真ん中から道を作ると道と重なってしまうので部屋の端に寄せる

        var wayModel = (GameObject)GameObject.Instantiate(parent.WayPrefab, pos, Quaternion.identity);
        wayModel.name = "WayPoint";
        model.Add(wayModel);
        foreach(var way in link){
            if(way.model.Count > 0){
                continue;//作成済み
            }
            //みち
            wayModel = (GameObject)GameObject.Instantiate(parent.WayPrefab, (way.pos + pos)/2, Quaternion.LookRotation(way.pos - pos));
            var modPos = way.pos - pos;
            wayModel.transform.localScale = new Vector3(1,1, modPos.magnitude-1);
            wayModel.name = "Way";
            model.Add(wayModel);

            way.createModel(parent);
        }
    }
    protected void LoadFeatured()
    {
        string strFolder = "images";

        MainContent feature = new MainContent();
        DataSet dsfeature = new DataSet();
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        System.Text.StringBuilder sbImages = new System.Text.StringBuilder();
        System.Text.StringBuilder sbLink = new System.Text.StringBuilder();
        //---

        dsfeature = feature.getAllFeature();

        sb.AppendLine("<span id=\"loading\">Loading</span>");
        sb.AppendLine("<ul id=\"pictures\">");
        foreach (DataTable table in dsfeature.Tables)
        {
            foreach (DataRow row in table.Rows)
            {
                //sb.AppendLine("<li><a href=\"#\" class=\"" + (row["ContId"].ToString() == ContSelected.ToString() ? "current" : "") + "\">" + row["ContTitle"].ToString() + "</a></li>");

                sbImages.AppendLine("<li><img src=\"" + strFolder + "/" + row["FeatFile"].ToString() + "\" alt=\"" + row["FeatAlt"].ToString() + "\" title=\"" + row["FeatTitle"].ToString() + "\" /></li>");

                sbLink.AppendLine("<li><a href=\"" + row["FeatLink"].ToString() + "\">" + row["FeatTitle"].ToString() + "</a></li>");
            }

        }
        sb.Append(sbImages.ToString());
        sb.AppendLine("</ul>");
        sb.AppendLine("<ul id=\"menu\">");
        sb.Append(sbLink.ToString());
        sb.AppendLine("</ul>");
        sb.AppendLine("<input style=\"display: none\" type=\"checkbox\" name=\"auto\" checked=\"checked\" id=\"option-auto\" />");

        slideshow.InnerHtml = sb.ToString();
    }