示例#1
0
        public TweetsViewModel(ListProvider ListIdProvider, ITabFactory tabFactory)
        {
            Disposable = new CompositeDisposable();

            TabFactory        = tabFactory;
            this.ListProvider = ListIdProvider;
            ListId            = this.ListProvider.Id.ToReadOnlyReactivePropertySlim();
            Tabs = new ObservableCollection <TabBase>();

            // TODO 前回起動時のタブを呼び出す処理を追加

            OnLoaded = new ReactiveCommand <RoutedEventArgs>()
                       .AddTo(Disposable);
            OnCurrentTabChanged = new ReactiveCommand <SelectionChangedEventArgs>()
                                  .AddTo(Disposable);
            ReloadPast = new ReactiveCommand()
                         .AddTo(Disposable);
            TabCloseCommand = new ReactiveCommand <RoutedEventArgs>()
                              .AddTo(Disposable);
            CurrentTabChangedCommandByButtonCommand = new ReactiveCommand <RoutedEventArgs>()
                                                      .AddTo(Disposable);

            ListId.Subscribe(async e => await OpenListTabAction(e))
            .AddTo(Disposable);
            OnLoaded.Subscribe(e => OnLoadedAction(e))
            .AddTo(Disposable);
            OnCurrentTabChanged.Subscribe(e => OnCurrentTabChangedAction())
            .AddTo(Disposable);
            ReloadPast.Subscribe(_ => ReloadPastAction())
            .AddTo(Disposable);
            TabCloseCommand.Subscribe(e => OnTabClose(e))
            .AddTo(Disposable);
            CurrentTabChangedCommandByButtonCommand.Subscribe(e => CurrentTabChangedCommandByButton(e))
            .AddTo(Disposable);
        }
        public void Configure(IConfiguration configuration, ConnectionMultiplexer theCache)
        {
            ContextProvider.Configuration = configuration;

            AppUser.SALT = Encoding.ASCII.GetBytes(configuration.GetSection("Security")["SALT"]).Take(16).ToArray();

            ListProvider = new ListProvider();
            TheCache     = theCache;

            DefaultBusinessBase          = (contextProvider, objectName, dbNumber) => new BusinessBase(contextProvider, objectName, dbNumber);
            DefaultBusinessBaseDecorator = () => new BusinessBaseDecorator(this);
        }
示例#3
0
 public MainWindow()
 {
     InitializeComponent();
     
     this.MouseLeftButtonDown += (sender, e) => this.DragMove();
     this.Closing += MainWindow_Closing;
     this.List_SW = new List<StreamWindow>();
     this.ListProvider_SW = new ListProvider<StreamWindow>(this.List_SW, this.ListBox_SW);
     this.ProcessName.Text = "行程名:" + System.Diagnostics.Process.GetCurrentProcess().ProcessName;
     this.dt = new DispatcherTimer(DispatcherPriority.Normal);
     this.dt.Interval = new TimeSpan(0, 0, 1);
     this.dt.Tick += new EventHandler(dispatcherTimer_Tick);
     this.dt.Start();
 }
