Esempio n. 1
0
        private void OnSecondsChanged(DependencyObject sender, DependencyProperty dp)
        {
            VisualStateManager.GoToState(TTLSeconds, SelectedItem.TTLSeconds == null ? "Unselected" : "Selected", false);
            //VisualStateManager.GoToState(this, SelectedItem.TTLSeconds == null ? "Unselected" : "Selected", false);

            // TODO: WRONG!!!
            if (SelectedItem.TTLSeconds == null)
            {
                TTLSeconds.ClearValue(Button.ForegroundProperty);
            }
            else
            {
                TTLSeconds.Foreground = LayoutRoot.Resources["SystemControlForegroundAccentBrush"] as SolidColorBrush;
            }
        }
Esempio n. 2
0
        public SendPhotosView()
        {
            InitializeComponent();
            DataContext = this;

            //var seconds = new int[29];
            //for (int i = 0; i < seconds.Length; i++)
            //{
            //    seconds[i] = i;
            //}

            //TTLSeconds.ItemsSource = seconds;

            TTLSeconds.RegisterPropertyChangedCallback(GlyphButton.GlyphProperty, OnSecondsChanged);

            Loaded   += OnLoaded;
            Unloaded += OnUnloaded;
        }
Esempio n. 3
0
        public SendMediaView()
        {
            InitializeComponent();
            DataContext = this;

            //var seconds = new int[29];
            //for (int i = 0; i < seconds.Length; i++)
            //{
            //    seconds[i] = i;
            //}

            //TTLSeconds.ItemsSource = seconds;

            ProportionsBox.SelectionChanged += (s, args) =>
            {
                Cropper.Proportions = (ImageCroppingProportions)ProportionsBox.SelectedItem;
            };

            TTLSeconds.RegisterPropertyChangedCallback(GlyphButton.GlyphProperty, OnSecondsChanged);

            Loaded   += OnLoaded;
            Unloaded += OnUnloaded;
        }
        /// <summary>
        /// Creates a new primary zone
        /// </summary>
        /// <param name="rname">Administrative contact for this zone</param>
        /// <param name="serial_style"> The style of the zone's serial. Defaults to 'increment'. increment - Serials are incremented by 1 on every changeepoch - Serials will be the UNIX timestamp at the time of the publishday - Serials will be in the form of YYYYMMDDxx where xx is incremented by one for each change during that particular day.minute - Serials will be in the form of YYMMDDHHMM.</param>
        /// <param name="ttl">Default TTL (in seconds) for records in the zone.</param>
        /// <param name="zone">Name of zone to add the record to</param>
        /// <returns>The created zone or null if it failed to create</returns>
        public net.dynect.api2.ZoneData CreateZone(string rname, ZoneSerialStyle serial_style, TTLSeconds ttl, string zone)
        {
            if (sessionData == null)
                return null;

            net.dynect.api2.ZoneData retVal = null;
            try
            {
                net.dynect.api2.CreateZoneRequestType request = new DynSoapWrapper.net.dynect.api2.CreateZoneRequestType();
                request.token = sessionData.token;
                request.fault_incompat = 1;
                request.fault_incompatSpecified = true;
                request.zone = zone;
                request.ttl = (int)ttl;
                request.serial_style = serial_style.ToString();
                request.rname = rname;
                net.dynect.api2.CreateZoneResponseType response = dynectWsdl.CreateZone(request);

                retVal = response.data;

            }
            catch (Exception ex)
            {
                ;// TODO: Do your custom error handling here....
            }

            return retVal;
        }
        /// <summary>
        /// Creates the load balance service on the node
        /// </summary>
        /// <param name="zone">The zone to attach the LoadBalance to</param>
        /// <param name="fqdn">The fqdb to attach the LoadBalance to</param>
        /// <param name="contactNickname">Name of contact to receive notifications</param>
        /// <param name="loadBalancePool">The IP Pool list for this service</param>
        /// <param name="monitorData">The health monitor for the service</param>
        /// <param name="autoRecover">True if service should come out of failover automatically when IPs come back up, False if the service should stay in failover until a user explicitly takes the service out of failover</param>
        /// <param name="ttl">Time To Live in seconds of records in the service. Must be less than 1/2 of the Health Probe's monitoring interval or "None" to not specify</param>
        /// <param name="notifyEvents">What events to send notifications on: ip - Send notifications when individual IPs change status, svc - Send notifications when the service state change</param>
        /// <param name="serveCount">How many records will be returned in each DNS response or -1 to not specify</param>
        /// <param name="failoverMode">Dynect default is 'global': ip - Failover to a particular IP, cname - Failover to a particular CNAME, global - Failover to the global IP address pool</param>
        /// <param name="failoverData">If failover_mode is 'ip', this should be an IPv4 address, If failover_mode is 'cname', this should be a CNAME, If failover_mode is 'global' this should be null or empty</param>
        /// <returns>The created load balance data or null if failed to create</returns>
        public net.dynect.api2.LoadBalanceData CreateLoadBalance(string zone, string fqdn, string contactNickname, net.dynect.api2.LoadBalanceAddress[] loadBalancePool,
            net.dynect.api2.MonitorData monitorData, Boolean autoRecover, TTLSeconds ttl, MonitorNotificationEvent notifyEvents, int serveCount,
            FailoverMode failoverMode, string failoverData)
        {
            if (sessionData == null)
                return null;

            net.dynect.api2.LoadBalanceData retVal = null;
            try
            {
                net.dynect.api2.CreateLoadBalanceRequestType request = new DynSoapWrapper.net.dynect.api2.CreateLoadBalanceRequestType();
                request.token = sessionData.token;
                request.fault_incompat = 1;
                request.fault_incompatSpecified = true;
                request.zone = zone;
                request.fqdn = fqdn;
                request.failover_mode = failoverMode.ToString();
                request.auto_recover = autoRecover ? "Y" : "N";
                request.contact_nickname = contactNickname;
                request.failover_data = failoverMode == FailoverMode.global ? string.Empty : failoverData;
                request.monitor = monitorData;
                request.notify_events = MonitorNotificationEventToString(notifyEvents);
                request.pool = loadBalancePool;
                if (serveCount > -1)
                {
                    request.serve_count = serveCount;
                    request.serve_countSpecified = true;
                }
                else
                {
                    request.serve_countSpecified = false;
                }
                if (ttl == TTLSeconds.NONE)
                {
                    request.ttlSpecified = false;
                }
                else
                {
                    request.ttl = (int)ttl;
                    request.ttlSpecified = true;
                }
                net.dynect.api2.CreateLoadBalanceResponseType response = dynectWsdl.CreateLoadBalance(request);

                retVal = response.data;
            }
            catch (Exception ex)
            {
                ;// TODO: Do your custom error handling here....
            }

            return retVal;
        }
        /// <summary>
        /// Creates a new Global Server Load Balancing service
        /// </summary>
        /// <param name="zone">zone to create GSLB at</param>
        /// <param name="fqdn">address to create GSLB at</param>
        /// <param name="regions">a list of regions</param>
        /// <param name="autoRecover"> true if the service should come out of failover automatically when IPs come back up, false if the service should stay in failover until a user explicitly takes the service out of failover</param>
        /// <param name="notifyEvents">What events to send notifications on: ip - Send notifications when individual IPs change status, svc - Send notifications when the service state changes</param>
        /// <param name="monitorData">The health monitor for the service</param>
        /// <param name="contactNickname">Name of contact to receive notifications</param>
        /// <param name="ttl">Time To Live in seconds of records in the service. Must be less than 1/2 of the Health Probe's monitoring interval.</param>
        /// <returns>The created service object if successfull</returns>
        public net.dynect.api2.GSLBData CreateGSLB(string zone, string fqdn, net.dynect.api2.GSLBRegion[] regions, Boolean autoRecover, MonitorNotificationEvent notifyEvents,
            net.dynect.api2.MonitorData monitorData, string contactNickname, TTLSeconds ttl)
        {
            if (sessionData == null)
                return null;

            net.dynect.api2.GSLBData retVal = null;
            try
            {
                net.dynect.api2.CreateGSLBRequestType request = new DynSoapWrapper.net.dynect.api2.CreateGSLBRequestType();
                request.token = sessionData.token;
                request.fault_incompat = 1;
                request.fault_incompatSpecified = true;
                request.zone = zone;
                request.fqdn = fqdn;
                request.region = regions;
                request.auto_recover = autoRecover ? "Y" : "N";
                request.notify_events = MonitorNotificationEventToString(notifyEvents);
                request.monitor = monitorData;
                request.contact_nickname = contactNickname;
                if (ttl == TTLSeconds.NONE)
                {
                    request.ttlSpecified = false;
                }
                else
                {
                    request.ttl = (int)ttl;
                    request.ttlSpecified = true;
                }
                net.dynect.api2.CreateGSLBResponseType response = dynectWsdl.CreateGSLB(request);

                retVal = response.data;
            }
            catch (Exception ex)
            {
                ;// TODO: Do your custom error handling here....
            }

            return retVal;
        }
        /// <summary>
        /// Creates a new CNAME record at a zone/node
        /// </summary>
        /// <param name="zone">The zone to create the CNAME record in</param>
        /// <param name="fqdn">The fqdn to create the CNAME record in</param>
        /// <param name="hostname">The hostname to add</param>
        /// <param name="ttl">The ttl to add</param>
        /// <returns></returns>
        public net.dynect.api2.CNAMERecordData CreateCNAMERecord(string zone, string fqdn, string hostname, TTLSeconds ttl)
        {
            if (sessionData == null)
                return null;

            net.dynect.api2.CNAMERecordData retVal = null;

            try
            {
                net.dynect.api2.CreateCNAMERecordRequestType request = new DynSoapWrapper.net.dynect.api2.CreateCNAMERecordRequestType();
                request.token = sessionData.token;
                request.fault_incompat = 1;
                request.fault_incompatSpecified = true;
                request.zone = zone;
                request.fqdn = fqdn;
                request.rdata = new DynSoapWrapper.net.dynect.api2.RDataCNAME();
                request.rdata.cname = hostname;
                request.ttl = (int)ttl;
                net.dynect.api2.CreateCNAMERecordResponseType response = dynectWsdl.CreateCNAMERecord(request);
                retVal = response.data;

            }
            catch (Exception ex)
            {
                ;// TODO: Do your custom error handling here....
            }

            return retVal;
        }