public override void OnUpdate() { if (recorddata_to_load != null && currentTab != null) { currentTab.LoadRecord(recorddata_to_load); recorddata_to_load = null; } if (viewstate == ViewState.ToActive || viewstate == ViewState.ToHidden) { elapsed = DateTime.Now.Ticks / 10000L - startTime; if (elapsed >= realanimtiontime || X == (double)target_x) { elapsed = realanimtiontime; viewstate = viewstate != ViewState.ToActive ? ViewState.Hidden : ViewState.Active; } var num = target_x - (target_x - RelativeX) * (float)(1.0 - elapsed / (double)realanimtiontime); RelativeX = num; ShowView(num < 1.0); } if (refresh.Value) { RefreshTab(); refresh.Value = false; } base.OnUpdate(); }
public void RemoveRecord(LibraryRecord record) { if (!(record is RecentPrintsHistory.PrintHistory)) { return; } recentPrintsHistory.RemoveRecord((RecentPrintsHistory.PrintHistory)record); }
public void LoadRecord(LibraryRecord record) { if (!string.IsNullOrEmpty(record.cachefilename)) { model_loading_manager.LoadModelIntoPrinter(record, new ModelLoadingManager.LoadFailedCallback(OnLoadFailure)); } else { libraryData.RemoveFileFromRecent(record.ID); libraryView.ScheduleRefresh(); infobox.AddMessageToQueue("Unable to load model from previous software."); } }
public void LoadRecord(LibraryRecord record) { var flag = false; if (record is RecentPrintsHistory.PrintHistory printHistory) { if (Directory.Exists(printHistory.folder)) { model_loading_manager.LoadPrinterView(Path.Combine(printHistory.folder, "printerview.xml"), Path.Combine(printHistory.folder, "printersettings.xml"), printHistory.folder, "313a13a6-9edf-44c7-a81d-50b914e423cc-6bb0e036-df11-4d66-82b3-8b7f0de03d2c"); flag = true; } } if (flag) { return; } RemoveRecord(record); }
public void SaveRecord(LibraryRecord record) { if (!(record is RecentPrintsHistory.PrintHistory)) { return; } var printHistory = (RecentPrintsHistory.PrintHistory)record; var str = "Untitled.zip"; var saveFileDialog = new SaveFileDialog { FileName = str, DefaultExt = ".zip", AddExtension = true, Filter = "Zip (*.zip)|*.zip" }; if (saveFileDialog.ShowDialog() != DialogResult.OK || !RecentPrintsHistory.SavePrintHistoryToZip(saveFileDialog.FileName, printHistory)) { return; } libraryView.RecentModels.CopyAndAssignIconForLibrary(saveFileDialog.FileName, printHistory.iconfilename); }
public void SaveRecord(LibraryRecord record) { }
public void RemoveRecord(LibraryRecord record) { libraryData.RemoveFileFromRecent(record.ID); }
public LibraryRecord(LibraryRecord other) { ID = other.ID; }
public override void OnControlMsg(Element2D the_control, ControlMsg msg, float xparam, float yparam) { switch (msg) { case ControlMsg.MSG_MOVE: if (currentTab.CanRemoveRecords) { var childElement = (ImageWidget)FindChildElement(1008); if (childElement != null) { childElement.Visible = true; } } if (!currentTab.CanSaveRecords) { break; } var childElement1 = (ImageWidget)FindChildElement(1009); if (childElement1 == null) { break; } childElement1.Visible = true; break; case ControlMsg.ENTERHIT: if (the_control.GetElementType() != ElementType.EditBoxWidget) { break; } var editBoxWidget = (EditBoxWidget)the_control; if (editBoxWidget.ID != 1001) { break; } search_filter = editBoxWidget.Text; RefreshTab(); break; case ControlMsg.MSG_DRAGSTOP: var childElement2 = (ImageWidget)FindChildElement(1008); var childElement3 = (ImageWidget)FindChildElement(1009); if (the_control.GetElementType() == ElementType.ButtonWidget) { var buttonWidget = (ButtonWidget)the_control; if (buttonWidget.Data != null && buttonWidget.Data is LibraryRecord) { if (currentTab.CanRemoveRecords && buttonWidget.Overlaps(childElement2, (int)xparam - buttonWidget.X_Abs, (int)yparam - buttonWidget.Y_Abs)) { currentTab.RemoveRecord((LibraryRecord)buttonWidget.Data); refresh.Value = true; } else if (currentTab.CanSaveRecords && buttonWidget.Overlaps(childElement3, (int)xparam - buttonWidget.X_Abs, (int)yparam - buttonWidget.Y_Abs)) { currentTab.SaveRecord((LibraryRecord)buttonWidget.Data); refresh.Value = true; } else { recorddata_to_load = (LibraryRecord)buttonWidget.Data; } } } if (childElement2 != null) { childElement2.Visible = false; } if (childElement3 == null) { break; } childElement3.Visible = false; break; default: base.OnControlMsg(the_control, msg, xparam, yparam); break; } }