public ProductSettingsTracker(Lifetime lifetime, ClientFactory clientFactory, IViewable<ISyncSource> syncSources, IFileSystemTracker fileSystemTracker, JetBoxSettingsStorage jetBoxSettings)
        {
            myClientFactory = clientFactory;
              mySettingsStore = jetBoxSettings.SettingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide);
              mySettingsStore.Changed.Advise(lifetime, _ => InitClient());

              myRootFolder = FileSystemPath.Parse("ReSharperPlatform");
              InitClient();

              syncSources.View(lifetime, (lt1, source) =>
            source.FilesToSync.View(lt1, (lt2, fileToSync) =>
            {
              SyncFromCloud(fileToSync.Value);

              var fileTrackingLifetime = new SequentialLifetimes(lt2);
              fileToSync.Change.Advise(lt2,
            args =>
            {
              var path = args.Property.Value;
              if (lifetime.IsTerminated || path.IsNullOrEmpty())
              {
                fileTrackingLifetime.TerminateCurrent();
              }
              else
              {
                fileTrackingLifetime.Next(lt =>
                    fileSystemTracker.AdviseFileChanges(lt, path,
                      delta => delta.Accept(new FileChangesVisitor(myClient, myRootFolder))));
              }
            });
            }));
        }
Exemple #2
0
    public void OnAsset(IViewable entity, string value)
    {
        var prefab = Resources.Load <GameObject>(value);
        var obj    = Object.Instantiate(prefab, _viewContainer);

        var c = entity.contextInfo.name;

        obj.name = c + " " + value;

        switch (c)
        {
        case "Audio":
        {
            var e = (AudioEntity)entity;
            e.AddAudioPositionListener(obj.GetComponent <IAudioPositionListener>());
            e.AddAudioDestroyedListener(obj.GetComponent <IAudioDestroyedListener>());
            break;
        }

        case "Game":
        {
            var e = (GameEntity)entity;
            e.AddGamePositionListener(obj.GetComponent <IGamePositionListener>());
            e.AddGameDestroyedListener(obj.GetComponent <IGameDestroyedListener>());
            break;
        }
        }
        // Currently the responsiblity of MB objects to add their listeners
        var iview = obj.GetComponent <IView>();

        iview.Link(entity, _contexts.game);
    }
Exemple #3
0
        public void ChangeView(string _viewType)
        {
#if DEBUG || DEVELOPMENT_BUILD
            Debug.Log(_viewType);
#endif

            View newView = Utility.ToEnum <View>(_viewType);

            for (int i = 0; i < views.Length; i++)
            {
                IViewable viewable = views[i].gameObject.GetComponent <IViewable>();

                if (_viewType.ToString() == views[i].name)
                {
                    if (viewable != null)
                    {
                        viewable.SetView(true);
                        currentView = newView;
                    }
                    else
                    {
#if DEBUG || DEVELOPMENT_BUILD
                        Debug.Log("Unable to find IViewable interface on object " + views[i].name);
#endif
                    }
                }
                else
                {
                    viewable.SetView(false);
                }
            }
        }
Exemple #4
0
 public virtual void set(IViewable obj)
 {
     _toDisplay = obj;
     transform.gameObject.SetActive(true);
     Debug.Log("PLANET VIEW SET " + obj);
     render();
 }
 public PsiCodeFormatter(Lifetime lifetime, PsiLanguage language, ISettingsStore settingsStore, IViewable<IPsiCodeFormatterExtension> extensions, ISettingsOptimization settingsOptimization)
   : base(settingsStore)
 {
   myLanguage = language;
   myExtensions = extensions.ToLiveEnumerable(lifetime);
   mySettingsOptimization = settingsOptimization;
 }
Exemple #6
0
        public void Fonogram(IDTO idto)
        {
            Fonogram fonogram    = DtoToDbModels.ConvertToFonogram(idto as IFonogramDTO);
            Fonogram newFonogram = _saver.SaveFonogram(fonogram);

            _viewable = DbModelsToViewable.ConvertToFonogramViewable(newFonogram);
        }
Exemple #7
0
 public APresenter(IViewable view) {
     View = view;
     _viewGameObject = (view as Component).gameObject;
     Item = AcquireItemReference();
     // the following use ItemData so Views should only be enabled to create this Presenter after ItemData is set
     View.HudPublisher = InitializeHudPublisher();
 }
        static public IzvodjacViewModel GetIzvodjacViewModel(IViewable data)
        {
            IzvodjacViewModel izvodjacview = new IzvodjacViewModel();

            izvodjacview.SetData(data);
            return(izvodjacview);
        }
