/// <summary> /// Set view mode /// </summary> /// <param name="mode"></param> private void SetElementsVisibility(ViewModes mode) { ShowPassword = false; switch (mode) { case ViewModes.View: EntryDataVisibility = true; DeleteButtonVisibility = true; EditionButtonVisibility = true; EditionFormVisibility = false; EditionControlButtonsVisibility = false; CreationControlButtonsVisibility = false; break; case ViewModes.Edition: EntryDataVisibility = false; DeleteButtonVisibility = false; EditionButtonVisibility = false; EditionFormVisibility = true; EditionControlButtonsVisibility = true; CreationControlButtonsVisibility = false; break; case ViewModes.Creation: EntryDataVisibility = false; DeleteButtonVisibility = false; EditionButtonVisibility = false; EditionFormVisibility = true; EditionControlButtonsVisibility = false; CreationControlButtonsVisibility = true; break; } }
/// <summary> /// Fixed: /// </summary> public static string Index(SiteSettings ss) { var invalid = GroupValidators.OnEntry(ss); switch (invalid) { case Error.Types.None: break; default: return(HtmlTemplates.Error(invalid)); } var hb = new HtmlBuilder(); var view = Views.GetBySession(ss); var gridData = GetGridData(ss, view); var viewMode = ViewModes.GetBySession(ss.SiteId); return(hb.Template( ss: ss, verType: Versions.VerTypes.Latest, methodType: BaseModel.MethodTypes.Index, referenceType: "Groups", script: Libraries.Scripts.JavaScripts.ViewMode(viewMode), title: Displays.Groups() + " - " + Displays.List(), action: () => { hb .Form( attributes: new HtmlAttributes() .Id("GroupForm") .Class("main-form") .Action(Locations.Action("Groups")), action: () => hb .ViewFilters(ss: ss, view: view) .Aggregations( ss: ss, aggregations: gridData.Aggregations) .Div(id: "ViewModeContainer", action: () => hb .Grid( ss: ss, gridData: gridData, view: view)) .MainCommands( ss: ss, siteId: ss.SiteId, verType: Versions.VerTypes.Latest) .Div(css: "margin-bottom") .Hidden(controlId: "TableName", value: "Groups") .Hidden(controlId: "BaseUrl", value: Locations.BaseUrl()) .Hidden( controlId: "GridOffset", value: Parameters.General.GridPageSize.ToString())) .Div(attributes: new HtmlAttributes() .Id("ImportSettingsDialog") .Class("dialog") .Title(Displays.Import())) .Div(attributes: new HtmlAttributes() .Id("ExportSettingsDialog") .Class("dialog") .Title(Displays.ExportSettings())); }).ToString()); }
/// <summary> /// Check which view mode is selected and update the current view /// </summary> /// <param name="aViewMode"></param> private void UpdatePropertyView(ViewModes aViewMode) { // Get the view System.ComponentModel.ICollectionView crtView = CollectionViewSource.GetDefaultView(mProperties); if (crtView == null) { return; } if (aViewMode == ViewModes.Alphabetical) { // Remove the groups crtView.GroupDescriptions.Clear(); // Sort options alphabetically by name crtView.SortDescriptions.Add(new SortDescription("DisplayName", ListSortDirection.Ascending)); } else if (aViewMode == ViewModes.Grouped) { // Remove the sorting crtView.SortDescriptions.Clear(); // Add the options groups crtView.GroupDescriptions.Add(new PropertyGroupDescription("Category")); } crtView.Refresh(); }
public void SetViewMode(ViewModes mode) { // Can always allow exterior mode if (mode == ViewModes.Exterior) { viewMode = mode; } // Only allow dungeon when dungeon present if (mode == ViewModes.Dungeon && dungeonLayoutBitmap != null) { viewMode = mode; } // This is now the user preferred mode and will be // automatically selected later when possible userPreferredViewMode = mode; // Clear mouse over block mouseOverBlock = -1; // Raise events RaiseModeChangedEvent(); RaiseMouseOverBlockChangedEvent(); // Redraw this.Invalidate(); }
private void ViewByFolders(object sender, RoutedEventArgs e) { if (_viewMode == ViewModes.Folder) { return; } _viewMode = ViewModes.Folder; }
private void ViewAll(object sender, RoutedEventArgs e) { if (_viewMode == ViewModes.All) { return; } _viewMode = ViewModes.All; }
public string BurnDownJson() { SetSite(initSiteSettings: true, setSiteIntegration: true); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.BurnDownJson(ss: Site.SiteSettings)); default: return(Messages.ResponseNotFound().ToJson()); } }
public string BurnDown() { SetSite(initSiteSettings: true, setSiteIntegration: true); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.BurnDown(ss: Site.SiteSettings)); default: return(HtmlTemplates.Error(Error.Types.NotFound)); } }
public string GanttJson() { SetSite(); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.GanttJson( ss: Site.IssuesSiteSettings(ReferenceId, setAllChoices: true))); default: return(HtmlTemplates.Error(Error.Types.NotFound)); } }
private void User_Close(object sender) { ((BaseViewModel)sender).Dispose(); if (CurrentView == ViewModes.Editor) { CurrentView = ViewModes.Main; } else { CurrentView = ViewModes.Close; } }
private void ToggleLabel(ViewModes viewMode, bool isEnabled, Label activeLabel, Label inactiveLabel) { formViewMode = viewMode; pnlEnabled.Visible = isEnabled; pnlDisabled.Visible = !isEnabled; activeLabel.BackColor = Color.SteelBlue; activeLabel.ForeColor = Color.White; activeLabel.BorderStyle = BorderStyle.Fixed3D; inactiveLabel.BackColor = Color.LightSteelBlue; inactiveLabel.ForeColor = Color.Black; inactiveLabel.BorderStyle = BorderStyle.FixedSingle; }
public string GanttJson() { SetSite(); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.GanttJson( ss: Site.IssuesSiteSettings( ReferenceId, setAllChoices: true, setSiteIntegration: true))); default: return(Messages.ResponseNotFound().ToJson()); } }
public string IndexJson() { SetSite(initSiteSettings: true); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.IndexJson(ss: Site.SiteSettings)); case "Results": return(ResultUtilities.IndexJson(ss: Site.SiteSettings)); default: return(HtmlTemplates.Error(Error.Types.NotFound)); } }
public void AddGesturesCollection(GesturesCollection gestures) { m_gestures = gestures; this.ViewMode = (ViewModes)Config.User.LW_viewMode; this.Items.AddRange(gestures.GetAll().ToArray()); //m_gestures.UpdateCollapsedGroups(); //this.Columns[this.Columns.Count - 1].Width = -2; foreach (MyGesture group in m_gestures.Groups) { CollapseExpandGroup(this.Items[group.Index]); } SetLastColumnWidthToEnd(); }
/// <summary> /// Bind a view to the specified view mode. /// </summary> /// <param name="mode">Mode to bind with view.</param> /// <param name="viewClient">ContentViewBase implementation.</param> private void BindViewClient(ViewModes viewMode, ViewBase viewClient) { // Can only bind one view client to a mode if (viewClients.ContainsKey(viewMode)) { return; } // Add view to dictionary viewClients.Add(viewMode, viewClient); // Initialise view viewClient.Initialize(); }
private void CB_ChangeViewMode(object sender, SelectionChangedEventArgs e) { int monthIndex = 0; int weekIndex = 1; if (CB_Mode.SelectedIndex.Equals(monthIndex)) { modeView = ViewModes.Months; } else if (CB_Mode.SelectedIndex.Equals(weekIndex)) { modeView = ViewModes.Weeks; } }
/// <summary> /// Shows thumbnails. /// </summary> public void ShowThumbnailsView() { // Exit if not ready if (!isReady) { return; } // Set view mode lastViewMode = viewMode; viewMode = ViewModes.ThumbnailView; viewClients[viewMode].ResumeView(); RaiseViewModeChangedEvent(); }
/// <summary> /// Helper event for the Display control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected void Display_Helper(object sender, EventArgs e) { CurtainCall cc = (CurtainCall)sender; if (cc != null && cc.ShouldShow) { CurrentView = cc.CallingView; Visibility = Visibility.Visible; } else { Visibility = Visibility.Collapsed; } }
public string IndexJson() { if (ReferenceType != "Sites") { return(Messages.ResponseNotFound().ToJson()); } SetSite(initSiteSettings: true, setSiteIntegration: true); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.IndexJson(ss: Site.SiteSettings)); case "Results": return(ResultUtilities.IndexJson(ss: Site.SiteSettings)); default: return(Messages.ResponseNotFound().ToJson()); } }
public string ImageLib() { SetSite(); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.ImageLib( ss: Site.IssuesSiteSettings( ReferenceId, setAllChoices: true, setSiteIntegration: true))); case "Results": return(ResultUtilities.ImageLib( ss: Site.ResultsSiteSettings( ReferenceId, setAllChoices: true, setSiteIntegration: true))); default: return(HtmlTemplates.Error(Error.Types.NotFound)); } }
/// <summary> /// Shows a single model. /// </summary> /// <param name="id">ModelID of model to show.</param> /// <param name="climate">ClimateType.</param> public void ShowModelView(uint?id, DFLocation.ClimateSettings?climate) { // Exit if not ready if (!isReady) { return; } // Set view mode lastViewMode = viewMode; viewMode = ViewModes.ModelView; ModelView view = (ModelView)viewClients[ViewModes.ModelView]; view.Climate = climate; view.ModelID = id; view.ResumeView(); RaiseViewModeChangedEvent(); }
private void OnWindowLoaded(object sender, RoutedEventArgs e) { #if TRACE long startTicks = VNC.AppLog.Trace5("Enter", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0); #endif // Do not load your data at design time. if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { Common.ApplicationDataSet.LoadApplicationDataSetFromDB(Common.ApplicationDataSet); } ViewModes viewModes = new ViewModes(); cbe_UserMode.ItemsSource = viewModes.Items; Common.UserMode = new ViewMode(SQLInformation.Data.Config.DefaultUserMode); //cbe_UserMode.ItemsSource = ViewMode.OptionValues; SplashScreenItems ssi = new SplashScreenItems(); // TODO(crhodes): Clean this up. This controls how the UI looks on first startup. // Make it not hard coded. Common.UserMode is initialized from app.config. if (Common.UserMode.Basic) { cbe_SplashScreens.ItemsSource = ssi.Items.Where(um => um.UserMode.Basic);; } else if (Common.UserMode.Advanced) { cbe_SplashScreens.ItemsSource = ssi.Items.Where(um => um.UserMode.Advanced); } else if (Common.UserMode.Administrator) { cbe_SplashScreens.ItemsSource = ssi.Items.Where(um => um.UserMode.Administrator); } else if (Common.UserMode.Beta) { cbe_SplashScreens.ItemsSource = ssi.Items.Where(um => um.UserMode.Beta); } #if TRACE VNC.AppLog.Trace5("Exit", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks); #endif }
/// <summary> /// Shows location dungeon blocks. /// </summary> /// <param name="dfLocation">DFLocation.</param> public void ShowLocationDungeon(DFLocation dfLocation) { // Exit if not ready if (!isReady) { return; } // Load dungeon LocationView view = (LocationView)viewClients[ViewModes.DungeonView]; view.CreateDungeonLocationScene(dfLocation.RegionName, dfLocation.Name); // Set view mode lastViewMode = viewMode; viewMode = ViewModes.DungeonView; viewClients[viewMode].ResumeView(); RaiseViewModeChangedEvent(); }
public string Index() { if (ReferenceId == 0) { return(SiteUtilities.SiteTop()); } SetSite(initSiteSettings: true, setSiteIntegration: true); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Sites": return(SiteUtilities.SiteMenu(Site)); case "Issues": return(IssueUtilities.Index(ss: Site.SiteSettings)); case "Results": return(ResultUtilities.Index(ss: Site.SiteSettings)); default: return(HtmlTemplates.Error(Error.Types.NotFound)); } }
/// <summary> /// Swaps between current and previous view modes. /// </summary> private void SwapViewModes() { // Do nothing if no previous view mode if (lastViewMode == ViewModes.None) { return; } // Swap current view mode with previous view mode ViewModes tempViewMode; tempViewMode = viewMode; viewMode = lastViewMode; lastViewMode = tempViewMode; if (isReady && viewMode != ViewModes.None) { viewClients[viewMode].ResumeView(); } RaiseViewModeChangedEvent(); }
/// <summary> /// Shows a single block view. /// </summary> /// <param name="name">Block name.</param> /// <param name="climate">Climate of block.</param> public void ShowBlockView(string name, DFLocation.ClimateSettings?climate) { // Exit if not ready if (!isReady) { return; } // Show block scene if (!string.IsNullOrEmpty(name)) { name = name.ToUpper(); LocationView view = (LocationView)viewClients[ViewModes.BlockView]; view.CreateBlockScene(name, climate); } // Set view mode lastViewMode = viewMode; viewMode = ViewModes.BlockView; viewClients[viewMode].ResumeView(); RaiseViewModeChangedEvent(); }
/// <summary> /// Initializes a new instance of the <see cref="MedicinePlanningDetail"/> class. /// </summary> public MedicinePlanningDetail() { InitializeComponent(); this._mode = ViewModes.Add; }
private void BtnEditClick(object sender, EventArgs e) { this._mode = ViewModes.Update; Initialize(); }
private void ConfigureModes() { if (!IsReady()) { // Everything off exteriorModeAllowed = false; dungeonModeAllowed = false; viewMode = ViewModes.None; RaiseModeChangedEvent(); return; } // Always enable exterior mode mode exteriorModeAllowed = true; // Only enable dungeon mode when the location has a dungeon if (dfLocation.HasDungeon) { dungeonModeAllowed = true; } else { dungeonModeAllowed = false; } // Test if location type is a dungeon type bool isDungeonMapType = false; if (dfLocation.MapTableData.Type == DFRegion.LocationTypes.DungeonKeep || dfLocation.MapTableData.Type == DFRegion.LocationTypes.DungeonLabyrinth || dfLocation.MapTableData.Type == DFRegion.LocationTypes.DungeonRuin) { isDungeonMapType = true; } // Try to keep user preferred mode if possible if (userPreferredViewMode != ViewModes.None) { if (userPreferredViewMode == ViewModes.Dungeon && dfLocation.HasDungeon) { viewMode = ViewModes.Dungeon; } else { viewMode = ViewModes.Exterior; } } else { // Work out view mode based on location // Start in dungeon mode when a dungeon is present and this is a dedicated dungeon type. // Otherwise start in exterior mode. if (dfLocation.HasDungeon && isDungeonMapType) { viewMode = ViewModes.Dungeon; } else { viewMode = ViewModes.Exterior; } } // Raise event to update form RaiseModeChangedEvent(); }
public MainControler() { CurrentUser = null; CurrentView = ViewModes.Main; ViewHandler(); }
private void clearMouseMode(object sender, MouseButtonEventArgs e) { currentViewMode = ViewModes.None; }
public void setViewMode(ViewModes vmViewMode) { cbViewMode.SelectedItem = vmViewMode; setupSelectedViewMode(); }
public static CreationResult Create( string filePath, int startPage = -1, int endPage = -1, int startIdx = -1, int endIdx = -1, int parentElementId = -1, int readPage = 0, Point readPoint = default, ViewModes viewMode = PDFConst.DefaultViewMode, int pageMargin = PDFConst.DefaultPageMargin, float zoom = PDFConst.DefaultZoom, bool shouldDisplay = true) { IBinary binMem = null; try { var fileName = Path.GetFileName(filePath); if (string.IsNullOrWhiteSpace(fileName)) { LogTo.Warning($"Path.GetFileName(filePath) returned null for filePath '{filePath}'."); return(CreationResult.FailUnknown); } var binMems = Svc.SM.Registry.Binary.FindByName( new Regex(Regex.Escape(fileName) + ".*", RegexOptions.IgnoreCase)).ToList(); if (binMems.Any()) { var oriPdfFileInfo = new FileInfo(filePath); if (oriPdfFileInfo.Exists == false) { LogTo.Warning($"New PDF file '{filePath}' doesn't exist."); return(CreationResult.FailUnknown); } foreach (var itBinMem in binMems) { var smPdfFilePath = itBinMem.GetFilePath("pdf"); var smPdfFileInfo = new FileInfo(smPdfFilePath); if (smPdfFileInfo.Exists == false) { LogTo.Warning($"PDF file '{smPdfFilePath}' associated with Binary member id {itBinMem.Id} is missing."); continue; } try { if (smPdfFileInfo.Length != oriPdfFileInfo.Length) { continue; } } catch (FileNotFoundException ex) { LogTo.Warning(ex, "PDF file '{SmPdfFilePath}' or '{FilePath}' has gone missing. Weird.", smPdfFilePath, filePath); continue; } binMem = itBinMem; break; } } if (binMem == null) { int binMemId = Svc.SM.Registry.Binary.Add(filePath, fileName); if (binMemId < 0) { return(CreationResult.FailBinaryRegistryInsertionFailed); } binMem = Svc.SM.Registry.Binary[binMemId]; } } catch (RemotingException) { return(CreationResult.FailUnknown); } catch (Exception ex) { LogTo.Error(ex, "Exception thrown while creating new PDF element"); return(CreationResult.FailUnknown); } return(Create(binMem, startPage, endPage, startIdx, endIdx, parentElementId, readPage, readPoint, viewMode, pageMargin, zoom, shouldDisplay)); }
private void ViewAll(object sender, RoutedEventArgs e) { if (_viewMode == ViewModes.All) return; _viewMode = ViewModes.All; }
private void ViewByFolders(object sender, RoutedEventArgs e) { if (_viewMode == ViewModes.Folder) return; _viewMode = ViewModes.Folder; }
/// <summary> /// Initializes this instance. /// </summary> private void Initialize() { this._vWareHouseDetailList = new List<VWareHouseDetail>(); this.bdsMedicine.DataSource = _medicineRepo.GetAll(); this._medDeliveryAllocationList = new List<MedicineDeliveryAllocationEntity>(); this._prescription = _prescriptionRepo.Get(this._prescriptionId); this.bdsPrescription.DataSource = this._prescription; this._prescriptionDetailList = _prescriptionDetailRepo.GetByPrescription(this._prescriptionId); if (_prescription == null || this._prescriptionDetailList == null) throw new Exception("Data dosenot existed"); this._medicineDelivery = this._medicineDeliveryRepo.GetByPrescriptionId(this._prescriptionId); this._formMode = this._medicineDelivery == null ? ViewModes.Add : ViewModes.View; if (this._formMode == ViewModes.Add) { // Createe MachineDelivery // Create MachineDeliveryDetail // Craete MedicindeDeliveryDetailAllocate // Get WareHouseDetail // Get WareHouse; // this._warehouseDetailList = this._warehouseDetailRepo var medincineIdList = this._prescriptionDetailList.Select(item => item.MedicineId).ToList(); this._warehouseList = this._warehouseRepo.GetByMedicineId(medincineIdList, AppContext.CurrentClinic.Id); this._vWareHouseDetailList = this._vWareHouseDetailRepo.GetByMedicine(medincineIdList); this._medicineDelivery = CreatePrescription(this._prescription); this._medicineDeliveryDetailList = CreateMedicineDeliveryDetail(this._prescriptionDetailList); this.AutoAllocate(this._medicineDeliveryDetailList, this._vWareHouseDetailList); // this._warehouseDetailList = this._warehouseDetailRepo.GetByMedicine(medincineIdList, AppContext.CurrentClinic.Id);) // this._mdecidineDeliveryDetailAllocate = AutoAllocate(this._medicineDeliveryDetailList, this._warehouseDetailList); // var item = this._warehouseDetailList.Select(x => new { x.MedicineId, x.LotNo, x.ExpiredDate}).GroupBy(x => new { x.MedicineId, x.LotNo, x.ExpiredDate }).ToList(); var no = 1; foreach (var deliveryItem in this._medicineDeliveryDetailList) { // var allocatedList = this._mdecidineDeliveryDetailAllocate.Where(x => x.MedicineDeliveryDetailId == deliveryItem.Id).ToList(); var warehouse = this._warehouseList.FirstOrDefault(x => x.MedicineId == deliveryItem.MedicineId); var item = new MedicineDeliveryAllocationEntity(no++, deliveryItem, warehouse); this._medDeliveryAllocationList.Add(item); var subNo = 1; foreach (var itm in deliveryItem.AllocatedWareHouseDetail) { var subItem = new MedicineDeliveryAllocationEntity(subNo++, itm); _medDeliveryAllocationList.Add(subItem); } } this.bindingSource1.DataSource = this._medDeliveryAllocationList; } else { var medincineIdList = this._prescriptionDetailList.Select(item => item.MedicineId).ToList(); this._warehouseList = this._warehouseRepo.GetByMedicineId(medincineIdList, AppContext.CurrentClinic.Id); this._vWareHouseDetailList = this._vWareHouseDetailRepo.GetByMedicine(medincineIdList); this._medicineDelivery = this._medicineDeliveryRepo.GetByPrescriptionId(this._prescription.Id); this._medicineDeliveryDetailList = this._medicineDeliveryDetailRepo.GetByDelivery(this._medicineDelivery.Id); var deliveryDetailList = this._medicineDeliveryDetailList.Select(x => x.Id).ToList(); this._vMedicineDeliveryDetailAllocateds = this._medicineDeliveryDetailRepo.GetDeliveryDetailAllocateds(deliveryDetailList); // this._mdecidineDeliveryDetailAllocate = AutoAllocate(this._medicineDeliveryDetailList, this._warehouseDetailList); // var item = this._warehouseDetailList.Select(x => new { x.MedicineId, x.LotNo, x.ExpiredDate}).GroupBy(x => new { x.MedicineId, x.LotNo, x.ExpiredDate }).ToList(); // this._warehouseDetailList = this._warehouseDetailRepo.GetByMedicine(medincineIdList, AppContext.CurrentClinic.Id);) var no = 1; foreach (var deliveryItem in this._medicineDeliveryDetailList) { // var allocatedList = this._mdecidineDeliveryDetailAllocate.Where(x => x.MedicineDeliveryDetailId == deliveryItem.Id).ToList(); var warehouse = this._warehouseList.FirstOrDefault(x => x.MedicineId == deliveryItem.MedicineId); var item = new MedicineDeliveryAllocationEntity(no++, deliveryItem, warehouse); this._medDeliveryAllocationList.Add(item); List<VMedicineDeliveryDetailAllocated> allocatedWareHouseDetailList = this._vMedicineDeliveryDetailAllocateds.Where(x => x.MedicineDeliveryDetailId == deliveryItem.Id) .ToList(); var subNo = 1; foreach (var itm in allocatedWareHouseDetailList) { var subItem = new MedicineDeliveryAllocationEntity(subNo++, itm); _medDeliveryAllocationList.Add(subItem); } } this.dataGridViewX1.Columns[6].Visible = false; this.dataGridViewX1.Columns[8].Visible = false; this.bindingSource1.DataSource = this._medDeliveryAllocationList; } }
private void frmProviderEligibilityRestrictions_Load(object sender, EventArgs e) { formViewMode = ViewModes.Current; InitializeProviderList(""); }
public void AddGesturesCollection(GesturesCollection gestures) { m_gestures = gestures; this.ViewMode = (ViewModes)Config.User.LW_viewMode; this.Items.AddRange(gestures.GetAll().ToArray()); //m_gestures.UpdateCollapsedGroups(); //this.Columns[this.Columns.Count - 1].Width = -2; foreach (MyGesture group in m_gestures.Groups) CollapseExpandGroup(this.Items[group.Index]); SetLastColumnWidthToEnd(); }
public MedicinePlanningDetail(int medicinePlanId) : this() { this._mode = ViewModes.View; this._planningId = medicinePlanId; }
private void User_Login(object sender, User Currentuser) { ((BaseViewModel)sender).Dispose(); CurrentUser = Currentuser; CurrentView = ViewModes.Editor; }
public void setViewMode(ViewModes vmViewMode) { cbViewMode.SelectedItem = vmViewMode; setupSelectedViewMode(); }
private void User_Edited(object sender, User Currentuser) { ((BaseViewModel)sender).Dispose(); CurrentView = ViewModes.Main; }
public static CreationResult Create( IBinary binMem, int startPage = -1, int endPage = -1, int startIdx = -1, int endIdx = -1, int parentElementId = -1, int readPage = 0, Point readPoint = default, ViewModes viewMode = PDFConst.DefaultViewMode, int pageMargin = PDFConst.DefaultPageMargin, float zoom = PDFConst.DefaultZoom, bool shouldDisplay = true, string subtitle = null) { PDFElement pdfEl; string title; string author; string creationDate; string filePath; try { filePath = binMem.GetFilePath("pdf"); if (File.Exists(filePath) == false) { return(CreationResult.FailBinaryMemberFileMissing); } pdfEl = new PDFElement { BinaryMemberId = binMem.Id, FilePath = filePath, StartPage = startPage, EndPage = endPage, StartIndex = startIdx, EndIndex = endIdx, ReadPage = readPage, ReadPoint = readPoint, ViewMode = viewMode, PageMargin = pageMargin, Zoom = zoom, }; pdfEl.GetInfos(out string pdfTitle, out author, out creationDate); title = pdfEl.ConfigureTitle(pdfTitle, subtitle); } catch (Exception ex) { LogTo.Error(ex, "Exception thrown while creating new PDF element"); return(CreationResult.FailUnknown); } string elementHtml = string.Format(CultureInfo.InvariantCulture, PDFConst.ElementFormat, title, binMem.Name, pdfEl.GetJsonB64()); IElement parentElement = parentElementId > 0 ? Svc.SM.Registry.Element[parentElementId] : null; var elemBuilder = new ElementBuilder(ElementType.Topic, elementHtml) .WithParent(parentElement) .WithTitle(subtitle ?? title) .WithPriority(PDFState.Instance.Config.PDFExtractPriority) .WithReference( r => r.WithTitle(title) .WithAuthor(author) .WithDate(creationDate) .WithSource("PDF") .WithLink("..\\" + Svc.SM.Collection.MakeRelative(filePath)) ); if (shouldDisplay == false) { elemBuilder = elemBuilder.DoNotDisplay(); } return(Svc.SM.Registry.Element.Add(out _, ElemCreationFlags.CreateSubfolders, elemBuilder) ? CreationResult.Ok : CreationResult.FailCannotCreateElement); }
//public override SlimDX.Matrix WorldTransform { get { return _cameras[_mode].WorldTransform; } } private void AddMode(ViewModes mode, Camera camera) { _cameras.Add(mode, camera); }
private void setMouseMode(object sender, MouseButtonEventArgs e) { currentViewMode = ViewModes.Moving; oldPosition = e.GetPosition(this); }
private void mouseLeave(object sender, MouseEventArgs e) { currentViewMode = ViewModes.None; }