public void Setup()
 {
     mr = new MockRepository();
     frame = mr.DynamicMock<IWindowFrame>();
     sc = new ServiceContainer();
     sc.AddService(typeof(IWindowFrame), frame);
 }
Example #2
0
        public void SaveLogViewerToFile(IWindowFrame windowFrame, string filePath)
        {
            // Check if file exists; delete it
            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }

            using (FileStream fs = File.Create(filePath))
            {
                var messages = windowFrame.PrimaryView.Messages;
                lock (messages)
                {
                    foreach (var msg in messages)
                    {
                        AddText(fs, string.Format("{0}|{1}|{2}|{3}\r\n", msg.DateTime.ToString("yyyy-MM-dd HH:mm:ss.ffff"), msg.Type, msg.System, msg.Description));
                    }
                }
            }
        }
        public void Setup()
        {
            mr = new MockRepository();
            mockFactory = new MockFactory(mr);
            var platform = mockFactory.CreatePlatform(); ;

            program = new Program
            {
                Architecture = platform.Architecture,
                Platform = platform,
            };
            codeViewer = new CodeViewerPane();
            decompilerSvc = mr.Stub<IDecompilerService>();
            decompiler = mr.Stub<IDecompiler>();
            uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
            uiSvc = mr.Stub<IDecompilerShellUiService>();
            frame = mr.Stub<IWindowFrame>();
            font = new Font("Arial", 10);
            var styles = new Dictionary<string, UiStyle>()
            {
                {
                    UiStyles.CodeWindow,
                    new UiStyle
                    {
                        Background = new SolidBrush(Color.White),
                    }
                }
            };
            uiPreferencesSvc.Stub(u => u.Styles).Return(styles);
            var sc = new ServiceContainer();
            decompilerSvc.Decompiler = decompiler;
            sc.AddService<IDecompilerService>(decompilerSvc);
            sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
            sc.AddService<IDecompilerShellUiService>(uiSvc);
            codeViewer.SetSite(sc);
        }
Example #4
0
 private TabPage FindPage(IWindowFrame frame)
 {
     return(tabCtrl.TabPages.Cast <TabPage>().Where(p => p.Tag == frame).FirstOrDefault());
 }
Example #5
0
 private TabPage FindPage(IWindowFrame frame)
 {
     return tabCtrl.TabPages.Cast<TabPage>().Where(p => p.Tag == frame).FirstOrDefault();
 }
Example #6
0
        public void Setup()
        {
            mr = new MockRepository();
            program = new Program();
            codeViewer = new CodeViewerPane();
            decompilerSvc = mr.Stub<IDecompilerService>();
            decompiler = mr.Stub<IDecompiler>();
            uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
            uiSvc = mr.Stub<IDecompilerShellUiService>();
            frame = mr.Stub<IWindowFrame>();
            font = new Font("Arial", 10);
            var styles = new Dictionary<string, UiStyle>();
            uiPreferencesSvc.Stub(u => u.Styles).Return(styles);

            var sc = new ServiceContainer();
            decompilerSvc.Decompiler = decompiler;
            sc.AddService<IDecompilerService>(decompilerSvc);
            sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
            sc.AddService<IDecompilerShellUiService>(uiSvc);
            codeViewer.SetSite(sc);
        }
Example #7
0
 public static String GROUP_CONCAT(IComparable expr, IWindowFrame order)
 {
     throw new NotSupportedException();
 }