public void ActivateLayer(CamViewLayer layer) { if (this.activeLayers == null) { this.activeLayers = new List <CamViewLayer>(); } if (this.activeLayers.Contains(layer)) { return; } if (this.activeLayers.Any(l => l.GetType() == layer.GetType())) { return; } if (this.lockedLayers.Contains(layer.GetType())) { return; } this.activeLayers.Add(layer); layer.View = this; // No glControl yet? We're not initialized properly and this is the initial state. Enter the state later. if (this.graphicsControl != null) { layer.OnActivateLayer(); this.RenderableControl.Invalidate(); } }
public CamView() { if (!base.DesignMode) { var camViewStateTypeQuery = from t in App.GetAvailDualityEditorTypes(typeof(CamViewState)) where !t.IsAbstract select t; foreach (TypeInfo t in camViewStateTypeQuery) { CamViewState state = t.CreateInstanceOf() as CamViewState; state.View = this; this.availStates.Add(t, state); } var camViewLayerTypeQuery = from t in App.GetAvailDualityEditorTypes(typeof(CamViewLayer)) where !t.IsAbstract select t; foreach (TypeInfo t in camViewLayerTypeQuery) { CamViewLayer layer = t.CreateInstanceOf() as CamViewLayer; layer.View = this; this.availLayers.Add(t, layer); } } }
public void DeactivateLayer(CamViewLayer layer) { if (this.activeLayers == null) { this.activeLayers = new List <CamViewLayer>(); } if (!this.activeLayers.Contains(layer)) { return; } if (this.lockedLayers.Contains(layer.GetType())) { return; } layer.OnDeactivateLayer(); layer.View = null; this.activeLayers.Remove(layer); this.RenderableControl.Invalidate(); }
public void UnlockLayer(CamViewLayer layer) { this.UnlockLayer(layer.GetType()); }