Ejemplo n.º 1
0
		public void CopyFolder()
		{
			var folder = gridView.GetFocusedRow() as LibraryFolder;
			if (folder == null) return;
			FolderInBuffer = null;
			FolderCopied?.Invoke(this, new FolderCopiedEventArgs { SourceFolder = folder });
		}
		public FolderClipboardManager(
			LibraryFolder dataSource,
			ToolStripMenuItem copyContainer,
			ToolStripMenuItem moveContainer)
		{
			_dataSource = dataSource;
			_copyContainer = copyContainer;
			_moveContainer = moveContainer;
		}
		public FormResetLinkSettings(LibraryFolder targetFolder) : this()
		{
			Text = "Reset all Links in this Window";
			labelControlTitle.Text = String.Format(labelControlTitle.Text,
				String.Format("Window: <b>{0}</b>", targetFolder.Name),
				String.Empty);

			LoadSettingsGroups(GetLinksCustomizedSettings(targetFolder.AllLinks));
		}
		public ClassicFolderBox(LibraryFolder dataSource)
			: base(dataSource)
		{
			SelectionManager.SelectionChanged += OnSelectionChanged;
			DataStateObserver.Instance.DataChanged += OnLinksDeleted;

			toolStripMenuItemFolderDeleteSecurity.Visible = MainController.Instance.Settings.EditorSettings.EnableSecurityEdit;
			toolStripMenuItemFolderDeleteTags.Visible = MainController.Instance.Settings.EditorSettings.EnableTagsEdit;

			_folderClipboardManager = new FolderClipboardManager(
				DataSource,
				toolStripMenuItemFolderCopy,
				toolStripMenuItemFolderMove);
			_folderClipboardManager.FolderMoved += OnFolderMoved;

			contextMenuStripFolderProperties.DefaultDropDownDirection = Screen.AllScreens.Length > 0 && DataSource.ColumnOrder > 1
				? ToolStripDropDownDirection.Left
				: ToolStripDropDownDirection.Default;
			contextMenuStripSecurity.DefaultDropDownDirection = Screen.AllScreens.Length > 0 && DataSource.ColumnOrder > 1
				? ToolStripDropDownDirection.Left
				: ToolStripDropDownDirection.Default;

			InitContextMenuEditors();

			// 
			// grFiles
			// 
			grFiles.CellBeginEdit += OnGridCellBeginEdit;
			grFiles.CellMouseClick += OnGridCellMouseClick;
			grFiles.CellMouseDoubleClick += OnGridCellMouseDoubleClick;
			grFiles.CellMouseDown += OnGridCellMouseDown;
			grFiles.CellMouseLeave += OnGridCellMouseLeave;
			grFiles.CellMouseMove += OnGridCellMouseMove;
			grFiles.CellMouseUp += OnGridCellMouseUp;
			grFiles.SelectionChanged += OnGridSelectionChanged;
			grFiles.DragDrop += OnDragDrop;
			grFiles.DragOver += OnDragOver;
			grFiles.DragLeave += OnDragLeave;
			grFiles.MouseDown += OnGridMouseDown;
			grFiles.MouseClick += OnGridMouseClick;
			// 
			// labelControlText
			// 
			labelControlText.Click += OnHeaderClick;
			labelControlText.DoubleClick += OnHeaderDoubleClick;
			labelControlText.DragDrop += OnDragDrop;
			labelControlText.DragOver += OnDragOver;
			labelControlText.DragLeave += OnDragLeave;
			labelControlText.MouseDown += OnHeaderMouseDown;
			labelControlText.MouseMove += OnHeaderMouseMove;
		}