示例#4
0
 private void btnLogin_Click(object sender, RoutedEventArgs e)
 {
     //valideer naam en ww en navigeer naar admin hub
     try
     {
         ListProvider.Inloggen(tbName.Text, tbPass.Password);
         Window window = new AdminHub();
         window.Show();
         this.Hide();
     }
     catch (Exception)
     {
         MessageBox.Show("Uw gebruikersnaam of wachtwoord is niet correct.");
     }
 }
        public void GivenMockInputsThenConstructsListAsExpected()
        {
            const string id          = "Id";
            const string listCode    = "List code";
            const string name        = "Name";
            const int    order       = 1;
            const string description = "Description";
            const bool   enabled     = true;

            var mockIdGenerator = new Mock <IIdGenerator>();

            mockIdGenerator.Setup(x => x.Generate()).Returns(id);

            var mockDobihRecord = new Mock <IDobihRecord>();

            mockDobihRecord.Setup(x => x.Lists).Returns(new List <string> {
                listCode
            });

            var mockDobihFile = new Mock <IDobihFile>();

            mockDobihFile.Setup(x => x.Records).Returns(new List <IDobihRecord> {
                mockDobihRecord.Object
            });

            var mockListInfoProvider = new Mock <IListInfoProvider>();

            mockListInfoProvider
            .Setup(x => x.GetListInfoFor(listCode))
            .Returns(new ListInfo
            {
                Code        = listCode,
                Name        = name,
                Order       = order,
                Description = description,
                Enabled     = enabled
            });

            var sut = new ListProvider(mockIdGenerator.Object, mockDobihFile.Object, mockListInfoProvider.Object);

            var actual = sut.GetByDobihId(listCode);

            Assert.That(actual.Id, Is.EqualTo(id));
            Assert.That(actual.Name, Is.EqualTo(name));
            Assert.That(actual.Order, Is.EqualTo(order));
            Assert.That(actual.Description, Is.EqualTo(description));
        }
示例#6
0
        public ActionResult DeleteConfirmed(int id)
        {
            BadBee.Core.DAL.BadBee BadBeeNumbers = db.BadBee.Find(id);
            db.BadBee.Remove(BadBeeNumbers);
            List <Item> items = db.Item.Where(q => q.BadBee.BadBeeNo == BadBeeNumbers.BadBeeNo).ToList();

            foreach (var item in items)
            {
                db.Item.Remove(item);
            }
            db.SaveChanges();

            GlobalVars.DictionaryCache = new Dictionary <Type, object>();
            ListProvider.FillDictionaryCache();

            return(RedirectToAction("Index"));
        }
示例#7
0
 private void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         ListProvider lst = new ListProvider();
         lst.ShowDialog();
         txtId.Text    = lst.dgv_lstProvider.CurrentRow.Cells[0].Value.ToString();
         txtNomC.Text  = lst.dgv_lstProvider.CurrentRow.Cells[1].Value.ToString();
         txtTele1.Text = lst.dgv_lstProvider.CurrentRow.Cells[2].Value.ToString();
         txtTele2.Text = lst.dgv_lstProvider.CurrentRow.Cells[3].Value.ToString();
         txtEmail.Text = lst.dgv_lstProvider.CurrentRow.Cells[4].Value.ToString();
     }
     catch
     {
         return;
     }
 }
