public void Filter(ItemsList filterList, ItemsList originalList, string search)
    {
      // Handle external filter
      if (string.IsNullOrEmpty(search))
        return;

      // Handle given search as single key
      KeyPress(search[0]);

      // List will not be replaced, as the instance is already bound by screen, we only filter items.
      filterList.Clear();
      foreach (NavigationItem item in originalList.OfType<NavigationItem>())
      {
        var simpleTitle = item.SimpleTitle;

        // Filter
        if (_listFilterAction == FilterAction.StartsWith)
        {
          if (simpleTitle.ToLower().StartsWith(_listFilterString))
            filterList.Add(item);
        }
        else
        {
          if (NumPadEncode(simpleTitle).Contains(_listFilterString))
            filterList.Add(item);
        }
      }
      filterList.FireChange();
    }
        public LayoutTypeModel()
        {
            items = new ItemsList();

            ListItem listItem = new ListItem(Consts.KEY_NAME, "List")
            {
                Command = new MethodDelegateCommand(() => UpdateLayout(LayoutType.List))
            };
            listItem.AdditionalProperties[KEY_LAYOUT_TYPE] = LayoutType.List;
            items.Add(listItem);

            ListItem gridItem = new ListItem(Consts.KEY_NAME, "Grid")
            {
                Command = new MethodDelegateCommand(() => UpdateLayout(LayoutType.Icons))
            };
            gridItem.AdditionalProperties[KEY_LAYOUT_TYPE] = LayoutType.Icons;
            items.Add(gridItem);

            ListItem coversItem = new ListItem(Consts.KEY_NAME, "Covers")
            {
                Command = new MethodDelegateCommand(() => UpdateLayout(LayoutType.Cover))
            };
            coversItem.AdditionalProperties[KEY_LAYOUT_TYPE] = LayoutType.Cover;
            items.Add(coversItem);
        }
 internal GenericDialogData(string headerText, string text, ItemsList dialogButtons, Guid dialogHandle)
 {
   _headerTextProperty = new SProperty(typeof(string), headerText);
   _textProperty = new SProperty(typeof(string), text);
   _dialogButtonsList = dialogButtons;
   _dialogHandle = dialogHandle;
 }
 public ChannelProgramListItem(IChannel channel, ItemsList programs)
 {
     SetLabel(Consts.KEY_NAME, channel.Name);
       Programs = programs;
       Channel = channel;
       ChannelLogoPath = string.Format("channellogos\\{0}.png", channel.Name);
 }
        public void ShowDialog(string header, ItemsList items)
        {
            Header = header;
            this.items = items;

            IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
            screenManager.ShowDialog(Consts.DIALOG_LIST);
        }
 private void NavigateToNewOrder()
 {
     var itemsList = new ItemsList();
     var orderPage = new OrderPage();
     itemsList.ItemSelected += (o, args) => orderPage.AddNewOrderItem(args);
     MainContentFrame.Navigate(itemsList);
     OrderFrame.Navigate(orderPage);
 }
Beispiel #7
0
 public PowerMenuModel()
 {
   _isMenuOpenProperty = new WProperty(typeof(bool), true);
   _menuItems = new ItemsList();
   _settings = new SettingsChangeWatcher<SystemStateDialogSettings>();
   _settings.SettingsChanged = OnSettingsChanged;
   _needsUpdate = true;
 }
 void showContext()
 {
     ItemsList items = new ItemsList();
     items.Add(new ListItem(Consts.KEY_NAME, "[Emulators.Config.Edit]")
     {
         Command = new MethodDelegateCommand(() => ConfigureEmulatorModel.EditEmulator(emulator))
     });
     ListDialogModel.Instance().ShowDialog(emulator.Title, items);
 }
 protected static ItemsList GetOrCreateNavigationItems(NavigationContext context)
 {
   lock (context.SyncRoot)
   {
     ItemsList result = GetNavigationItems(context);
     if (result == null)
       context.ContextVariables[NAVIGATION_ITEMS_KEY] = result = new ItemsList();
     return result;
   }
 }
 public OnlineVideosWorkflowModel()
 {
     SiteGroupsList = new ItemsList();
     SitesList = new ItemsList();
     
     // create a message queue where we listen to changes to the sites
     _messageQueue = new AsynchronousMessageQueue(this, new string[] { OnlineVideosMessaging.CHANNEL });
     _messageQueue.MessageReceived += new MessageReceivedHandler(OnlineVideosMessageReceived);
     _messageQueue.Start();
 }
        public SiteManagementWorkflowModel()
        {
            SitesList = new ItemsList();
            // make sure the main workflowmodel is initialized
            var ovMainModel = ServiceRegistration.Get<IWorkflowManager>().GetModel(Guids.WorkFlowModelOV) as OnlineVideosWorkflowModel;

            _messageQueue = new AsynchronousMessageQueue(this, new string[] { OnlineVideosMessaging.CHANNEL });
            _messageQueue.MessageReceived += new MessageReceivedHandler(OnlineVideosMessageReceived);

            _settingsWatcher = new SettingsChangeWatcher<Configuration.Settings>();
            _settingsWatcher.SettingsChanged += OnlineVideosSettingsChanged;
        }
    public WifiConnectionModel()
    {
      _isWifiAvailableProperty = new WProperty(typeof(bool), WlanClient.Instance.Interfaces.Length > 0);
      _networkList = new ItemsList();

      _queue = new AsynchronousMessageQueue(this, new string[]
        {
            WifiConnectionMessaging.CHANNEL,
        });
      _queue.MessageReceived += OnMessageReceived;
      _queue.Start();
    }
