Exemplo n.º 1
0
        public Result OnStartup(UIControlledApplication ui_control_app)
        {
            try
            {
                log_worker = new UltimateLogCreator();
                List <string> list_of_log_string = new List <string>();
                _cached_Ui_Ctr_App = ui_control_app;
                ControlledApplication contrl_app = _cached_Ui_Ctr_App.ControlledApplication;

                // Method to add Tab and Panel
                RibbonPanel panel            = RibbonPanel(_cached_Ui_Ctr_App);
                string      thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
                button1 = panel.AddItem(new PushButtonData("Connect to db", "Connect to db", thisAssemblyPath,
                                                           "DBListenTest.SubscribeCommand")) as PushButton;
                button1.ToolTip = "Connect to db";

                button2 = panel.AddItem(new PushButtonData("Test db", "Test db", thisAssemblyPath,
                                                           "DBListenTest.TestDbCommand")) as PushButton;
                button2.ToolTip = "Test db";

                //button1.Enabled = true;
                //panel.Enabled = true;
                return(Result.Succeeded);
            }
            catch (Exception exception)
            {
                var _logModel = new LoggerView("UpdateParam Exception", exception.ToString());
                _logModel.Show();
                //TaskDialog.Show("Construction model's tools APP run faild", exception.ToString());
                return(Result.Failed);
            }
        }
Exemplo n.º 2
0
 public MainViewModel()
 {
     if (App.Master != null)
     {
         _loggerView = new LoggerView();
     }
 }
Exemplo n.º 3
0
        private void LoggerPump_Tick(object sender, EventArgs e)
        {
            while (_loggerPump.Count > 0)
            {
                var message = _loggerPump.Dequeue();

                if (message == null)
                {
                    break;
                }

                if (message.TraceLevel > UiTraceLevel)
                {
                    continue;
                }

                var color = Color.Black;

                if (message.TraceLevel == TraceLevel.Verbose)
                {
                    color = Color.DarkSlateGray;
                }
                else if (message.TraceLevel == TraceLevel.Info)
                {
                    color = Color.Black;
                }
                else if (message.TraceLevel == TraceLevel.Warning)
                {
                    color = Color.DarkOrange;
                }
                else if (message.TraceLevel == TraceLevel.Error)
                {
                    color = Color.DarkRed;
                }

                LoggerView.SelectionStart  = LoggerView.TextLength;
                LoggerView.SelectionLength = 0;

                LoggerView.SelectionColor = color;
                LoggerView.AppendText(DateTime.Now.ToString("hh\\:mm\\:ss\t"));
                LoggerView.AppendText(message.Message);
                LoggerView.SelectionColor = LoggerView.ForeColor;

                LoggerView.AppendText("\r\n");

                if (LoggerView.Text.Length > MaxOnScreenLogLength)
                {
                    var diff      = LoggerView.Text.Length - MaxOnScreenLogLength;
                    var firstCrLf = LoggerView.Text.IndexOf("\r\n", diff);
                    LoggerView.Text = LoggerView.Text.Substring(firstCrLf + 2);
                }

                LoggerView.SelectionStart = LoggerView.Text.Length;
                LoggerView.ScrollToCaret();
            }
            StatustQueueSize.Text = _changeQueue.Count.ToString();

            Application.DoEvents();
        }
Exemplo n.º 4
0
 public LoggerViewerModule(IRegionManager regionManager, IBotLogger logger)
 {
     _regionManager = regionManager;
     _logger        = logger;
     if (_logger != null)
     {
         _view = new LoggerView(new LoggerViewModel(_logger));
     }
 }
Exemplo n.º 5
0
    private void InitCoreManager()
    {
        RegisterLog();
        DontDestroyOnLoad(this.gameObject);
        log.Debug("Start game application...");
        GameWorld.GetInstance();
        LoggerView.GetInstance();
        CameraLayerManager.GetInstance();
        AssetLoader.GetInstance();
        ViewCameraManager.GetInstance().Init();
        LayerManager.GetInstance().Init();
        RemoteCallLogic.GetInstance();
        NGUIManager.GetInstance();

        LoginController.GetInstance();
        SceneLogic.GetInstance();
        PlayerController.GetInstance();
        BagLogic.GetInstance();
        NpcLogic.GetInstance();
        TimeManager.GetInstance();
        ViewManager.GetInstance();
        gameObject.AddComponent("CronJob");
        LoadResource();

        //ActiveRush.InitFx();



        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_g2"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao01_lipihuashantexiao"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_mingzhong2"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong_g"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_wuqifeixing"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao02_nuzhanbahuang_gongji"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_06_nuhou_shifa"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_05_zhenfei"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng"));
        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng_mingzhong"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2"));

        AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_levelup"));

        AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan_yellow"), PLAYER_SEL_LoadComplete, AssetType.BUNDLER);
        AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan2_red"), NPC_SEL_LoadComplete, AssetType.BUNDLER);

        PreLoad.GetInstance().OnEnterScene();
        SelecterManager.GetInstance();
    }
Exemplo n.º 6
0
        public StudentsConsolePanel(McrFactory mcrFactory,
                                    SessionStatesQuerier sessionStatesQuerier,
                                    StudentStatesQuerier studentsQuerier,
                                    LoggerView loggerView) : this()
        {
            this.mcrFactory           = mcrFactory;
            this.sessionStatesQuerier = sessionStatesQuerier;
            this.studentStatesQuerier = studentsQuerier;
            this.loggerView           = loggerView;
            this.studentsInfoTableLayoutPanel.onStudentCellClicked = this.StudentCell_Clicked;

            presenter = new StudentsConsolePresenter(mcrFactory.createMcrRepository());
            presenter.setStudentsConsoleView(this);
        }