示例#8
0
        protected override void Init()
        {
            base.Init();

            if (_listProvider == null)
                _listProvider = new ListProvider();

            if (IsEdit)
            {
                Title = "Edit List | Frebo Cms";
                ltlTitle.Text = "Edit";
            }
            else
            {
                Title = "New List | Frebo Cms";
                ltlTitle.Text = "New";
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Thickness thicknesses = db.Thickness.Find(id);

            db.Thickness.Remove(thicknesses);
            List <Item> items = db.Item.Where(q => q.BadBee.Dimension.Thickness.ThicknessId == thicknesses.ThicknessId).ToList();

            foreach (var item in items)
            {
                db.Item.Remove(item);
            }
            db.SaveChanges();

            GlobalVars.DictionaryCache = new Dictionary <Type, object>();
            ListProvider.FillDictionaryCache();

            return(RedirectToAction("Index"));
        }
示例#10
0
        protected override void Init()
        {
            base.Init();

            if (_listItemProvider == null)
                _listItemProvider = new ListItemProvider();
            if (_listProvider == null)
                _listProvider = new ListProvider();

            if (IsEdit)
            {
                Title = "Edit List Item | " + CoreSettings.CurrentSite.Name;
                ltlTitle.Text = "Edit";
            }
            else
            {
                Title = "New List Item  | " + CoreSettings.CurrentSite.Name;
                ltlTitle.Text = "New";
            }
        }
示例#11
0
 protected override ListItemProvider Create()
 {
     _provider = new ListProvider(new ListInformationStub());
     _listItem = ListItemInformationStub.Create("expected item") as ListItemInformationStub;
     return(new ListItemProvider(_provider, _listItem));
 }
示例#12
0
 public Settings(ListBox myfolders, ListBox myfiles)
 {
     this.MyFilePathList = new List<string>();
     this.MyFolderPathList = new List<string>();
     this.MyFilePathList_prov = new ListProvider<string>(this.MyFilePathList, myfiles);
     this.MyFolderPathList_prov = new ListProvider<string>(this.MyFolderPathList, myfolders);
 }
        //*** Sensor Method
        private void InitData()
        {
            loadOptionFromFile();

            pos[0] = new float[3];
            pos[1] = new float[3];

            for (int i = 0; i < 3; i++)
            {
                r[i] = new float[3];
                awSum[i] = 0.0f;
                awZero[i] = 0.0f;
            }

            for(int i=0; i < 2; i++)
            {
                for(int j=0 ; j < 3 ; j++)
                {
                    pos[i][j] = 0.0f;
                }
            }

            for (int i = 0; i < 4; i++ )
            {
                aw[i] = new float[3];
                vw[i] = new float[3];
                for(int j = 0 ; j < 3 ; j++)
                {
                    aw[i][j] = 0.0f;
                    vw[i][j] = 0.0f;
                }
            }

            for (int i = 0; i < awSize; i ++)
            {
                awHistory[i] = new float[3];
                for(int j=0 ; j < 3 ; j++)
                {
                    awHistory[i][j] = 0.0f;
                }
            }

                switch (DeviceRule)
                {
                    case Rule.SensorNode:
                        DATA_BUFFER_SIZE = DATA_LENGTH * PACKAGE_COUNT * sizeof(Int16) + sizeof(Int32);

                        //Chart data binding
                        this.AccelChartProvider = new ListProvider(AccelChartList);
                        this.AccelChartProvider.List.Add(accelXQ);
                        this.AccelChartProvider.List.Add(accelYQ);
                        this.AccelChartProvider.List.Add(accelZQ);

                        this.GyroChartProvider = new ListProvider(GyroChartList);
                        this.GyroChartProvider.List.Add(gyroXQ);
                        this.GyroChartProvider.List.Add(gyroYQ);
                        this.GyroChartProvider.List.Add(gyroZQ);

                        ChartP.DataSourceSettings.DataSource = this.AccelChartProvider;
                        ChartA.DataSourceSettings.DataSource = this.GyroChartProvider;

                        break;
                    case Rule.MotionNode:
                        this.AccelChartProvider = new ListProvider(AccelChartList);
                        this.AccelChartProvider.List.Add(accX);
                        this.AccelChartProvider.List.Add(accY);
                        this.AccelChartProvider.List.Add(accZ);

                        this.GyroChartProvider = new ListProvider(GyroChartList);
                        this.GyroChartProvider.List.Add(gyroX);
                        this.GyroChartProvider.List.Add(gyroY);
                        this.GyroChartProvider.List.Add(gyroZ);

                        this.MagChartProvider = new ListProvider(MagChartList);
                        this.MagChartProvider.List.Add(magX);
                        this.MagChartProvider.List.Add(magY);
                        this.MagChartProvider.List.Add(magZ);

                        ChartP.DataSourceSettings.DataSource = this.AccelChartProvider;
                        ChartP.AxisY.Max = 2.0f;
                        ChartP.AxisY.Min = -2.0f;

                        ChartA.DataSourceSettings.DataSource = this.GyroChartProvider;
                        ChartA.AxisY.Max = 500.0f;
                        ChartA.AxisY.Min = -500.0f;

                        break;

                }

            gyroXQ.Clear();
            gyroXQ.Clear();
            gyroXQ.Clear();
            gAngleXQ.Clear();
            gAngleYQ.Clear();
            gAngleZQ.Clear();

            accelXQ.Clear();
            accelYQ.Clear();
            accelZQ.Clear();
            angleXQ.Clear();
            angleYQ.Clear();
            angleZQ.Clear();

            velocityX.Clear();
            velocityY.Clear();
            velocityZ.Clear();
            positionX.Clear();
            positionY.Clear();
            positionZ.Clear();

            accX.Clear();
            accY.Clear();
            accZ.Clear();
            gyroX.Clear();
            gyroY.Clear();
            gyroZ.Clear();
            magX.Clear();
            magY.Clear();
            magZ.Clear();

            senseT.Clear();

            //Initial list to avoid garbage calculation
            while (gyroXQ.Count < DATA_BUFFER_MAX)
            {
                gyroXQ.Add(0);
                gyroYQ.Add(0);
                gyroZQ.Add(0);
                gAngleXQ.Add(0);
                gAngleYQ.Add(0);
                gAngleZQ.Add(0);

                accelXQ.Add(0);
                accelYQ.Add(0);
                accelZQ.Add(0);
                angleXQ.Add(0);
                angleYQ.Add(0);
                angleZQ.Add(0);

                velocityX.Add(0);
                velocityY.Add(0);
                velocityZ.Add(0);
                positionX.Add(0);
                positionY.Add(0);
                positionZ.Add(0);

                accX.Add(0.0f);
                accY.Add(0.0f);
                accZ.Add(0.0f);
                gyroX.Add(0.0f);
                gyroY.Add(0.0f);
                gyroZ.Add(0.0f);
                magX.Add(0.0f);
                magY.Add(0.0f);
                magZ.Add(0.0f);

                senseT.Add(0.0f);
            }
        }
示例#14
0
 protected override void Init()
 {
     base.Init();
     if (_listProvider == null)
         _listProvider = new ListProvider();
     if (_listItemProvider == null)
         _listItemProvider = new ListItemProvider();
 }
示例#15
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (ListLog.Expression != null)
            {
                targetCommand.AddParameter("ListLog", ListLog.Get(context));
            }

            if (LogName.Expression != null)
            {
                targetCommand.AddParameter("LogName", LogName.Get(context));
            }

            if (ListProvider.Expression != null)
            {
                targetCommand.AddParameter("ListProvider", ListProvider.Get(context));
            }

            if (ProviderName.Expression != null)
            {
                targetCommand.AddParameter("ProviderName", ProviderName.Get(context));
            }

            if (Path.Expression != null)
            {
                targetCommand.AddParameter("Path", Path.Get(context));
            }

            if (MaxEvents.Expression != null)
            {
                targetCommand.AddParameter("MaxEvents", MaxEvents.Get(context));
            }

            if (Credential.Expression != null)
            {
                targetCommand.AddParameter("Credential", Credential.Get(context));
            }

            if (FilterXPath.Expression != null)
            {
                targetCommand.AddParameter("FilterXPath", FilterXPath.Get(context));
            }

            if (FilterXml.Expression != null)
            {
                targetCommand.AddParameter("FilterXml", FilterXml.Get(context));
            }

            if (FilterHashtable.Expression != null)
            {
                targetCommand.AddParameter("FilterHashtable", FilterHashtable.Get(context));
            }

            if (Force.Expression != null)
            {
                targetCommand.AddParameter("Force", Force.Get(context));
            }

            if (Oldest.Expression != null)
            {
                targetCommand.AddParameter("Oldest", Oldest.Get(context));
            }

            if (GetIsComputerNameSpecified(context) && (PSRemotingBehavior.Get(context) == RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", PSComputerName.Get(context));
            }


            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
示例#16
0
 /// <summary>
 /// Called by the subscriber to the data source to disposes of the cookie (== this object) they were given.
 /// </summary>
 public void Dispose()
 {
     ListProvider.RemoveSinkManager(this);
 }