Beispiel #13
0
 protected void InitializeTree()
 {
   _tree = new ItemsList();
   TreeItem item = new TreeItem("Name", "First item");
   CreateChildren(item, 2, 3);
   _tree.Add(item);
   item = new TreeItem("Name", "Second item");
   CreateChildren(item, 2, 4);
   _tree.Add(item);
   item = new TreeItem("Name", "Third item");
   CreateChildren(item, 2, 5);
   _tree.Add(item);
 }
    public PartyMusicPlayerModel()
    {
      _useEscapePasswordProperty = new WProperty(typeof(bool), true);
      _escapePasswordProperty = new WProperty(typeof(string), null);
      _disableScreenSaverProperty = new WProperty(typeof(bool), true);
      _playlistNameProperty = new WProperty(typeof(string), null);
      _playModeProperty = new WProperty(typeof(PlayMode), PlayMode.Continuous);
      _repeatModeProperty = new WProperty(typeof(RepeatMode), RepeatMode.All);

      _playlists = new ItemsList();

      LoadSettings();
    }
    protected bool _autoCloseOnNoServer = false; // Automatically close the dialog if no more servers are available in the network

    #endregion

    public ServerAttachmentModel()
    {
      _isNoServerAvailableProperty = new WProperty(typeof(bool), false);
      _isSingleServerAvailableProperty = new WProperty(typeof(bool), false);
      _isMultipleServersAvailableProperty = new WProperty(typeof(bool), false);
      _availableServers = new ItemsList();
      _messageQueue = new AsynchronousMessageQueue(this, new string[]
          {
            ServerConnectionMessaging.CHANNEL,
            DialogManagerMessaging.CHANNEL,
          });
      _messageQueue.MessageReceived += OnMessageReceived;
      // Message queue will be started in method EnterModelContext
    }
 public PlatformSelectModel()
 {
     items = new ItemsList();
     var platforms = Dropdowns.GetPlatformList();
     for (int i = -1; i < platforms.Count; i++)
     {
         string platformName = i < 0 ? "" : platforms[i].Name;
         ListItem item = new ListItem(Consts.KEY_NAME, platformName)
         {
             Command = new MethodDelegateCommand(() => UpdatePlatform(platformName))
         };
         item.AdditionalProperties[KEY_PLATFORM] = platformName;
         items.Add(item);
     }
 }
 ItemsList CreateContextMenuEntries()
 {
     var ctxEntries = new ItemsList();
     ctxEntries.Add(
         new ListItem(Consts.KEY_NAME, new StringId("[OnlineVideos.RemoveFromMySites]"))
         {
             Command = new MethodDelegateCommand(() => RemoveSite())
         });
     if (Site.GetUserConfigurationProperties().Count > 0)
         ctxEntries.Add(
             new ListItem(Consts.KEY_NAME, new StringId("[OnlineVideos.ChangeSettings]"))
             {
                 Command = new MethodDelegateCommand(() => ConfigureSite())
             });
     return ctxEntries;
 }
 /// <summary>
 /// Creates a <see cref="WorkflowAction"/> that pushes a dialog as transient state on the navigation stack.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="name"></param>
 /// <param name="displayLabel"></param>
 /// <param name="dialogItems"></param>
 /// <param name="sourceState"></param>
 /// <param name="action"></param>
 /// <returns></returns>
 public static WorkflowAction CreateDialogMenuAction(Guid id, string name, string displayLabel, ItemsList dialogItems, WorkflowState sourceState, Action<ListItem> action)
 {
     return new PushTransientStateNavigationTransition(
         id,
         sourceState.Name + "->" + name,
         displayLabel,
         new Guid[] { sourceState.StateId },
         WorkflowState.CreateTransientState(name, displayLabel, true, "ovsDialogGenericItems", false, WorkflowType.Dialog),
         LocalizationHelper.CreateResourceString(displayLabel))
     {
         SortOrder = name,
         WorkflowNavigationContextVariables = new Dictionary<string, object>
         {
             { Constants.CONTEXT_VAR_ITEMS, dialogItems },
             { Constants.CONTEXT_VAR_COMMAND, new CommandContainer<ListItem>(action) }
         }
     };
 }
 public ViewModeModel()
 {
     startupItems = new ItemsList();
     var startupStates = StartupStateSetting.StartupStates;
     foreach (string key in startupStates.Keys)
     {
         StartupState state = startupStates[key];
         if (state != StartupState.LASTUSED)
         {
             ListItem item = new ListItem(Consts.KEY_NAME, LocalizationHelper.CreateResourceString(key))
             {
                 Command = new MethodDelegateCommand(() => SetStartupState(state))
             };
             item.AdditionalProperties[KEY_STARTUP_STATE] = state;
             startupItems.Add(item);
         }
     }
 }
        void initImporter()
        {
            lock (syncRoot)
            {
                if (importerInit)
                    return;

                itemsDictionary = new Dictionary<int, RomMatchViewModel>();
                items = new ItemsList();

                Importer importer = ServiceRegistration.Get<IEmulatorsService>().Importer;
                rebuildItemsList(importer.AllMatches);
                importer.ImportStatusChanged += importer_ImportStatusChanged;
                importer.ProgressChanged += importer_ProgressChanged;
                importer.RomStatusChanged += importer_RomStatusChanged;
                importer.Start();
                importerInit = true;
            }
        }
        void commandDelegate()
        {
            var matches = romMatch.PossibleGameDetails;
            if (matches == null || matches.Count == 0)
                return;

            ScraperResult currentMatch = romMatch.GameDetails;
            ItemsList items = new ItemsList();
            for (int i = 0; i < matches.Count; i++)
            {
                ScraperResult match = matches[i];
                ListItem item = new ListItem(Consts.KEY_NAME, match.ToString());
                item.Command = new MethodDelegateCommand(() =>
                {
                    ServiceRegistration.Get<IEmulatorsService>().Importer.UpdateSelectedMatch(romMatch, match);
                });
                items.Add(item);
            }
            ListDialogModel.Instance().ShowDialog("[Emulators.Dialogs.SelectMatch]", items);
        }
        static Loader()
        {
            Menu = MainMenu.AddMenu("ReCore", "ReCore");
            Menu.AddGroupLabel("Special thanks to MarioGK for his Mario's Lib.");

            SummonerManager.Initialize();
            ItemManager.Initialize();
            SummonerList.Initialize();
            ItemsList.Initialize();
            Utility.Initialize();
            DangerManager.Initialize();

            Game.OnTick        += OnTick;
            Game.OnUpdate      += OnTick;
            Drawing.OnDraw     += Core.DrawingsUpdater.OnDraw;
            Drawing.OnEndScene += Core.DrawingsUpdater.OnEndScene;

            Menu.AddGroupLabel("Welcome to ReCore v." + AssVersion + " [BETA].");
            Status = Menu.Add("enableReCore", new CheckBox("Enable [NOT RECOMMEND]", false));
            Chat.Print("<font color='#FFFFFF'>ReCore v." + AssVersion + "</font> <font color='#CF2942'>[BETA]</font> <font color='#FFFFFF'>has been loaded.</font>");
        }
