Exemplo n.º 1
0
		private void CustomInitializeComponent()
		{
			_savedConfig = StyleConfig.GetClone();

			EliminateDesignerBug(_appPropertyGrid);
			_appPropertyGrid.SelectedObject = GetWrapper(Config.GetClone());

			// HACK: rameel: Надоело, что PropertyGrid проматывает страницу в конец.
			_appPropertyGrid.SelectedGridItem = _appPropertyGrid
				.SelectedGridItem.Parent.Parent.GridItems[0];

			_dialogContainer =
				ApplicationManager
					.Instance
					.MainForm
					.ShortcutManager
					.GetDesignDialog();
			_hotKeysTab.Controls.Add(_dialogContainer.GetDialog());

			EliminateDesignerBug(_stylePropertyGrid);
			_stylePropertyGrid.SelectedObject = GetWrapper(Config.Instance.StyleConfig);

			// Удаляем стандартную закладку и кладем две наши, одна символизирует 
			// стандартные настройки, другая - расширенные. Реальное управление тем,
			// что показывать находится в this.StylePropertyGrid_PropertyTabChanged
			_stylePropertyGrid.PropertyTabs.RemoveTabType(
				typeof (PropertiesTab));

			_stylePropertyGrid.PropertyTabs.AddTabType(
				typeof (NormalStyleTab), PropertyTabScope.Static);
			_stylePropertyGrid.PropertyTabs.AddTabType(
				typeof (DetailStyleTab), PropertyTabScope.Static);
		}
Exemplo n.º 2
0
        private void CustomInitializeComponent()
        {
            _savedConfig = StyleConfig.GetClone();

            EliminateDesignerBug(_appPropertyGrid);
            _appPropertyGrid.SelectedObject = GetWrapper(Config.GetClone());

            // HACK: rameel: Надоело, что PropertyGrid проматывает страницу в конец.
            _appPropertyGrid.SelectedGridItem = _appPropertyGrid
                                                .SelectedGridItem.Parent.Parent.GridItems[0];

            _dialogContainer =
                ApplicationManager
                .Instance
                .MainForm
                .ShortcutManager
                .GetDesignDialog();
            _hotKeysTab.Controls.Add(_dialogContainer.GetDialog());

            EliminateDesignerBug(_stylePropertyGrid);
            _stylePropertyGrid.SelectedObject = GetWrapper(Config.Instance.StyleConfig);

            // Удаляем стандартную закладку и кладем две наши, одна символизирует
            // стандартные настройки, другая - расширенные. Реальное управление тем,
            // что показывать находится в this.StylePropertyGrid_PropertyTabChanged
            _stylePropertyGrid.PropertyTabs.RemoveTabType(
                typeof(PropertiesTab));

            _stylePropertyGrid.PropertyTabs.AddTabType(
                typeof(NormalStyleTab), PropertyTabScope.Static);
            _stylePropertyGrid.PropertyTabs.AddTabType(
                typeof(DetailStyleTab), PropertyTabScope.Static);
        }
Exemplo n.º 3
0
 //public void Show()
 //{
 //        if (CustomWindow.Current != null)
 //        {
 //                CustomWindow.Current.ShowDialog(this);
 //        }
 //}
 public void Show(IDialogContainer container)
 {
     if (container != null)
     {
         container.ShowDialog(this);
     }
 }
        public static Task <IDialogResult> RequestCloseAsync(this IDialogContainer container)
        {
            var tcs = new TaskCompletionSource <IDialogResult>();

            void OnDialogResult(object sender, IDialogResult result)
            {
                container.DialogResult -= OnDialogResult;
                tcs.SetResult(result);
            }

            container.DialogResult += OnDialogResult;
            container.Dismiss.Execute(null);
            return(tcs.Task);
        }
Exemplo n.º 5
0
        public ToolsView(IDialogContainer dialogContainer, Statistics statistics) :
            base("tools-panel")
        {
            this.dialogContainer = dialogContainer;
            this.statistics      = statistics;

            isVisible = true;

            permalinkElement             = Document.CreateElement("a");
            permalinkElement.ClassName   = "permalink";
            permalinkElement.TextContent = "permalink";

            likeButton = new Control("fb-like");
            likeButton.HtmlElement.SetAttribute("data-href", DocumentExtensions.GetMetaPropertyValue("og:url"));
            likeButton.HtmlElement.SetAttribute("data-layout", "standard");
            likeButton.HtmlElement.SetAttribute("data-action", "like");
            likeButton.HtmlElement.SetAttribute("data-show-faces", "true");
            likeButton.HtmlElement.SetAttribute("data-share", "false");

            Label shareLabel = new Label("share-label")
            {
                Text = "\u2764 share"
            };
            Label aboutLabel = new Label("about-label")
            {
                Text = "about"
            };

            shareLabel.HtmlElement.AddEventListener("mousedown", OnShareMouseDown, false);
            aboutLabel.HtmlElement.AddEventListener("mousedown", OnAboutMouseDown, false);

            this.AppendChild(likeButton);
            this.HtmlElement.AppendChild(permalinkElement);
            this.AppendChild(shareLabel);
            this.AppendChild(aboutLabel);
        }