Ejemplo n.º 5
0
		public FormWindow(LibraryFolder folder, WindowSettingsEditFormParams formParameters)
		{
			InitializeComponent();
			_folder = folder;
			_formParameters = formParameters;
			Text = String.Format(_formParameters.Title, folder.Name);
			Width = _formParameters.Width;
			Height = _formParameters.Height;
			Load += (o, e) => LoadData();
			ckApllyForAllWindowsAppearance.Checked = _folder.Page.Library.Settings.ApplyAppearanceForAllWindows;
			ckApllyForAllWindowsWidget.Checked = _folder.Page.Library.Settings.ApplyWidgetForAllWindows;
			ckApllyForAllWindowsBanner.Checked = _folder.Page.Library.Settings.ApplyBannerForAllWindows;
			xtraTabPageBanner.PageEnabled = MainController.Instance.Lists.Banners.MainFolder.ExistsLocal();
			xtraTabPageWidget.PageEnabled = MainController.Instance.Lists.Widgets.MainFolder.ExistsLocal();
			buttonEditWindowHeaderFont.ButtonClick += EditorHelper.FontEdit_ButtonClick;
			buttonEditWindowHeaderFont.Click += EditorHelper.FontEdit_Click;
			textEditName.MouseDown += EditorHelper.EditorMouseDown;
			textEditName.MouseUp += EditorHelper.EditorMouseUp;
			textEditName.Enter += EditorHelper.EditorEnter;
			if ((base.CreateGraphics()).DpiX > 96)
			{
				laHeaderBackColor.Font = new Font(laHeaderBackColor.Font.FontFamily, laHeaderBackColor.Font.Size - 2, laHeaderBackColor.Font.Style);
				laHeaderFont.Font = new Font(laHeaderFont.Font.FontFamily, laHeaderFont.Font.Size - 2, laHeaderFont.Font.Style);
				laHeaderForeColor.Font = new Font(laHeaderForeColor.Font.FontFamily, laHeaderForeColor.Font.Size - 2, laHeaderForeColor.Font.Style);
				laBorderColor.Font = new Font(laBorderColor.Font.FontFamily, laBorderColor.Font.Size - 2, laBorderColor.Font.Style);
				laBackColor.Font = new Font(laBackColor.Font.FontFamily, laBackColor.Font.Size - 2, laBackColor.Font.Style);
				laForeColor.Font = new Font(laForeColor.Font.FontFamily, laForeColor.Font.Size - 2, laForeColor.Font.Style);
				laHeaderAlignment.Font = new Font(laHeaderAlignment.Font.FontFamily, laHeaderAlignment.Font.Size - 2, laHeaderAlignment.Font.Style);
				ckApllyForAllWindowsAppearance.Font = new Font(ckApllyForAllWindowsAppearance.Font.FontFamily, ckApllyForAllWindowsAppearance.Font.Size - 2, ckApllyForAllWindowsAppearance.Font.Style);
				ckApllyForAllWindowsBanner.Font = new Font(ckApllyForAllWindowsBanner.Font.FontFamily, ckApllyForAllWindowsBanner.Font.Size - 2, ckApllyForAllWindowsBanner.Font.Style);
				ckApllyForAllWindowsWidget.Font = new Font(ckApllyForAllWindowsWidget.Font.FontFamily, ckApllyForAllWindowsWidget.Font.Size - 2, ckApllyForAllWindowsWidget.Font.Style);
				rbHeaderAlignmentCenter.Font = new Font(rbHeaderAlignmentCenter.Font.FontFamily, rbHeaderAlignmentCenter.Font.Size - 2, rbHeaderAlignmentCenter.Font.Style);
				rbHeaderAlignmentLeft.Font = new Font(rbHeaderAlignmentLeft.Font.FontFamily, rbHeaderAlignmentLeft.Font.Size - 2, rbHeaderAlignmentLeft.Font.Style);
				rbWindowHeaderAlignmentRight.Font = new Font(rbWindowHeaderAlignmentRight.Font.FontFamily, rbWindowHeaderAlignmentRight.Font.Size - 2, rbWindowHeaderAlignmentRight.Font.Style);
				xtraTabControlWindowProperties.Appearance.Font = new Font(xtraTabControlWindowProperties.Appearance.Font.FontFamily, xtraTabControlWindowProperties.Appearance.Font.Size - 2, xtraTabControlWindowProperties.Appearance.Font.Style);
				xtraTabControlWindowProperties.AppearancePage.Header.Font = new Font(xtraTabControlWindowProperties.AppearancePage.Header.Font.FontFamily, xtraTabControlWindowProperties.AppearancePage.Header.Font.Size - 2, xtraTabControlWindowProperties.AppearancePage.Header.Font.Style);
				xtraTabControlWindowProperties.AppearancePage.HeaderActive.Font = new Font(xtraTabControlWindowProperties.AppearancePage.HeaderActive.Font.FontFamily, xtraTabControlWindowProperties.AppearancePage.HeaderActive.Font.Size - 2, xtraTabControlWindowProperties.AppearancePage.HeaderActive.Font.Style);
				xtraTabControlWindowProperties.AppearancePage.HeaderDisabled.Font = new Font(xtraTabControlWindowProperties.AppearancePage.HeaderDisabled.Font.FontFamily, xtraTabControlWindowProperties.AppearancePage.HeaderDisabled.Font.Size - 2, xtraTabControlWindowProperties.AppearancePage.HeaderDisabled.Font.Style);
				xtraTabControlWindowProperties.AppearancePage.HeaderHotTracked.Font = new Font(xtraTabControlWindowProperties.AppearancePage.HeaderHotTracked.Font.FontFamily, xtraTabControlWindowProperties.AppearancePage.HeaderHotTracked.Font.Size - 2, xtraTabControlWindowProperties.AppearancePage.HeaderHotTracked.Font.Style);
			}
		}