Beispiel #23
0
 protected void FillChannelGroupList()
 {
     _channelGroupList = new ItemsList();
     for (int idx = 0; idx < ChannelContext.ChannelGroups.Count; idx++)
     {
         IChannelGroup group            = ChannelContext.ChannelGroups[idx];
         ListItem      channelGroupItem = new ListItem(UiComponents.Media.General.Consts.KEY_NAME, group.Name)
         {
             Command = new MethodDelegateCommand(() =>
             {
                 if (ChannelContext.ChannelGroups.MoveTo(g => g == group))
                 {
                     SetGroup();
                 }
             }),
             Selected = group == ChannelContext.ChannelGroups.Current
         };
         _channelGroupList.Add(channelGroupItem);
     }
     _channelGroupList.FireChange();
 }
Beispiel #24
0
 protected SharesProxy(ShareEditMode? editMode)
 {
   _editMode = editMode;
   _allBaseResourceProvidersList = new ItemsList();
   _isResourceProviderSelectedProperty = new WProperty(typeof(bool), false);
   _baseResourceProviderProperty = new WProperty(typeof(ResourceProviderMetadata), null);
   _nativeSystemProperty = new WProperty(typeof(string), string.Empty);
   _choosenResourcePathStrProperty = new WProperty(typeof(string), string.Empty);
   _choosenResourcePathStrProperty.Attach(OnChoosenResourcePathStrChanged);
   _choosenResourcePathProperty = new WProperty(typeof(ResourcePath), null);
   _choosenResourcePathProperty.Attach(OnChoosenResourcePathChanged);
   _isChoosenPathValidProperty = new WProperty(typeof(bool), false);
   _choosenResourcePathDisplayNameProperty = new WProperty(typeof(string), string.Empty);
   _resourceProviderPathsTree = new ItemsList();
   _shareNameProperty = new WProperty(typeof(string), string.Empty);
   _shareNameProperty.Attach(OnShareNameChanged);
   _isShareNameValidProperty = new WProperty(typeof(bool), true);
   _invalidShareHintProperty = new WProperty(typeof(string), null);
   _allMediaCategoriesTree = new ItemsList();
   _mediaCategories = new HashSet<string>();
 }
        public void DeleteAction(object item)
        {
            ConfirmationDialog confirmation = new ConfirmationDialog()
            {
                FlowDirection   = FlowDirection.RightToLeft,
                DataContext     = new ConfirmationDialogViewModel("Confirmation"),
                Background      = (SolidColorBrush)(new BrushConverter().ConvertFrom("#BF4545")),
                Foreground      = Brushes.GhostWhite,
                BorderBrush     = (SolidColorBrush)(new BrushConverter().ConvertFrom("#99BF4545")),
                BorderThickness = new Thickness(5)
            };

            confirmation.ShowDialog();
            if (confirmation.DialogResult == true)
            {
                db.Watchers.Remove(SelectedItem.Model);
                ItemsList.Remove(SelectedItem);
                db.SaveChanges();
                SelectedItem = null;
            }
        }
        internal async Task <string> saveItemAsync(Item item)
        {
            // Remove item for view (ItemList), add it to the travel on the backend
            if (Amount == "")
            {
                return("Please fill in item's amount");
            }
            try
            {
                item.Count   = int.Parse(Amount);
                item.Checked = false;
                if (item.Count < 1)
                {
                    return("The amount of the item must be a number higher than 0");
                }
                var values = new Dictionary <string, string>
                {
                    { "TravelId", Travel.id.ToString() },
                    { "ItemId", item.Id.ToString() },
                    { "Count", Amount }
                };
                var content = new FormUrlEncodedContent(values);
                var result  = await Client.HttpClient.PostAsync("http://localhost:65177/api/Travel/Item", content);

                if (result.StatusCode == HttpStatusCode.OK)
                {
                    ItemsList.Remove(item);
                    if (ItemsList.Count == 0)
                    {
                        await SaveCategoryAndTasks();
                    }
                    return("");
                }
                return("An error occurred while adding item to travel");
            }
            catch (Exception e)
            {
                return("The amount of the item must be a number higher than 0");
            }
        }
        private void Invoices_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                DataGridRow dgr = sender as DataGridRow;
                // get the obect and then Invoice ID opne the Id in readonly mode

                dhInvoice objTodisplay = new dhInvoice();
                objTodisplay.ISaleid = ((dhInvoice)dgr.Item).ISaleid;

                DataSet dsr = iFacede.GetSaleInovice(Globalized.ObjDbName, objTodisplay);
                objTodisplay = (dhInvoice)dgr.Item;
                if ((dsr.Tables.Count > 0) && (dsr.Tables[0].Rows.Count > 0))
                {
                    ObservableCollection <dhInvoice> objlist = ReflectionUtility.DataTableToObservableCollection <dhInvoice>(dsr.Tables[0]);
                    objTodisplay = (dhInvoice)objlist.SingleOrDefault();
                }

                if ((dsr.Tables.Count > 0) && (dsr.Tables[1].Rows.Count > 0))
                {
                    ObservableCollection <dhSaleItem> listItem = ReflectionUtility.DataTableToObservableCollection <dhSaleItem>(dsr.Tables[1]);
                    ItemsList itemlist = new ItemsList().AddRange(listItem);
                    objTodisplay.ItemsOfInvoice = itemlist;
                }

                //DataSet dsr = iFacede.GetSaleInovice(Globalized.ObjDbName, objTodisplay);
                //ObservableCollection<dhSaleItem> ListAccounts = ReflectionUtility.DataTableToObservableCollection<dhSaleItem>(dsr.Tables[1]);
                //ItemsList itemlist = new ItemsList().AddRange(ListAccounts);
                //objTodisplay = (dhInvoice)dgr.Item;
                if (objTodisplay.BIsDraft != true)
                {
                    objTodisplay.IsReadOnly = true;
                }
                else
                {
                    objTodisplay.IsReadOnly = false;
                }
                // AddTabItem(objTodisplay);
            }
        }
