Inheritance: IDisposable
Example #1
0
		static Style()
		{
			Directory.CreateDirectory(StylesDirectory);
			LoadStyles();
			if (!LoadCurrentStyle())
			{
				CurrentStyle = new Style();
				SaveCurrentStyle();
			}
		}
Example #2
0
		private static void AddToList(Style style, string stylePath)
		{
			if (!styles.ContainsKey(stylePath))
			{
				styles.Add(stylePath, style);
			}
			else // Replace the old style
			{
				styles.Remove(stylePath);
				styles.Add(stylePath, style);
			}
		}
Example #3
0
		private void cboStyle_SelectedIndexChanged(object sender, EventArgs e)
		{
			Style style = cboStyle.SelectedItem as Style;
			if (style != null)
			{
				selectedStyle = style;
				printPreview.InvalidatePreview();
			}
		}
Example #4
0
		private static bool LoadCurrentStyle()
		{
			return ((currentStyle = Load(userStylePath, false)) != null);
		}
Example #5
0
		private void printDocument_EndPrint(object sender, PrintEventArgs e)
		{
			if (printingStyle != null)
			{
				printingStyle.Dispose();
				printingStyle = null;
			}
		}
Example #6
0
		private void printDocument_BeginPrint(object sender, PrintEventArgs e)
		{
			if (document != null && printDocument.PrinterSettings.IsValid)
			{
				pageIndex = 0;
				printingStyle = MakeShadowsOpaque(selectedStyle);
				printDocument.DocumentName = document.Name;
			}
			else
			{
				e.Cancel = true;
			}
		}
Example #7
0
		private static Style MakeShadowsOpaque(Style selectedStyle)
		{
			Style converted = selectedStyle.Clone();
			converted.ShadowColor = DisableTransparency(converted.ShadowColor);
			return converted;
		}
Example #8
0
		private void LoadSettings()
		{
			// General settings
			cboLanguage.SelectedItem = UILanguage.CreateUILanguage(Settings.Default.UILanguage);
			chkRememberOpenProjects.Checked = Settings.Default.RememberOpenProjects;

			// Diagram settings
			chkUsePrecisionSnapping.Checked = DiagramEditor.Settings.Default.UsePrecisionSnapping;
			if (DiagramEditor.Settings.Default.ShowChevron == ChevronMode.Always)
				radChevronAlways.Checked = true;
			else if (DiagramEditor.Settings.Default.ShowChevron == ChevronMode.AsNeeded)
				radChevronAsNeeded.Checked = true;
			else
				radChevronNever.Checked = true;

			if (DiagramEditor.Settings.Default.UseClearType == ClearTypeMode.Always)
				radClearTypeAlways.Checked = true;
			else if (DiagramEditor.Settings.Default.UseClearType == ClearTypeMode.WhenZoomed)
				radClearTypeWhenZoomed.Checked = true;
			else
				radClearTypeNever.Checked = true;
			chkClearTypeForImages.Checked = DiagramEditor.Settings.Default.UseClearTypeForImages;

			// Style settings
			savedStyle = (Style) Style.CurrentStyle.Clone();
			stylePropertyGrid.SelectedObject = Style.CurrentStyle;
		}
Example #9
0
		private void ChangeCurrentStyle(Style style)
		{
			Style.CurrentStyle = style;
			stylePropertyGrid.SelectedObject = Style.CurrentStyle;
			if (StyleModified != null)
				StyleModified(this, EventArgs.Empty);
		}