Esempio n. 1
0
        public CalculatorMethods(UIApplication uiApp, List <Element> areas, FamilySymbol symbolType, ModelSelection lightingFrom)
        {
            m_app             = uiApp;
            m_doc             = uiApp.ActiveUIDocument.Document;
            selectedAreas     = areas;
            annotationType    = symbolType;
            lightingSelection = lightingFrom;

            CollectLightingTypes();
            CollectRvtLink();
        }
Esempio n. 2
0
        protected void LoadTrackModel(TrackListModel model, Selection selection)
        {
            DatabaseTrackListModel db_model = model as DatabaseTrackListModel;

            if (db_model != null)
            {
                db_selection = CachedList <DatabaseTrackInfo> .CreateFromModelAndSelection(db_model, selection);
            }
            else
            {
                memory_selection = new List <TrackInfo> ();
                var items = new ModelSelection <TrackInfo> (model, selection);
                foreach (TrackInfo track in items)
                {
                    memory_selection.Add(track);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// It is used to return appropriate object at runtime as per the requirement of the user/client
        /// </summary>
        /// <param name="modelType"></param>
        /// <returns></returns>
        public static Model getModel(ModelSelection modelType)
        {
            Model model = null;

            if (modelType.Equals(ModelSelection.Login))
            {
                model = new LoginModel();
            }
            else if (modelType.Equals(ModelSelection.Register))
            {
                model = new RegistrationModel();
            }
            else if (modelType.Equals(ModelSelection.User))
            {
                model = new UserModel();
            }
            return(model);
        }
Esempio n. 4
0
            /// <summary>
            /// Prints a modelselection of the music library.
            /// </summary>
            private void PrintSelection()
            {
                Selection s = new Selection();
                s.SelectRange(10, 23);

                ModelSelection<TrackInfo> ms = new ModelSelection<TrackInfo>(ServiceManager.SourceManager.MusicLibrary.TrackModel, s);

                foreach (TrackInfo ti in ms) {
                    Hyena.Log.Debug("NoNoise - Selection: " + ti.ArtistName + " - " + ti.TrackTitle + " (" + ti.AlbumTitle + ")");
                }
            }