Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FeatureItem"/> class.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="name">The name.</param>
        public FeatureItem(Session session, string name)
        {
            // Debug.Assert(false);

            var data = session.OpenView("select * from Feature where Feature = '" + name + "'");

            Dictionary <string, object> row = data.FirstOrDefault();

            if (row != null)
            {
                Name        = name;
                ParentName  = (string)row["Feature_Parent"];
                Title       = (string)row["Title"];
                Description = (string)row["Description"];

                RawDisplay = (int)row["Display"];
                Display    = RawDisplay.MapToFeatureDisplay();

                var defaultState = (InstallState)row["Level"];

                CurrentState   = DetectFeatureState(session, name);
                RequestedState = session.IsInstalled() ? CurrentState : defaultState;

                Attributes = (FeatureAttributes)row["Attributes"];
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ConnectedSlider = (ConnectedSlider)target;
                return;

            case 2:
                this.Surfing = (Image)target;
                return;

            case 3:
                this.SurfingAnimated = (Image)target;
                return;

            case 4:
                this.StatusMessage = (Label)target;
                return;

            case 5:
                this.CancelConnection = (TextBlock)target;
                this.CancelConnection.MouseLeftButtonUp += new MouseButtonEventHandler(this.CancelConnection_OnMouseLeftButtonUp);
                return;

            case 6:
                this.FeatureDisplay = (FeatureDisplay)target;
                return;

            case 7:
                this.LoadingBar = (ModernProgressRing)target;
                return;

            case 8:
                this.ConnectBtn        = (Button)target;
                this.ConnectBtn.Click += new RoutedEventHandler(this.DoDisconnect);
                return;

            default:
                this._contentLoaded = true;
                return;
            }
        }
Ejemplo n.º 3
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ConnectedSlider = (ConnectedSlider)target;
                return;

            case 2:
                this.Svg = (Canvas)target;
                return;

            case 3:
                this.Path7 = (Path)target;
                return;

            case 4:
                this.Path10 = (Path)target;
                return;

            case 5:
                this.Path5 = (Path)target;
                return;

            case 6:
                this.Path2 = (Path)target;
                return;

            case 7:
                this.Path9 = (Path)target;
                return;

            case 8:
                this.Path11 = (Path)target;
                return;

            case 9:
                this.Path8 = (Path)target;
                return;

            case 10:
                this.Path12 = (Path)target;
                return;

            case 11:
                this.Path4 = (Path)target;
                return;

            case 12:
                this.Path6 = (Path)target;
                return;

            case 13:
                this.Path3 = (Path)target;
                return;

            case 14:
                this.Path1 = (Path)target;
                return;

            case 15:
                this.StatusMessage = (Label)target;
                return;

            case 16:
                this.CancelConnection = (TextBlock)target;
                this.CancelConnection.MouseLeftButtonUp += new MouseButtonEventHandler(this.CancelConnection_OnMouseLeftButtonUp);
                return;

            case 17:
                this.FeatureDisplay = (FeatureDisplay)target;
                return;

            case 18:
                this.LoadingBar = (ModernProgressRing)target;
                return;

            case 19:
                this.ConnectBtn        = (Button)target;
                this.ConnectBtn.Click += new RoutedEventHandler(this.DoDisconnect);
                return;

            default:
                this._contentLoaded = true;
                return;
            }
        }