Exemple #9
0
        public void Izvodjac(IDTO idto)
        {
            Izvodjac izvodjac = DtoToDbModels.ConvertToIzvodjac(idto as IDTO);

            izvodjac = Updater.UpdateIzvodjac(izvodjac);

            _viewable = DbModelsToViewable.ConvertToIzvodjacViewable(izvodjac);
        }
Exemple #10
0
        public void Fonogram(IDTO idto)
        {
            Fonogram fonogram = DtoToDbModels.ConvertToFonogram(idto as IFonogramDTO);

            fonogram = Updater.UpdateFonogram(fonogram);

            _viewable = DbModelsToViewable.ConvertToFonogramViewable(fonogram);
        }
Exemple #11
0
        public void Album(IDTO idto)
        {
            Album album = DtoToDbModels.ConvertToAlbum(idto as IAlbumDTO);

            album = Updater.UpdateAlbum(album);

            _viewable = DbModelsToViewable.ConvertToAlbumViewable(album);
        }
 public void SetData(IViewable data)
 {
     IIzvodjacViewable izvodjac = data as IIzvodjacViewable;
     Id = izvodjac.Id;
     Naziv = izvodjac.Naziv;
     SetAlbumi(izvodjac);
     SetFonogrami(izvodjac);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AItemPresenter"/> class.
 /// Note: Presenters use Model Data, so Views should only be enabled to create this Presenter after the Model's Data has been set
 /// </summary>
 /// <param name="view">The view.</param>
 public AItemPresenter(IViewable view) {
     View = view;
     _viewGameObject = (view as Component).gameObject;
     Model = AcquireModelReference();
     Data = (Model as IHasData).Data;
     View.HudPublisher = InitializeHudPublisher();
     // derived Presenters should call Subscribe() if they have any subscriptions to make
 }
 public AngularJsCodeFormatter(Lifetime lifetime, PsiLanguageType language, ISettingsStore settingsStore,
                               ISettingsOptimization settingsOptimization,
                               JavaScriptFormattingInfoProviderBase formattingProvider,
                               JavaScriptIndentingInfoProviderBase indentingProvider,
                               IViewable<IJavaScriptCodeFormatterExtension> extensions)
     : base(lifetime, language, settingsStore, settingsOptimization,
            formattingProvider, indentingProvider, extensions)
 {
 }
Exemple #15
0
 public AngularJsCodeFormatter(Lifetime lifetime, PsiLanguageType language, ISettingsStore settingsStore,
                               ISettingsOptimization settingsOptimization,
                               JavaScriptFormattingInfoProviderBase formattingProvider,
                               JavaScriptIndentingInfoProviderBase indentingProvider,
                               IViewable <IJavaScriptCodeFormatterExtension> extensions)
     : base(lifetime, language, settingsStore, settingsOptimization,
            formattingProvider, indentingProvider, extensions)
 {
 }
        static public AlbumViewModel GetAlbumViewModel(IViewable data)
        {
            AlbumViewModel albumview = new AlbumViewModel();

            albumview.SetData(data);
            return(albumview);

            //ovde treba obaviti konverziju iz album u albumview
        }
        static public FonogramViewModel GetFonogramViewModel(IViewable data)
        {
            FonogramViewModel fonogramview = new FonogramViewModel();

            fonogramview.SetData(data);
            return(fonogramview);

            // prvo odratiti interface segregation neophodan za gornju metodu
        }
 public JavaScriptDependentFilesCacheHack(
 Lifetime lifetime, IViewable<ILibraryFiles> libraryFiles,
 JavaScriptDependentFilesModuleFactory dependentFilesModuleFactory,
 JavaScriptDependentFilesBuilder builder, IShellLocks locks,
 IPsiConfiguration configuration, IPersistentIndexManager persistentIndexManager)
     : base(lifetime, new ListEvents<ILibraryFiles>(lifetime, "booo"),
        dependentFilesModuleFactory, builder,
        locks, configuration, persistentIndexManager)
 {
 }
Exemple #19
0
 public void OpenDocument(IViewable viewable)
 {
     try
     {
         Process.Start(Path.GetFullPath(viewable.DocumentPath()));
     }
     catch (Exception ex)
     {
         MessageBox.Show("An Error ocurred attempting to open document: " + ex.Message.ToString(), "Insert Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #20
0
        public void SetData(IViewable data)
        {
            IFonogramViewable fonogram = data as IFonogramViewable;

            Id    = fonogram.Id;
            Naziv = fonogram.Naziv;
            SetIzvodjaci(fonogram);
            GodinaIzdanja = fonogram.GodinaIzdanja;
            KataloskiBroj = fonogram.KataloskiBroj;
            AlbumNaziv    = fonogram.AlbumNaziv;
        }
        public void SetData(IViewable data)
        {
            IAlbumViewable album = data as IAlbumViewable;

            Id    = album.Id;
            Naziv = album.Naziv;
            SetIzvodjaci(album);
            GodinaIzdanja = album.GodinaIzdanja;
            KataloskiBroj = album.KataloskiBroj;
            SetFonogrami(album);
        }
Exemple #22
0
        /// <summary>
        /// Begins the loop, displaying the game.
        /// </summary>
        /// <param name="theView">The game's opening view</param>
        public static void Begin(IViewable theView)
        {
            CurrentView = theView;

            while (true)
            {
                Console.Clear();
                Console.WriteLine(CurrentView.Write());

                var input = Console.ReadKey().Key;
                CurrentView.Update(new UpdateEventArgs(input));
            }
        }
Exemple #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // display a list of modules for the project
            this.ProjectModulesList.DataSource = ViewData.Model.Project.ListModules();
            this.ProjectModulesList.DataBind();

            // display the specified model's page
            if (ViewData.Model.ModuleId != null)
            {
                IProjectModule moduleToShow   = ViewData.Model.Module;
                IViewable      viewableModule = (IViewable)moduleToShow;
            }
        }
Exemple #24
0
 public void setSource(IViewable view)
 {
     //unregister old event handler
     if (content != null)
     {
         content.eViewChanged -= OnSourceUpdate;
     }
     content = view;
     //register new event handler
     if (content != null)
     {
         content.eViewChanged += OnSourceUpdate;
     }
 }
Exemple #25
0
        public void DisplayInformation(IViewable item)
        {
            this.Title = String.Format("{0}, Properties", item.Name);

            this.txtFullPath.Text = item.Path;

            this.txtName.Text = item.Name;
            this.txtType.Text = item.Type;

            this.txtAvgSize.Text = item.Size;

            if (item is FileEntry)
            {
                this.grdEntries.DataStore = ((FileEntry)item).BundleEntries;
            }
            else
            {
                this.tabEntries.Visible = false;
            }
        }
        public HighlightingTracker(Lifetime lifetime, ITextControlManager textControlManager,
                                   IDocumentMarkupManager markupManager, IViewable <IHighlightingChangeHandler> handlers)
        {
            textControlManager.TextControls.View(lifetime, (textControlLifetime, textControl) =>
            {
                var markupModel = markupManager.GetMarkupModel(textControl.Document);

                Action <DocumentMarkupModifiedEventArgs> onChanged = args =>
                {
                    Lifetimes.Using(l =>
                    {
                        handlers.View(l, (_, h) =>
                        {
                            h.OnHighlightingChanged(textControl.Document, args.Added, args.Removed, args.Modified);
                        });
                    });
                };

                markupModel.Changed += onChanged;
                textControlLifetime.AddAction(() => markupModel.Changed -= onChanged);
            });
        }
        public static void ShowTrianglesIEnumerator(this IViewable view, string message = "")
        {
            StringBuilder sb = new StringBuilder();

            if (!string.IsNullOrEmpty(message))
            {
                sb.AppendLine(message);
            }

            foreach (KeyValuePair <string, IViewableTriangle> item in view.TriangleDictionary)
            {
                sb.AppendFormat("{0}: {1};  {2}: ", NAME, item.Key, SIDES);

                foreach (double side in item.Value.Sides)
                {
                    sb.AppendFormat("{0}; ", side);
                }

                sb.AppendFormat("  {0}: {1:F3};", SQUARE, item.Value.Square);
                sb.AppendLine();
            }

            Console.WriteLine(sb);
        }
Exemple #28
0
        ////////////////////////////////////////////////////////////////////////////////////////
        //   PUBLIC METHODS
        ////////////////////////////////////////////////////////////////////////////////////////


        /// <summary>
        /// Returns an object that impliments IViewable from the location that
        /// has the Name property equal to targetName
        /// </summary>
        /// <param name="targetName">A string that matches the object's Name property</param>
        /// <returns>An IViewable object if a match found. Otherwise, returns null</returns>
        public IViewable GetViewableMatchInLocation(string targetName)
        {
            IViewable viewableMatch = null;

            if (targetName == "")
            {
                viewableMatch = this;
                return(viewableMatch);
            }

            viewableMatch = GetItemMatchInLocation(targetName);
            if (viewableMatch != null)
            {
                return(viewableMatch);
            }

            viewableMatch = GetActorMatchInLocation(targetName);
            if (viewableMatch != null)
            {
                return(viewableMatch);
            }

            return(null);
        }
 public AMortalFocusablePresenter(IViewable view)
     : base(view) {
     _eventMgr = GameEventManager.Instance;
 }
Exemple #30
0
 public PsiCodeFormatter(Lifetime lifetime, PsiLanguage language, ISettingsStore settingsStore, IViewable <IPsiCodeFormatterExtension> extensions, ISettingsOptimization settingsOptimization)
     : base(settingsStore)
 {
     myLanguage             = language;
     myExtensions           = extensions.ToLiveEnumerable(lifetime);
     mySettingsOptimization = settingsOptimization;
 }
 public AFocusableItemPresenter(IViewable view)
     : base(view) {
 }
 public AMortalItemPresenter(IViewable view)
     : base(view) {
     _eventMgr = GameEventManager.Instance;
     Subscribe();
 }
        public void Fonogram(IDTO idto)
        {
            Fonogram fonogram = RetrieveFonogram.GetById(idto.Id);

            _viewable = DbModelsToViewable.ConvertToFonogramViewable(fonogram);
        }
        public void Izvodjac(IDTO idto)
        {
            Izvodjac izvodjac = RetrieveIzvodjac.GetById(idto.Id);

            _viewable = DbModelsToViewable.ConvertToIzvodjacViewable(izvodjac);
        }
 public SystemPresenter(IViewable view) : base(view) { }
 public PlanetoidPresenter(IViewable view)
     : base(view) {
     Subscribe();
 }
Exemple #37
0
 public StarPresenter(IViewable view)
     : base(view) {
     _systemView = _viewGameObject.GetSafeMonoBehaviourComponentInParents<SystemView>();
 }
Exemple #38
0
 public SystemPresenter(IViewable view)
     : base(view) {
     _childViewsInSystem = _viewGameObject.GetSafeInterfacesInChildren<IViewable>().Except(view);
 }
 public SectorPresenter(IViewable view) : base(view) { }
Exemple #40
0
 public PropertiesDialog(IViewable item) : this()
 {
     this.DisplayInformation(item);
 }
Exemple #41
0
 public void setSource(IViewable view) {
     //unregister old event handler
     if (content != null) {
         content.eViewChanged -= OnSourceUpdate;
     }
     content = view;
     //register new event handler
     if (content != null) {
         content.eViewChanged += OnSourceUpdate;
     }
 }
Exemple #42
0
 public void render(IViewable viewable, clickViews viewCallBacks)
 {
     Debug.Log("render MainView " + viewable);
     clear(centralView);
     viewable.renderUIView(centralView.transform, viewCallBacks);
 }
        public void Album(IDTO idto)
        {
            Album album = RetrieveAlbum.GetById(idto.Id);

            _viewable = DbModelsToViewable.ConvertToAlbumViewable(album);
        }
        public ProductSettingsTracker(Lifetime lifetime, ClientFactory clientFactory, IViewable <ISyncSource> syncSources, IFileSystemTracker fileSystemTracker, JetBoxSettingsStorage jetBoxSettings)
        {
            myClientFactory = clientFactory;
            mySettingsStore = jetBoxSettings.SettingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide);
            mySettingsStore.Changed.Advise(lifetime, _ => InitClient());

            myRootFolder = FileSystemPath.Parse("ReSharperPlatform");
            InitClient();

            syncSources.View(lifetime, (lt1, source) =>
                             source.FilesToSync.View(lt1, (lt2, fileToSync) =>
            {
                SyncFromCloud(fileToSync.Value);

                var fileTrackingLifetime = new SequentialLifetimes(lt2);
                fileToSync.Change.Advise(lt2,
                                         args =>
                {
                    var path = args.Property.Value;
                    if (lifetime.IsTerminated || path.IsNullOrEmpty())
                    {
                        fileTrackingLifetime.TerminateCurrent();
                    }
                    else
                    {
                        fileTrackingLifetime.Next(lt =>
                                                  fileSystemTracker.AdviseFileChanges(lt, path,
                                                                                      delta => delta.Accept(new FileChangesVisitor(myClient, myRootFolder))));
                    }
                });
            }));
        }
Exemple #45
0
 public StarPresenter(IViewable view)
     : base(view) {
     _systemView = _viewGameObject.GetSafeFirstInterfaceInParents<IViewable>(excludeSelf: true);
 }
Exemple #46
0
 private void addToViewableStack(IViewable el)
 {
     renderedViewableStack.Add(el);
     renderMain();
 }
 public UniverseCenterPresenter(IViewable view) : base(view) { }