public override bool IsEdit()
        {
            var builder = new StringBuilder();

            builder.Append(Consts.SAMPLE_INTERFACE).Append(" ").Append(Consts.SAMPLE_VISA_PREFIX);
            var  intfcEditPrefix = builder.ToString();
            bool isEdit          = false;

            if (DeviceName.Equals(Consts.SAMPLE_INTERFACE))
            {
                isEdit = false;
            }
            else if (DeviceName.StartsWith(intfcEditPrefix))
            {
                isEdit = true;
            }
            return(isEdit);
        }
Exemple #2
0
 void SetAndroidVersion()
 {
     if (AndroidVersion.Equals("JellyBean"))
     {
         AndroidVersionForRequest = "AV052";
     }
     else if (AndroidVersion.Equals("Lollipop"))
     {
         AndroidVersionForRequest = "AV0L0";
     }
     else
     {
         //Some devices (Intel ?) need specific version
         if (DeviceName.Equals("A1-840FHD") || DeviceName.Equals("A1-724") ||
             DeviceName.Equals("A1-840"))
         {
             AndroidVersionForRequest = "AV0K1";
         }
         else
         {
             AndroidVersionForRequest = "AV0K0";
         }
     }
 }
Exemple #3
0
 public bool Equals(DeviceDescriptor a)
 {
     return(ClientAddr.Equals(a.ClientAddr) && DeviceName.Equals(a.DeviceName));
 }
Exemple #4
0
        public void UpdateNetwork(ZeroTierNetwork network)
        {
            if (network == null)
            {
                return;
            }

            if (!NetworkId.Equals(network.NetworkId))
            {
                NetworkId = network.NetworkId;
            }

            if (!MacAddress.Equals(network.MacAddress))
            {
                MacAddress = network.MacAddress;
            }

            if (!NetworkName.Equals(network.NetworkName))
            {
                NetworkName = network.NetworkName;
            }

            if (!NetworkStatus.Equals(network.NetworkStatus))
            {
                NetworkStatus = network.NetworkStatus;
            }

            if (!NetworkType.Equals(network.NetworkType))
            {
                NetworkType = network.NetworkType;
            }

            if (MTU != network.MTU)
            {
                MTU = network.MTU;
            }

            if (DHCP != network.DHCP)
            {
                DHCP = network.DHCP;
            }

            if (Bridge != network.Bridge)
            {
                Bridge = network.Bridge;
            }

            if (BroadcastEnabled != network.BroadcastEnabled)
            {
                BroadcastEnabled = network.BroadcastEnabled;
            }

            if (PortError != network.PortError)
            {
                PortError = network.PortError;
            }

            if (NetconfRevision != network.NetconfRevision)
            {
                NetconfRevision = network.NetconfRevision;
            }

            AssignedAddresses = network.AssignedAddresses;

            Routes = network.Routes;

            if (!DeviceName.Equals(network.DeviceName))
            {
                DeviceName = network.DeviceName;
            }

            if (AllowManaged != network.AllowManaged)
            {
                AllowManaged = network.AllowManaged;
            }

            if (AllowGlobal != network.AllowGlobal)
            {
                AllowGlobal = network.AllowGlobal;
            }

            if (AllowDefault != network.AllowDefault)
            {
                AllowDefault = network.AllowDefault;
            }

            if (IsConnected != network.IsConnected)
            {
                IsConnected = network.IsConnected;
            }
        }
Exemple #5
0
        /// <summary>
        /// Returns true if DetailedActivity instances are equal
        /// </summary>
        /// <param name="other">Instance of DetailedActivity to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DetailedActivity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                     ) &&
                 (
                     Photos == other.Photos ||
                     Photos != null &&
                     Photos.Equals(other.Photos)
                 ) &&
                 (
                     Gear == other.Gear ||
                     Gear != null &&
                     Gear.Equals(other.Gear)
                 ) &&
                 (
                     Calories == other.Calories ||
                     Calories != null &&
                     Calories.Equals(other.Calories)
                 ) &&
                 (
                     SegmentEfforts == other.SegmentEfforts ||
                     SegmentEfforts != null &&
                     SegmentEfforts.SequenceEqual(other.SegmentEfforts)
                 ) &&
                 (
                     DeviceName == other.DeviceName ||
                     DeviceName != null &&
                     DeviceName.Equals(other.DeviceName)
                 ) &&
                 (
                     EmbedToken == other.EmbedToken ||
                     EmbedToken != null &&
                     EmbedToken.Equals(other.EmbedToken)
                 ) &&
                 (
                     SplitsMetric == other.SplitsMetric ||
                     SplitsMetric != null &&
                     SplitsMetric.SequenceEqual(other.SplitsMetric)
                 ) &&
                 (
                     SplitsStandard == other.SplitsStandard ||
                     SplitsStandard != null &&
                     SplitsStandard.SequenceEqual(other.SplitsStandard)
                 ) &&
                 (
                     Laps == other.Laps ||
                     Laps != null &&
                     Laps.SequenceEqual(other.Laps)
                 ) &&
                 (
                     BestEfforts == other.BestEfforts ||
                     BestEfforts != null &&
                     BestEfforts.SequenceEqual(other.BestEfforts)
                 ));
        }