Beispiel #28
0
        internal ProjectItem ChangeParentAndPosition(ProjectItem item, ProjectItem newParent, int newPosition)
        {
            EmpiriaLog.Debug($"ChangeParent of {item.Name} to new parent {newParent.Name}");

            if (item.Equals(newParent))
            {
                EmpiriaLog.Info($"Trying to change the parent of a tree item to itself {item.Name} ({item.UID}).");

                return(item);
            }

            var branchToMove = this.GetBranch(item);

            Assertion.Require(!branchToMove.Contains(newParent),
                              $"Can't change the parent of '{item.Name}' because it is a branch " +
                              $"and '{newParent.Name}' is one of its children.");

            // Then remove the whole branch an reinsert it in the new position
            foreach (var branchItem in branchToMove)
            {
                ItemsList.Remove(branchItem);
            }

            item.SetParentAndPosition(newParent, newPosition);

            int insertionIndex = newPosition - 1; // insertionIndex is zero-based

            foreach (var branchItem in branchToMove)
            {
                ItemsList.Insert(insertionIndex, branchItem);

                insertionIndex++;
            }

            this.RefreshPositions();

            EmpiriaLog.Info($"ChangeParentAndPosition of {item.Name} to {newParent.Name} at position {newParent.Position + 1}.");

            return(item);
        }
 protected void UpdatePlaylists(bool create)
 {
     if (!_updateReadyEvent.WaitOne(Consts.TS_WAIT_FOR_PLAYLISTS_UPDATE))
     {
         return;
     }
     try
     {
         ItemsList playlistsList;
         lock (_syncObj)
         {
             if (_playlists == null && !create)
             {
                 // Can happen for example on async updates of the server's set of playlists
                 return;
             }
             if (create)
             {
                 _playlists = new ItemsList();
             }
             playlistsList = _playlists;
         }
         List <PlaylistBase> serverPlaylists = new List <PlaylistBase>();
         try
         {
             if (IsHomeServerConnected)
             {
                 CollectionUtils.AddAll(serverPlaylists, ServerPlaylists.GetPlaylists());
             }
         }
         catch (NotConnectedException) { }
         int numPlaylists = serverPlaylists.Count;
         UpdatePlaylists(playlistsList, serverPlaylists, numPlaylists == 1);
         IsPlaylistsSelected = numPlaylists == 1;
     }
     finally
     {
         _updateReadyEvent.Set();
     }
 }
Beispiel #30
0
        public Master()
        {
            var isTeacher = GetCurrentMember().IsTeacher;

            ProfileModel = ProfilesRealm.Get(GetCurrentUser().Profile.LocalId);

            ItemsList.Add(new MasterItem
            {
                Title      = "My classes",
                IconSource = "myclasses.png",
                TargetType = typeof(Views.Pages.Calendar)
            });
            ItemsList.Add(new MasterItem
            {
                Title      = "Schedule",
                IconSource = "schedule.png",
                TargetType = typeof(Views.Pages.Classes)
            });
            if (!isTeacher)
            {
                ItemsList.Add(new MasterItem
                {
                    Title      = "Evaluations",
                    IconSource = "evaluations.png",
                    TargetType = typeof(Views.Pages.Evaluations)
                });
            }
            ItemsList.Add(new MasterItem
            {
                Title      = "Students",
                IconSource = "students.png",
                TargetType = typeof(Views.Pages.Students)
            });
            ItemsList.Add(new MasterItem
            {
                Title      = "School",
                IconSource = "school.png",
                TargetType = typeof(Views.Pages.Details.School)
            });
        }
Beispiel #31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)//when the customer is sent to "Checkout" page this code will be run first
            {
                //This opens and creates a connection with the database
                SqlConnection _Connection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ado"].ToString());
                _Connection.Open();
                //stores sql into a variable called sqlstring which will be the query for the database
                //This query will return the details of the booking
                string SqlString = "select a.booking_id,a.booking_date,a.booking_time_hour,a.booking_time_minute,a.first_name, a.last_name,a.service_choice,b.service_long_name, c.price from booking a, service b, service_price c where a.service_choice = b.service_choice and b.service_choice = c.service_choice and c.effective_date =(select max(effective_date) from service_price d where c.service_choice = d.service_choice and d.effective_date <=getdate()) ";
                SqlString += " and a.booking_id ='" + Request.QueryString["ID"] + "'";

                //Executes the sql on the database and returns the response object
                Base_Response _Response = GenericServices.ReadRecord.ProcessRead(SqlString, _Connection);
                _Connection.Close();//Closees the connection

                //dv, of type dataView, stores the data from the database from the dataTable ResponseTable in readRecord class, which holds the data table passed from the database, and then displays it to the customer
                DataView dv = new DataView(GenericServices.ReadRecord.ResponseTable);
                ItemsList.DataSource = dv;
                ItemsList.DataBind();
            }
        }
        protected void UpdateItems(bool removing)
        {
            ItemsList itemsList = removing ? _configurationItemsToRemove : _configurationItems;

            itemsList.Clear();
            List <ListItem> items = GetItems(removing);

            if (items == null || items.Count == 0)
            {
                itemsList.FireChange();
                return;
            }
            foreach (ListItem item in items)
            {
                if (removing)
                {
                    item.SelectedProperty.Attach(OnConfigurationSelected);
                }
                itemsList.Add(item);
            }
            itemsList.FireChange();
        }
Beispiel #33
0
 protected SharesProxy(ShareEditMode?editMode)
 {
     _editMode = editMode;
     _allBaseResourceProvidersList       = new ItemsList();
     _isResourceProviderSelectedProperty = new WProperty(typeof(bool), false);
     _baseResourceProviderProperty       = new WProperty(typeof(ResourceProviderMetadata), null);
     _nativeSystemProperty           = new WProperty(typeof(string), string.Empty);
     _choosenResourcePathStrProperty = new WProperty(typeof(string), string.Empty);
     _choosenResourcePathStrProperty.Attach(OnChoosenResourcePathStrChanged);
     _choosenResourcePathProperty = new WProperty(typeof(ResourcePath), null);
     _choosenResourcePathProperty.Attach(OnChoosenResourcePathChanged);
     _isChoosenPathValidProperty             = new WProperty(typeof(bool), false);
     _choosenResourcePathDisplayNameProperty = new WProperty(typeof(string), string.Empty);
     _resourceProviderPathsTree = new ItemsList();
     _shareNameProperty         = new WProperty(typeof(string), string.Empty);
     _shareNameProperty.Attach(OnShareNameChanged);
     _isShareNameValidProperty          = new WProperty(typeof(bool), true);
     _invalidShareHintProperty          = new WProperty(typeof(string), null);
     _allMediaCategoriesTree            = new ItemsList();
     _mediaCategories                   = new HashSet <string>();
     _isMediaCategoriesSelectedProperty = new WProperty(typeof(bool), false);
 }
        public PaymentByCardViewModel(
            IEntityUoWBuilder uowBuilder,
            IUnitOfWorkFactory unitOfWorkFactory,
            ICommonServices commonServices,
            CallTaskWorker callTaskWorker,
            IOrderPaymentSettings orderPaymentSettings
            )
            : base(uowBuilder, unitOfWorkFactory, commonServices)
        {
            this.orderPaymentSettings = orderPaymentSettings ?? throw new ArgumentNullException(nameof(orderPaymentSettings));
            this.callTaskWorker       = callTaskWorker ?? throw new ArgumentNullException(nameof(callTaskWorker));
            TabName = "Оплата по карте";

            ItemsList = UoW.GetAll <PaymentFrom>().ToList();

            if (PaymentByCardFrom == null)
            {
                PaymentByCardFrom = ItemsList.FirstOrDefault(p => p.Id == orderPaymentSettings.DefaultSelfDeliveryPaymentFromId);
            }

            Entity.PropertyChanged += Entity_PropertyChanged;
        }