Exemplo n.º 7
0
 public override void FixedUpdate()
 {
     base.FixedUpdate();
     if (Mathf.Abs(targetCombat - curCombat) > Mathf.Abs(addCount))
     {
         curCombat            += addCount;
         base.CombatLabel.text = curCombat.ToString();
     }
     else if (targetCombat != curCombat)
     {
         curCombat             = targetCombat;
         base.CombatLabel.text = curCombat.ToString();
     }
     LoggerView.GetInstance().PlayerMessage = GetPlayerMessage();
 }
Exemplo n.º 8
0
        public LoggerViewModel(IEventAggregator eventAggregator)
        {
            Name      = "Logger";
            Title     = "Logger";
            ContentId = "Logger";
            _model    = new LoggerModel();
            Model     = _model;
            IsVisible = false;

            _view = new LoggerView
            {
                DataContext = _model
            };
            View = _view;

            _aggregator = eventAggregator;
            _aggregator.GetEvent <LogEvent>().Subscribe(AddLog);
        }
        public void Execute(UIApplication uiapp)
        {
            try
            {
                uint timestamp_before_bim_update
                    = Util.UnixTimestamp();

                Document doc = uiapp.ActiveUIDocument.Document;

                string error_message = null;

                bool rc = UpdateBim(doc, DBListener.ModifiedDoors, ref error_message);
            }
            catch (Exception exception)
            {
                var _logModel = new LoggerView("UpdateParam Exception", exception.ToString());
                _logModel.Show();
            }
        }
Exemplo n.º 10
0
 public Result OnShutdown(UIControlledApplication a)
 {
     try
     {
         if (Subscribed)
         {
             _event.Dispose();
             _event = null;
         }
         //_event.Dispose();
         //_event = null;
         return(Result.Succeeded);
     }
     catch (Exception exception)
     {
         var _logModel = new LoggerView("UpdateParam Exception", exception.ToString());
         _logModel.Show();
         return(Result.Failed);
     }
 }
Exemplo n.º 11
0
        private void OnToggleLogger(LoggerVM vm, bool toggle)
        {
            if (toggle)
            {
                if (_loggerView == null)
                {
                    _loggerView = new LoggerView();

                    _loggerView.Initialize(vm);
                    _loggerView.VisibleChanged += (s, a) => ChangeCheckedState(LogConsoleShowToolStripMenuItem, s as Control);
                    _loggerView.Show(EditorView, DockState.Float);
                }
                else
                {
                    _loggerView.Show(EditorView);
                }
            }
            else
            {
                _loggerView.Hide();
            }
        }
Exemplo n.º 12
0
        private void logToolStripMenuItemViewLog_Click(object sender, EventArgs e)
        {
            LoggerView v = new LoggerView();

            v.ShowDialog();
        }
        /// <summary>
        /// Update the BIM with the given database records.
        /// </summary>
        ///

        public static bool UpdateBim(Document doc, List <string> doors, ref string error_message)
        //List<DBData> doors,
        {
            try
            {
                FilteredElementCollector f_collector = new FilteredElementCollector(doc).WhereElementIsNotElementType();
                IList <Element>          elements    = f_collector.OfCategory(BuiltInCategory.OST_Furniture).ToElements();

                View        activ_view = doc.ActiveView;
                Application app        = doc.Application;

                var patternCollector = new FilteredElementCollector(doc.ActiveView.Document);

                patternCollector.OfClass(typeof(Autodesk.Revit.DB.FillPatternElement));
                Autodesk.Revit.DB.FillPatternElement solidFill =
                    patternCollector.ToElements()
                    .Cast <Autodesk.Revit.DB.FillPatternElement>()
                    .First(x => x.GetFillPattern().IsSolidFill);

                UIDocument uidoc = new UIDocument(doc);
                Color      color = new Color((byte)150, (byte)200, (byte)200);

                OverrideGraphicSettings grafics       = new OverrideGraphicSettings();
                OverrideGraphicSettings grafics_clear = new OverrideGraphicSettings();

                grafics.SetSurfaceForegroundPatternColor(color);
                grafics.SetSurfaceForegroundPatternId(solidFill.Id);

                int db_count   = Convert.ToInt32(doors[0]);
                int elem_count = 0;

                //TaskDialog.Show("target", db_count.ToString());

                using (Transaction t = new Transaction(doc))
                {
                    t.Start("db-test");

                    foreach (Element elem in elements)
                    {
                        elem_count += 1;
                        activ_view.SetElementOverrides(elem.Id, grafics_clear);
                        if (elem_count == db_count)
                        {
                            activ_view.SetElementOverrides(elem.Id, grafics);
                        }
                    }

                    uidoc.RefreshActiveView();
                    t.Commit();
                }
            }
            catch (Exception exception)
            {
                var _logModel = new LoggerView("UpdateParam Exception", exception.ToString());
                _logModel.Show();
                //TaskDialog.Show("Construction model's tools APP run faild", exception.ToString());
                return(false);
            }

            return(true);
        }
Exemplo n.º 14
0
 private void setLoggerView(LoggerView loggerView)
 {
     this.loggerView = loggerView;
 }
Exemplo n.º 15
0
 public void LogIn(LoggerView view)
 {
     _credentialDataModel.LogIn(view.UserName.Text, view.PasswordB.Password);
     _accessViewModel.LogIn();
 }