Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            Logger.Instance.Level = ELogLevel.INFO;

            keyActions = new Action[(byte)EKey.Count] {
                Up, Down, Left, Right, In, Out
            };
            timer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMilliseconds(40)
            };
            timer.Tick += Timer_Tick;

            client  = new PubSubClient();
            drawing = new NetworkModelDrawing()
            {
                NetworkModel = client.Model, Topology = client.Topology, Measurements = client.Measurements
            };
            client.Subscribe(this);
            client.Reconnect();
            client.Download();

            canvas.Focus();
        }
Ejemplo n.º 2
0
        public ElementWindow(long gid, PubSubClient pubSub)
        {
            GID         = gid;
            this.pubSub = pubSub;
            pubSub.Subscribe(this);

            InitializeComponent();
            Title = ModelCodeHelper.GetTypeFromGID(gid) + " " + gid;
            view  = new MaybeElementView(gid, pubSub);
            panel.Children.Add(view.Element);
        }