public override DIRECTION translateMove(NodeL from, NodeL to, ref View v) { int second = to.x - from.x; int first = to.y - from.y; if (first > 0) // dolu { return(DIRECTION.DIRECTION_FORWARD); } else if (first < 0) // nahoru { v = new TopView(); return(DIRECTION.DIRECTION_BACKWARD); } else if (second > 0) // doprava { v = new RightView(); return(DIRECTION.DIRECTION_LEFT); } else if (second < 0) // doleva { v = new LeftView(); return(DIRECTION.DIRECTION_RIGHT); } else { return(DIRECTION.WAIT); } }
public bool IsHavePermission(RightView permission) { if (Permissions.Any(r => (permission.ControllerName == r.ControllerName) && (permission.ActionName == r.ActionName))) { return(true); } return(false); }
static RightsCollection() { _items = new List <IRight>(); Add = new RightAdd(); _items.Add(Add); Delete = new RightDelete(); _items.Add(Delete); Admin = new RightAdmin(); _items.Add(Admin); View = new RightView(); _items.Add(View); }
public MainWindow() { CultureResources.ChangeCulture(Properties.Settings.Default.DefaultCulture); InitializeComponent(); LeftView.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled); RightView.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled); _backgroundWorker1 = new BackgroundWorker(); _backgroundWorker1.WorkerReportsProgress = true; _backgroundWorker1.WorkerSupportsCancellation = true; _backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork); _backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted); _backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged); }
public void WriteOutput(string file, List <Path> result) { int id = 0; foreach (Path p in result) { var fileName = file + "-" + id + ".txt"; StreamWriter sw = new StreamWriter(fileName); //View v = View.detectView(p.path[0], p.path[1]); View v = new RightView(); for (int i = 0; i < p.path.Count - 1; i++) { sw.WriteLine((int)v.translateMove(p.path[i], p.path[i + 1], ref v)); } sw.Close(); id++; } }
void ReleaseDesignerOutlets() { if (Label != null) { Label.Dispose(); Label = null; } if (RightView != null) { RightView.Dispose(); RightView = null; } if (RightViewSuperview != null) { RightViewSuperview.Dispose(); RightViewSuperview = null; } }