Beispiel #35
0
        private static ItemsList <Skipper> InitSkippers()
        {
            var skippers = context.GetEntities <Skipper>();
            var pager    = new DefaultPager(4, skippers.Count());

            var skippersSorters = new List <ISortModifier <Skipper> >()
            {
                new SortByExperience()
                {
                    Asc = true
                },
                new SortByPrice()
                {
                    Asc = false
                }
            };


            var skipperList = new ItemsList <Skipper>(skippers, pager, null, skippersSorters);

            return(skipperList);
        }
        private async Task DellIdentTask(string ident, RestClientMP server)
        {
            CommonResult result = await server.DellIdent(ident);

            if (result.Error == null)
            {
                // Settings.EventBlockData = await server.GetEventBlockData();
                ItemsList <NamedValue> resultN = await server.GetRequestsTypes();

                Settings.TypeApp = resultN.Data;
                /*viewModel.*/
                RemoveAccount.Execute(ident); //removeLs(ident);


                Device.BeginInvokeOnMainThread(async() =>
                {
                    IsRefreshing = true;

                    await RefreshPaysData();

                    IsRefreshing = false;
                });

                MessagingCenter.Send <Object, AccountInfo>(this, "RemoveIdent", Settings.Person.Accounts.Where(x => x.Ident == ident).FirstOrDefault());
            }
            else
            {
                await DisplayAlert(AppResources.ErrorTitle, result.Error, "ОК");
            }

            //Device.BeginInvokeOnMainThread(async () =>
            //{
            //    IsRefreshing = true;

            //    await RefreshPaysData();

            //    IsRefreshing = false;
            //});
        }
        public OnlineVideosWorkflowModel()
        {
			SitesList = new ItemsList();

			OnlineVideosAppDomain.UseSeperateDomain = true;

            ServiceRegistration.Get<ISettingsManager>().Load<Configuration.Settings>().SetValuesToApi();
            string ovConfigPath = ServiceRegistration.Get<IPathManager>().GetPath(string.Format(@"<CONFIG>\{0}\", Environment.UserName));
            string ovDataPath = ServiceRegistration.Get<IPathManager>().GetPath(@"<DATA>\OnlineVideos");

            OnlineVideoSettings.Instance.Logger = new LogDelegator();
			OnlineVideoSettings.Instance.UserStore = new Configuration.UserSiteSettingsStore();

			OnlineVideoSettings.Instance.DllsDir = System.IO.Path.Combine(ovDataPath, "SiteUtils");
            OnlineVideoSettings.Instance.ThumbsDir = System.IO.Path.Combine(ovDataPath, "Thumbs");
            OnlineVideoSettings.Instance.ConfigDir = ovConfigPath;

			OnlineVideoSettings.Instance.AddSupportedVideoExtensions(new List<string>() { ".asf", ".asx", ".flv", ".m4v", ".mov", ".mkv", ".mp4", ".wmv" });

			// clear cache files that might be left over from an application crash
			MPUrlSourceFilter.Downloader.ClearDownloadCache();
			// load translation strings in other AppDomain, so SiteUtils can use localized language strings
			TranslationLoader.LoadTranslations(ServiceRegistration.Get<ILocalization>().CurrentCulture.TwoLetterISOLanguageName, System.IO.Path.Combine(System.IO.Path.GetDirectoryName(GetType().Assembly.Location), "Language"), "en", "strings_{0}.xml");
			// The default connection limit is 2 in .Net on most platforms! This means downloading two files will block all other WebRequests.
			System.Net.ServicePointManager.DefaultConnectionLimit = 100;
			// The default .Net implementation for URI parsing removes trailing dots, which is not correct
			Helpers.DotNetFrameworkHelper.FixUriTrailingDots();

			// load the xml that holds all configured sites
			OnlineVideoSettings.Instance.LoadSites();

			// create a message queue where we listen to changes to the sites
			_messageQueue = new AsynchronousMessageQueue(this, new string[] { OnlineVideosMessaging.CHANNEL });
			_messageQueue.MessageReceived += new MessageReceivedHandler(OnlineVideosMessageReceived);

			// listen to changes of configuration settings
			_settingsWatcher = new SettingsChangeWatcher<Configuration.Settings>();
			_settingsWatcher.SettingsChanged += OnlineVideosSettingsChanged;
        }
Beispiel #38
0
        internal ProjectItem ChangePosition(ProjectItem item, int newPosition)
        {
            EmpiriaLog.Debug($"ChangePosition of {item.Name} in position {item.Position} to new position {newPosition}");

            var branchToMove = this.GetBranch(item);

            Assertion.Require(newPosition <branchToMove[0].Position ||
                                           newPosition> branchToMove[branchToMove.Count - 1].Position,
                              "Can't move item because it's a branch and the requested new position is inside it.");

            int insertionIndex = Math.Min(newPosition - 1, this.ItemsList.Count);

            // Get the insertion point before item position
            ProjectItem insertBeforeItem = insertionIndex < this.ItemsList.Count ? this.ItemsList[insertionIndex] : null;

            // Then remove the whole branch an reinsert it in the new position
            foreach (var branchItem in branchToMove)
            {
                ItemsList.Remove(branchItem);
            }

            // Recalculate the new insertion index
            insertionIndex = insertBeforeItem != null?this.ItemsList.IndexOf(insertBeforeItem) : this.ItemsList.Count;

            var newParent = insertBeforeItem != null ? insertBeforeItem.Parent : ProjectItem.Empty;

            item.SetParentAndPosition(newParent, insertionIndex);

            foreach (var branchItem in branchToMove)
            {
                ItemsList.Insert(insertionIndex, branchItem);

                insertionIndex++;
            }

            this.RefreshPositions();

            return(item);
        }
        private async Task RefreshData()
        {
            if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet)
            {
                Device.BeginInvokeOnMainThread(async() =>
                                               await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK"));
                return;
            }

            ItemsList <AccountAccountingInfo> info = await _server.GetAccountingInfo();

            if (info.Error == null)
            {
                Accounts = info.Data;
                additionalList.ItemsSource = null;
                additionalList.ItemsSource = setPays(Accounts[Picker.SelectedIndex]);
            }
            else
            {
                await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorPayInfo, "OK");
            }
        }
Beispiel #40
0
        private void FillRestrictionGroupList()
        {
            _restrictionGroupList = new ItemsList();
            IUserManagement userManagement = ServiceRegistration.Get <IUserManagement>();
            ILocalization   loc            = ServiceRegistration.Get <ILocalization>();

            foreach (string restrictionGroup in userManagement.RestrictionGroups.OrderBy(r => r))
            {
                ListItem item = new ListItem();
                // Try translation or use the orginal value
                string labelResource;
                if (!loc.TryTranslate("RestrictionGroup", restrictionGroup, out labelResource))
                {
                    labelResource = restrictionGroup;
                }

                item.SetLabel(Consts.KEY_NAME, labelResource);
                item.AdditionalProperties[Consts.KEY_RESTRICTION_GROUP] = restrictionGroup;
                lock (_syncObj)
                    _restrictionGroupList.Add(item);
            }
        }
Beispiel #41
0
        public static DataSet InsertUpdatePurchase(dhDBnames dhDBnames, dhPurchase objPurchase, Boolean InsertItems = false)
        {
            try
            {
                DataSet var_ret;

                if (objblPurchase == null)
                {
                    objblPurchase = new blPurchase();
                }
                var_ret = objblPurchase.InsertUpdatePurchase(dhDBnames, objPurchase);
                if (InsertItems)
                {
                    // get the SaleID
                    Int64?ID = Convert.ToInt64(var_ret.Tables[0].Rows[0]["iPurchaseid"].ToString());;
                    // get the observerable collection
                    ItemsList ItemCollection = objPurchase.ItemsOfPurchase;
                    int       ItemID         = 1;
                    foreach (dhSaleItem item in ItemCollection)
                    {
                        item.IProductionId = ID;
                        item.IUpdate       = 0;
                        // item.ISerialNumber = ItemID;
                        ItemID       = ItemID + 1;
                        item.IUserId = Convert.ToInt32(objPurchase.IUserid);
                        if (objblPurchase == null)
                        {
                            objblPurchase = new blPurchase();
                        }
                        {
                            var_ret = objblPurchase.InsertUpdatePurchaseItem(dhDBnames, item);
                        }
                    }
                }
                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
Beispiel #42
0
    private void OnEnable()
    {
        windowTitleText.text    = Localisation.Get(windowTitleStringKey);
        collectedItemsText.text = Localisation.Get(collectedItemsStringKey);
        offeringText.text       = Localisation.Get(offeringStringKey);
        continueText.text       = Localisation.Get(continueStringKey);

        MoreMountains.TopDownEngine.GameManager.Instance.Paused = true;

        Cursor.visible = true;

        foreach (Transform child in itemsLootedLayout)
        {
            Destroy(child.gameObject);
        }

        ItemsList itemsList = ItemManager.instance.itemsData;

        // Show items caught
        foreach (var itemQuantity in InventoryManager.instance.ItemQuantity)
        {
            Item item = itemsList.GetItemByName(itemQuantity.Key);
            Instantiate(itemUIPrefab, itemsLootedLayout).Init(item.sprite, item.ItemNameKey, itemQuantity.Value);
        }

        if (!playerDied)
        {
            // Show enemies defeated

            // Show time remaining

            // Other stats

            ShowOfferingIfNotNotified();
        }

        // button listener
    }
Beispiel #43
0
 /// <summary>
 /// Rebuilds all items of the current menu in the given <paramref name="context"/>.
 /// </summary>
 /// <remarks>
 /// This method locks the synchronization object of the <paramref name="menuItems"/> list and thus must not call
 /// change handlers.
 /// After executing this method, the returned <see cref="ItemsList"/>'s <see cref="ItemsList.FireChange"/>
 /// method must be called.
 /// </remarks>
 /// <param name="context">Workflow navigation context the menu should be built for.</param>
 /// <param name="menuItems">Menu items list to rebuild.</param>
 /// <param name="newActions">Preprocessed list (sorted etc.) of actions to be used for the new menu.</param>
 protected void RebuildMenuEntries(NavigationContext context, ItemsList menuItems, IList <WorkflowAction> newActions)
 {
     UnregisterActionChangeHandlers(context);
     lock (menuItems.SyncRoot)
     {
         menuItems.Clear();
         foreach (WorkflowAction action in newActions)
         {
             RegisterActionChangeHandler(context, action);
             if (!action.IsVisible(context))
             {
                 continue;
             }
             ListItem item = new ListItem("Name", action.DisplayTitle)
             {
                 Command = new MethodDelegateCommand(action.Execute),
                 Enabled = action.IsEnabled(context),
             };
             item.AdditionalProperties[Consts.KEY_ITEM_ACTION] = action;
             menuItems.Add(item);
         }
     }
 }
        public Bundle(IWitcherFile[] Files)
        {
            Read(Files);

            //check for buffers
            var bufferCount = ItemsList.Where(_ => _.Name.Split('\\').Last().Split('.').Last() == "buffer").ToList().Count;

            if (bufferCount > 0)
            {
                if (bufferCount == ItemsList.Count)
                {
                    Name = "buffers0.bundle";
                }
                else
                {
                    throw new InvalidBundleException("Buffers and files mixed in one bundle.");
                }
            }
            else
            {
                Name = "blob0.bundle";
            }
        }
Beispiel #45
0
    public string CheckPrice(ItemsList current, ItemsList buying)
    {
        string total  = "";
        int    equals = current.cost - buying.cost;

        Debug.Log(equals);
        if (equals >= 1)
        {
            total = "You gain " + equals.ToString() + "GPs";
        }

        else if (equals == 0)
        {
            total = "Equal trade";
        }
        else
        {
            equals = -equals;
            total  = "You lose " + equals.ToString() + "GPs";
        }

        return(total);
    }
Beispiel #46
0
        private void BindItems()
        {
            var parentMedia = MediasMapper.GetByID(ParentMediaID);
            IEnumerable <IMediaDetail> mediaDetailItems = new List <IMediaDetail>();

            if (parentMedia != null)
            {
                var liveMediaDetail = parentMedia.GetLiveMediaDetail();

                if (MediaTypeID > 0)
                {
                    mediaDetailItems = liveMediaDetail.ChildMediaDetails.Where(i => i.MediaTypeID == MediaTypeID && i.HistoryVersionNumber == 0 && i.MediaType.ShowInSiteTree && !i.IsDeleted);
                }
                else
                {
                    mediaDetailItems = liveMediaDetail.ChildMediaDetails.Where(i => i.HistoryVersionNumber == 0 && i.MediaType.ShowInSiteTree && !i.IsDeleted);
                }
            }

            else
            {
                if (MediaTypeID > 0)
                {
                    mediaDetailItems = BaseMapper.GetDataModel().MediaDetails.Where(i => i.MediaTypeID == MediaTypeID && i.HistoryVersionNumber == 0 && i.MediaType.ShowInSiteTree && !i.IsDeleted);
                }
            }

            if (ShowInMenu != ShowStatus.Any)
            {
                mediaDetailItems = mediaDetailItems.Where(i => i.ShowInMenu == bool.Parse(ShowInMenu.ToString()));
            }

            ItemsList.DataSource     = mediaDetailItems.ToList();
            ItemsList.DataTextField  = "SectionTitle";
            ItemsList.DataValueField = "ID";
            ItemsList.DataBind();
        }
Beispiel #47
0
        public Guid ShowDialog(string headerText, string text, DialogType type,
                               bool showCancelButton, DialogButtonType?focusedButton)
        {
            Guid      dialogHandle = Guid.NewGuid();
            ItemsList buttons      = new ItemsList();

            switch (type)
            {
            case DialogType.OkDialog:
                buttons.Add(CreateButtonListItem(OK_BUTTON_TEXT, dialogHandle, DialogResult.Ok, focusedButton == DialogButtonType.Ok || !showCancelButton));
                break;

            case DialogType.YesNoDialog:
                buttons.Add(CreateButtonListItem(YES_BUTTON_TEXT, dialogHandle, DialogResult.Yes, focusedButton == DialogButtonType.Yes));
                buttons.Add(CreateButtonListItem(NO_BUTTON_TEXT, dialogHandle, DialogResult.No, focusedButton == DialogButtonType.No));
                break;

            default:
                throw new NotImplementedException(string.Format("DialogManager: DialogType {0} is not implemented yet", type));
            }
            if (showCancelButton)
            {
                buttons.Add(CreateButtonListItem(CANCEL_BUTTON_TEXT, dialogHandle, DialogResult.Cancel, focusedButton == DialogButtonType.Cancel));
            }

            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            _dialogData = new GenericDialogData(headerText, text, buttons, dialogHandle);
            Guid?dialogInstanceId = screenManager.ShowDialog(GENERIC_DIALOG_SCREEN, OnDialogClosed);

            if (!dialogInstanceId.HasValue)
            {
                throw new InvalidDataException("Generic dialog could not be shown");
            }
            _dialogData.DialogInstanceId = dialogInstanceId.Value;
            return(dialogHandle);
        }
Beispiel #48
0
        public void SetUserProfile(UserProfile userProfile, ItemsList localSharesList = null, ItemsList serverSharesList = null)
        {
            Id                      = userProfile.ProfileId;
            TemplateId              = userProfile.TemplateId;
            Name                    = userProfile.Name;
            Password                = userProfile.Password;
            _originalPassword       = userProfile.Password;
            ProfileType             = userProfile.ProfileType;
            LastLogin               = userProfile.LastLogin ?? DateTime.MinValue;
            Image                   = userProfile.Image;
            EnableRestrictionGroups = userProfile.EnableRestrictionGroups;
            RestrictionGroups       = userProfile.RestrictionGroups;

            SelectedShares.Clear();

            foreach (var data in userProfile.AdditionalData)
            {
                foreach (var val in data.Value)
                {
                    if (data.Key == UserDataKeysKnown.KEY_ALLOWED_SHARE)
                    {
                        Guid shareId = Guid.Parse(val.Value);
                        if (localSharesList != null && localSharesList.Any(i => ((Share)i.AdditionalProperties[Consts.KEY_SHARE]).ShareId == shareId) ||
                            serverSharesList != null && serverSharesList.Any(i => ((Share)i.AdditionalProperties[Consts.KEY_SHARE]).ShareId == shareId))
                        {
                            SelectedShares.Add(shareId);
                        }
                    }
                }
            }

            RestrictAges               = userProfile.RestrictAges;
            RestrictShares             = userProfile.RestrictShares;
            AllowedAge                 = userProfile.AllowedAge ?? 5;
            IncludeParentGuidedContent = userProfile.IncludeParentGuidedContent;
            IncludeUnratedContent      = userProfile.IncludeUnratedContent;
        }
        ItemsList CreatePossibleValuesList()
        {
            var result = new ItemsList();
            if (PropertyDescriptor.IsBool)
            {
                var item = new ListItem(Consts.KEY_NAME, new StringId("[System.Yes]")) { Selected = Value == true.ToString() };
                item.AdditionalProperties.Add(KEY_VALUE, true.ToString());
                result.Add(item);

                item = new ListItem(Consts.KEY_NAME, new StringId("[System.No]")) { Selected = Value == false.ToString() };
                item.AdditionalProperties.Add(KEY_VALUE, false.ToString());
                result.Add(item);
            }
            else if (PropertyDescriptor.IsEnum)
            {
                foreach (string e in PropertyDescriptor.GetEnumValues())
                {
                    var item = new ListItem(Consts.KEY_NAME, e) { Selected = Value == e };
                    item.AdditionalProperties.Add(KEY_VALUE, e);
                    result.Add(item);
                }
            }
            return result;
        }
Beispiel #50
0
        private List <RequestSignature> PrepareUsers(ItemsList itemsList)
        {
            if (itemsList.Rows.Count <= 0)
            {
                throw new Exception("Empty signers list");
            }

            var users = new List <RequestSignature>();

            foreach (var row in itemsList.Rows)
            {
                var user = new RequestSignature();
                user.signer_email_address = row.GetCellValue(Configuration.Users.SignersList.SignerMailColumnID).ToString();
                user.signer_identity_data = new SignerIdentityData()
                {
                    first_name = TextHelper.GetPairName(row.GetCellValue(Configuration.Users.SignersList.SignerNameColumnID).ToString()).Split(' ').First(),
                    last_name  = TextHelper.GetPairName(row.GetCellValue(Configuration.Users.SignersList.SignerNameColumnID).ToString()).Split(' ').Last(),
                };

                users.Add(user);
            }

            return(users);
        }
        protected void InitializeSearch(ViewSpecification baseViewSpecification)
        {
            _baseViewSpecification = baseViewSpecification as MediaLibraryQueryViewSpecification;
            if (_baseViewSpecification == null)
            {
                return;
            }
            if (_simpleSearchTextProperty == null)
            {
                _simpleSearchTextProperty = new WProperty(typeof(string), string.Empty);
                _simpleSearchTextProperty.Attach(OnSimpleSearchTextChanged);
            }
            SimpleSearchText = string.Empty;

            // Initialize data manually which would have been initialized by AbstractItemsScreenData.UpdateMediaItems else
            IsItemsValid = true;
            IsItemsEmpty = false;
            TooManyItems = false;
            NumItemsStr  = "-";
            NumItems     = 0;
            lock (_syncObj)
                _view = null;
            _items = new ItemsList();
        }
        protected ItemsList GetItems()
        {
            var model = EmulatorsMainModel.Instance();
            StartupState currentState = model.StartupState;

            bool showPC = Emulator.GetPC().Games.Count > 0;
            if (!showPC && currentState == StartupState.PCGAMES)
                currentState = StartupState.EMULATORS;

            ItemsList items = new ItemsList();
            foreach (ListItem item in startupItems)
            {
                StartupState state;
                if (tryGetStartupState(item.AdditionalProperties, out state))
                {
                    if (state != StartupState.PCGAMES || showPC)
                    {
                        item.Selected = (StartupState)state == currentState;
                        items.Add(item);
                    }
                }
            }
            return items;
        }
Beispiel #53
0
        private List <Models.Send.Participantsetsinfo> GetMembersInfo(ItemsList itemsList)
        {
            if (itemsList.Rows.Count <= 0)
            {
                throw new Exception("Empty signers list");
            }

            int order  = 1;
            var result = new List <Models.Send.Participantsetsinfo>();

            foreach (var row in itemsList.Rows)
            {
                var member     = new Models.Send.Participantsetsinfo();
                var singleUser = new Models.Send.Memberinfo();
                member.name      = row.GetCellValue(Configuration.Users.SignersList.SignerNameColumnID).ToString();
                member.role      = SignerRole;
                member.order     = order++;
                singleUser.email = row.GetCellValue(Configuration.Users.SignersList.SignerMailColumnID).ToString();
                if (Configuration.Users.PhoneAutorization)
                {
                    singleUser.securityOption = new Models.Send.Securityoption1();
                    singleUser.securityOption.authenticationMethod = AuthMethod;
                    singleUser.securityOption.phoneInfo            = new Models.Send.Phoneinfo()
                    {
                        phone          = row.GetCellValue(Configuration.Users.SignersList.SignerPhoneNumberColumnID).ToString(),
                        countryCode    = Configuration.Users.CountryCode ?? "",
                        countryIsoCode = Configuration.Users.IsoCountryCode ?? ""
                    };
                }

                member.memberInfos = new Models.Send.Memberinfo[] { singleUser };
                result.Add(member);
            }

            return(result);
        }
        private async Task RefreshData()
        {
            if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet)
            {
                Device.BeginInvokeOnMainThread(async() =>
                                               await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK"));
                return;
            }

            ItemsList <AccountAccountingInfo> info = await _server.GetAccountingInfo();

            if (info.Error == null)
            {
                SetBills(info.Data);
                isSortDate = !isSortDate;
                SortDate();
                // additionalList.ItemsSource = null;
                // additionalList.ItemsSource = BillInfos;
            }
            else
            {
                await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorInfoBills, "OK");
            }
        }
        async Task InfoForUpd()
        {
            if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet)
            {
                Device.BeginInvokeOnMainThread(async() =>
                                               await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK"));
                return;
            }

            ItemsList <AccountAccountingInfo> info = await _server.GetAccountingInfo();

            if (info.Error == null)
            {
                _accountingInfo  = info.Data;
                _accountingInfos = _accountingInfo;
                /*viewModel.*/
                LoadAccounts.Execute(info.Data);
                //this.BindingContext = this;
            }
            else
            {
                await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorCountersNoData, "OK");
            }
        }
 public static void ShowLoadSkinDialog()
 {
   IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
   SkinManager skinManager = ServiceRegistration.Get<ISkinResourceManager>() as SkinManager;
   if (skinManager == null)
     return;
   ItemsList skinItems = new ItemsList();
   foreach (Skin skin in skinManager.Skins.Values)
   {
     if (!skin.IsValid)
       continue;
     string skinName = skin.Name;
     ListItem skinItem = new ListItem(Consts.KEY_NAME, skinName)
       {
           Command = new MethodDelegateCommand(() => screenManager.SwitchSkinAndTheme(skinName, null))
       };
     skinItems.Add(skinItem);
   }
   ShowDialog(Consts.RES_LOAD_SKIN_TITLE, skinItems);
 }
 protected void Initialize(string dialogTitle, ItemsList items)
 {
   _dialogTitle = dialogTitle;
   _skinsThemesItemsList = items;
 }
 protected static void ShowDialog(string title, ItemsList items)
 {
   IWorkflowManager workflowManager = ServiceRegistration.Get<IWorkflowManager>();
   LoadSkinThemeModel model = (LoadSkinThemeModel) workflowManager.GetModel(LST_MODEL_ID);
   model.Initialize(title, items);
   IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
   screenManager.ShowDialog(DIALOG_LOAD_SKIN_THEME);
 }
 public static void ShowLoadThemeDialog()
 {
   IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
   SkinManager skinManager = ServiceRegistration.Get<ISkinResourceManager>() as SkinManager;
   if (skinManager == null)
     return;
   string currentSkinName = screenManager.CurrentSkinResourceBundle.SkinName;
   Skin currentSkin;
   if (!skinManager.Skins.TryGetValue(currentSkinName, out currentSkin))
     return;
   ItemsList themeItems = new ItemsList();
   foreach (Theme theme in currentSkin.Themes.Values)
   {
     if (!theme.IsValid)
       continue;
     string themeName = theme.Name;
     ListItem themeItem = new ListItem(Consts.KEY_NAME, themeName)
       {
           Command = new MethodDelegateCommand(() => screenManager.SwitchSkinAndTheme(null, themeName))
       };
     themeItems.Add(themeItem);
   }
   ShowDialog(Consts.RES_LOAD_THEME_TITLE, themeItems);
 }
 protected void ClearData()
 {
   lock (_syncObj)
   {
     _sharesList = null;
   }
 }