Ejemplo n.º 6
0
		public BaseFolderBox(LibraryFolder dataSource)
		{
			InitializeComponent();

			grFiles.CellPainting += OnGridCellPainting;
			grFiles.CellFormatting += OnGridCellFormatting;
			Disposed += OnDispose;

			DataSource = dataSource;

			RichTextControl = new RichTextBox();
			RichTextControl.WordWrap = true;
			RichTextControl.ScrollBars = RichTextBoxScrollBars.None;

			UpdateFont();

			grFiles.RowTemplate = new LinkRow();
			grFiles.RowTemplate.CreateCells(grFiles);
			SetupView();
			LoadData();
		}
		private static void ImportData(
			this SoapLibraryFolder target,
			LibraryFolder source)
		{
			var imageConverter = TypeDescriptor.GetConverter(typeof(Bitmap));
			target.id = source.ExtId.ToString();
			target.pageId = source.Page.ExtId.ToString();
			target.libraryId = source.Page.Library.ExtId.ToString();
			target.name = source.Name;
			target.columnOrder = source.ColumnOrder;
			target.rowOrder = source.RowOrder;
			target.windowBackColor = source.Settings.BackgroundWindowColor.ToHex();
			target.windowForeColor = source.Settings.ForeWindowColor.ToHex();
			target.headerBackColor = source.Settings.BackgroundHeaderColor.ToHex();
			target.headerForeColor = source.Settings.ForeHeaderColor.ToHex();
			target.borderColor = source.Settings.BorderColor.ToHex();
			target.headerAlignment = source.Settings.HeaderAlignment.ToString().ToLower();
			target.enableWidget = source.Widget.Enabled;
			target.widget = Convert.ToBase64String((byte[])imageConverter.ConvertTo(source.Widget.DisplayedImage, typeof(byte[])));
			target.windowFont = new Font();
			target.windowFont.ImportData(source.Settings.WindowFont);
			target.headerFont = new Font();
			target.headerFont.ImportData(source.Settings.HeaderFont);
			target.dateAdd = source.AddDate.ToString("MM/dd/yyyy hh:mm:ss tt");
			target.dateModify = source.LastModified.ToString("MM/dd/yyyy hh:mm:ss tt");

			#region Banner
			target.banner = new SoapBanner();
			target.banner.libraryId = source.Page.Library.ExtId.ToString();
			target.banner.ImportData(source.Banner);
			#endregion

			#region Files
			var links = new List<SoapLibraryLink>();
			foreach (var sourceLink in source.AllLinks.Where(link =>
				!(link is LibraryFileLink && ((LibraryFileLink)link).IsDead) &&
				!link.Security.IsForbidden &&
				(!link.Security.IsRestricted || !String.IsNullOrEmpty(link.Security.AssignedUsers) || !String.IsNullOrEmpty(link.Security.DeniedUsers))))
			{
				var link = new SoapLibraryLink();
				link.ImportData(sourceLink);
				links.Add(link);
			}
			target.files = links.ToArray();
			#endregion
		}
