public void CreateImageEditorOpenEvent(IImageEditor imageEditor) { if (OnImageEditorOpen != null) { ImageEditorOpenEventArgs eventArgs = new ImageEditorOpenEventArgs(imageEditor); OnImageEditorOpen(this, eventArgs); } }
public EditorDestination( ICoreConfiguration coreConfiguration, IGreenshotLanguage greenshotLanguage, EditorFactory editorFactory, IEditorLanguage editorLanguage, IImageEditor editor) : this(coreConfiguration, greenshotLanguage, editorFactory, editorLanguage) { _editorFactory = editorFactory; _editor = editor; }
/// <summary> /// Helper method to add a MenuItem to the File MenuItem of an ImageEditor /// </summary> /// <param name="image">Image to display in the menu</param> /// <param name="text">Text to display in the menu</param> /// <param name="tag">The TAG value</param> /// <param name="shortcutKeys">Keys which can be used as shortcut</param> /// <param name="handler">The onclick handler</param> public static void AddToFileMenu(IImageEditor imageEditor, Image image, string text, object tag, Keys? shortcutKeys, System.EventHandler handler) { System.Windows.Forms.ToolStripMenuItem item = new System.Windows.Forms.ToolStripMenuItem(); item.Image = image; item.Text = text; item.Tag = tag; if (shortcutKeys.HasValue) { item.ShortcutKeys = shortcutKeys.Value; } item.Click += handler; AddToFileMenu(imageEditor, item); }
/// <summary> /// Constructor for objects of type ImageModel /// </summary> /// <param name="currentImage">The image associated with this model</param> /// <param name="imageEditor">The ImageEditor used to edit the image (Resize, Flip, Rotate)</param> /// <param name="imageSaver">The ImageSaver used to save the image to a specific path/filename</param> public void Initialise(Image currentImage, IImageEditor imageEditor, IImageSaver imageSaver) { // SET the parameters _image = currentImage; _imageEditor = imageEditor; _imageSaver = imageSaver; // Initialize the List: _currentEditFuncs = new List <Func <Image, Image> >(); // Instantiate imageData: }
/// <summary> /// Helper method to add a MenuItem to the File MenuItem of an ImageEditor /// </summary> /// <param name="image">Image to display in the menu</param> /// <param name="text">Text to display in the menu</param> /// <param name="tag">The TAG value</param> /// <param name="shortcutKeys">Keys which can be used as shortcut</param> /// <param name="handler">The onclick handler</param> public static void AddToFileMenu(IImageEditor imageEditor, Image image, string text, object tag, Keys?shortcutKeys, System.EventHandler handler) { System.Windows.Forms.ToolStripMenuItem item = new System.Windows.Forms.ToolStripMenuItem(); item.Image = image; item.Text = text; item.Tag = tag; if (shortcutKeys.HasValue) { item.ShortcutKeys = shortcutKeys.Value; } item.Click += handler; AddToFileMenu(imageEditor, item); }
public Restaurant_Card_Page1ViewModel(INavigationService navigationService, ICensusService censusService, IImageEditor imageEditor, IMediaPickerService mediaPickerService, IDialogService dialogService) : base(navigationService, dialogService) { _navigationService = navigationService; _dialogService = dialogService; _censusService = censusService; _mediaPickerService = mediaPickerService; _imageEditor = imageEditor; //普查步骤 var steps = new Dictionary <int, string> { { 0, "基础信息" }, { 1, "经营信息" }, { 2, "销售信息" } }; Steps = steps; Step = 1; Title = "添加餐饮终端普查-基本信息"; // GlobalSettings.EventDate = DateTime.Now; EndPointNumber_Tip = "请定义终端编号"; SaleRegion_Tip = "请输入所在大区"; SalesDepartment_Tip = "请输入业务部"; City_Tip = "请确定你所在城市"; DistrictOrCounty_Tip = "请输入你所在区/县"; CityOrTown_Tip = "请输入城区/乡镇"; EndPointStorsName_Tip = "请输入终端店名"; EndPointTelphone_Tip = "固话,填\"区号+号码\"(不加\"-\"),如0293248123"; EndPointAddress_Tip = "终端地址(详细街道/门牌号)"; Restaurant = new Restaurant() { UserId = Settings.UserId.ToString(), Latitude = GlobalSettings.CurrtntCoordinate != null ? GlobalSettings.CurrtntCoordinate.Latitude : 0, Longitude = GlobalSettings.CurrtntCoordinate != null ? GlobalSettings.CurrtntCoordinate.Longitude : 0, Location = GlobalSettings.CurrentAddComp != null ? GlobalSettings.CurrentAddComp.City : "" }; BaseInfo = new RestaurantBaseInfo() { EndPointNumber = string.Format("{0}_{1}", "CY", CommonHelper.GetTimeStamp(DateTime.Now, 13)), SaleRegion = Settings.SaleRegion, SalesDepartment = Settings.SalesDepartment }; }
/// <summary> /// Helper method to add a MenuItem to the File MenuItem of an ImageEditor /// </summary> /// <param name="imageEditor"></param> /// <param name="image">Image to display in the menu</param> /// <param name="text">Text to display in the menu</param> /// <param name="tag">The TAG value</param> /// <param name="shortcutKeys">Keys which can be used as shortcut</param> /// <param name="handler">The onclick handler</param> public static void AddToFileMenu(IImageEditor imageEditor, Image image, string text, object tag, Keys?shortcutKeys, EventHandler handler) { var item = new ToolStripMenuItem { Image = image, Text = text, Tag = tag }; if (shortcutKeys.HasValue) { item.ShortcutKeys = shortcutKeys.Value; } item.Click += handler; AddToFileMenu(imageEditor, item); }
public ImageEditPage(string source) { Title = "Image Edit"; NavigationPage.SetHasNavigationBar(this, true); InitializeComponent(); Source = source; ImageEditor = DependencyService.Get <IImageEditor>(); ImageEditor.SetImage(source); imageView.Source = source; sizeSlider.ValueChanged += (sender, e) => { imageView.ScaleTo(e.NewValue / 100); }; btnRotateLeft.Clicked += (sender, e) => { ImageEditor.Rotate(-90); ReloadImage(); }; btnRotateRight.Clicked += (sender, e) => { ImageEditor.Rotate(90); ReloadImage(); }; btnReload.Clicked += (sender, e) => { ReloadImage(); }; btnCancel.Clicked += (sender, e) => Navigation.PopAsync(); btnSave.Clicked += (sender, e) => { ImageEditor.Save(Source); Navigation.PopAsync(); }; btnCrop.Clicked += (sender, e) => { ImageEditor.Crop((int)imageView.Width / 4, (int)imageView.Height / 4, imageView.Width / 2, imageView.Height / 2); ReloadImage(); }; sizeSlider.IsVisible = false; }
/// <summary> /// Helper method to add a MenuItem to the Plugin MenuItem of an ImageEditor /// </summary> /// <param name="imageEditor"></param> /// <param name="item"></param> public static void AddToPluginMenu(IImageEditor imageEditor, ToolStripMenuItem item) { ToolStripMenuItem toolStripMenuItem = imageEditor.GetPluginMenuItem(); bool added = false; for (int i = 0; i < toolStripMenuItem.DropDownItems.Count; i++) { if (toolStripMenuItem.DropDownItems[i].GetType() == typeof(ToolStripSeparator)) { toolStripMenuItem.DropDownItems.Insert(i, item); added = true; break; } } if (!added) { toolStripMenuItem.DropDownItems.Add(item); } }
/// <summary> /// Helper method to add a MenuItem to the File MenuItem of an ImageEditor /// </summary> /// <param name="imageEditor"></param> /// <param name="item"></param> public static void AddToFileMenu(IImageEditor imageEditor, ToolStripMenuItem item) { var toolStripMenuItem = imageEditor.GetFileMenuItem(); var added = false; for (var i = 0; i < toolStripMenuItem.DropDownItems.Count; i++) { if (toolStripMenuItem.DropDownItems[i].GetType() != typeof(ToolStripSeparator)) { continue; } toolStripMenuItem.DropDownItems.Insert(i, item); added = true; break; } if (!added) { toolStripMenuItem.DropDownItems.Add(item); } }
public ImageEditorPresenter(IAppController appController, IImageEditor view, ILogService logService, IMessageService messageService, IRepository <IImageList> repository, ISlideshowService slideshowService, IImageListSupport[] imageListTools, IImageSupport[] imageTools) : base(appController, view, logService, messageService, repository, slideshowService) { ImageListTools = imageListTools; ImageTools = imageTools; if (imageListTools.Length > 0) { View.ToolPanels.AddPanel(nameof(IImageListSupport), Resources.AnimatedTools).SetTools(ImageListTools); } if (imageTools.Length > 0) { View.ToolPanels.AddPanel(nameof(IImageSupport), Resources.StaticTools).SetTools(ImageTools); } AppController.EventController .Subscribe(View.MenuPanel, nameof(View.MenuPanel.ApplyTool), MenuPanel_ApplyTool) .Subscribe(View.ImagePanels, nameof(View.ImagePanels.SelectedPanelChanged), OnLoadDefaultSettings) .Subscribe(View.ToolPanels, nameof(View.ToolPanels.SelectedPanelChanged)) .Subscribe <string>(Repository, nameof(Repository.ItemAdded), Repository_ItemAdded) .Subscribe <string>(Repository, nameof(Repository.ItemRemoved), Repository_ItemRemoved); foreach (IToolPanel toolPanel in View.ToolPanels) { AppController.EventController .Subscribe(toolPanel, nameof(toolPanel.Tuning), ToolPanel_Tuning) .AddCondition(toolPanel, nameof(toolPanel.Tuning), TuningCondition) .Subscribe(toolPanel, nameof(toolPanel.SelectedToolChanged), ToolPanel_SelectedToolChanged, OnLoadDefaultSettings); } AppController.EventController .AddCondition(View.MenuPanel, nameof(View.MenuPanel.ApplyTool), ApplyToolCondition); }
public EditorDestination(IImageEditor editor) { this.editor = editor; }
public ParallelEditor(IImageEditor decorated) { this.decorated = decorated; }
public ImageEditorOpenEventArgs(IImageEditor imageEditor) { this.imageEditor = imageEditor; }
/// <summary> /// Helper method to add a MenuItem to the File MenuItem of an ImageEditor /// </summary> /// <param name="imageEditor"></param> /// <param name="item"></param> public static void AddToFileMenu(IImageEditor imageEditor, ToolStripMenuItem item) { ToolStripMenuItem toolStripMenuItem = imageEditor.GetFileMenuItem(); bool added = false; for(int i = 0; i< toolStripMenuItem.DropDownItems.Count; i++) { if (toolStripMenuItem.DropDownItems[i].GetType() == typeof(ToolStripSeparator)) { toolStripMenuItem.DropDownItems.Insert(i, item); added = true; break; } } if (!added) { toolStripMenuItem.DropDownItems.Add(item); } }
public CollectionItemImageFactory(IImageEditor imageEditor) { _imageEditor = imageEditor; }
public Main(MainFixture main) { _main = main; _editor = new ImageEditor(); }
public EditorDestination(EditorFactory editorFactory, IEditorLanguage editorLanguage, IImageEditor editor) : this(editorLanguage) { _editorFactory = editorFactory; _editor = editor; }