Ejemplo n.º 8
0
		public void MoveFolderToPosition(LibraryFolder folder, int newColumnOrder, int newRowOrder)
		{
			var rowOrder = newRowOrder == -1 ?
				Folders.Count(f => f.ColumnOrder == newColumnOrder) :
				newRowOrder;
			foreach (var libraryFolder in Folders.Where(f => f.ColumnOrder == newColumnOrder && f.RowOrder >= rowOrder))
				libraryFolder.RowOrder++;
			folder.RowOrder = rowOrder;
			folder.ColumnOrder = newColumnOrder;
			for (var i = 0; i < ColumnsCount; i++)
			{
				Folders.ResetItemsOrder(item => item.ColumnOrder == i);
			}
		}
		public FolderBoxWithHeader(LibraryFolder dataSource)
			: base(dataSource) { }
Ejemplo n.º 10
0
		public void InsertFolder(LibraryFolder folder, int columnOrder, int rowOrder)
		{
			AddFolder(folder, columnOrder, rowOrder);
			folder.RowOrder = rowOrder;
			Folders.Sort();
		}
Ejemplo n.º 11
0
		public void AddFolder(LibraryFolder folder, int columnOrder, int rowOrder)
		{
			folder.Page = this;
			folder.ColumnOrder = columnOrder;
			Folders.AddItem(folder);
		}
Ejemplo n.º 12
0
		public void ApplyFolderSettings(LibraryFolder targetFolder, LibraryFolder templateFolder)
		{
			if (Library.Settings.ApplyAppearanceForAllWindows)
			{
				targetFolder.Settings = templateFolder.Settings.Clone<LibraryFolder.LibraryFolderSettings>(targetFolder);
				targetFolder.MarkAsModified();
			}
			if (Library.Settings.ApplyWidgetForAllWindows)
			{
				targetFolder.Widget = templateFolder.Widget.Clone<WidgetSettings>(targetFolder);
				targetFolder.MarkAsModified();
			}
			if (Library.Settings.ApplyBannerForAllWindows)
			{
				targetFolder.Banner = templateFolder.Banner.Clone<BannerSettings>(targetFolder);
				targetFolder.MarkAsModified();
			}
		}
Ejemplo n.º 13
0
		public void ApplyFolderSettings(LibraryFolder templateFolder)
		{
			foreach (var targetFolder in Folders.Where(f => f.ExtId != templateFolder.ExtId))
				ApplyFolderSettings(targetFolder, templateFolder);
		}
Ejemplo n.º 14
0
		public static BaseFolderBox Create(LibraryFolder dataSource)
		{
			if (MainController.Instance.WallbinViews.FormatState.AccordionView)
				return new AccordionFolderBox(dataSource);
			return new ClassicFolderBox(dataSource);
		}
Ejemplo n.º 15
0
		public void MoveFolderToColumn(LibraryFolder folder, int newColumnOrder)
		{
			MoveFolderToPosition(folder, newColumnOrder, -1);
		}
Ejemplo n.º 16
0
		public ClassicFolderBox(LibraryFolder dataSource) : base(dataSource)
		{
			new FolderBoxInitializer().Initialize(this);
		}
		public AccordionFolderBox(LibraryFolder dataSource) : base(dataSource)
		{
			new FolderBoxInitializer().Initialize(this);
		}